Source Code Cross Referenced for BreakdownElementTest.java in  » Workflow-Engines » wilos » wilos » test » model » spem2 » breakdownelement » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » wilos » wilos.test.model.spem2.breakdownelement 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
003:         * Copyright (C) 2006-2007 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
004:         *
005:         * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
006:         * General Public License as published by the Free Software Foundation; either version 2 of the License,
007:         * or (at your option) any later version.
008:         *
009:         * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
010:         * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011:         * GNU General Public License for more details.
012:         *
013:         * You should have received a copy of the GNU General Public License along with this program; if not,
014:         * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
015:         */
016:        package wilos.test.model.spem2.breakdownelement;
017:
018:        import static org.junit.Assert.*;
019:
020:        import java.util.HashSet;
021:        import java.util.Set;
022:
023:        import org.junit.After;
024:        import org.junit.Before;
025:        import org.junit.Test;
026:
027:        import wilos.model.spem2.activity.Activity;
028:        import wilos.model.spem2.breakdownelement.BreakdownElement;
029:
030:        public class BreakdownElementTest {
031:
032:            private BreakdownElement breakdownElement;
033:
034:            @Before
035:            public void setUp() throws Exception {
036:                this .breakdownElement = new BreakdownElement();
037:                this .breakdownElement.setGuid("idEPF1");
038:                this .breakdownElement.setName("name1");
039:                this .breakdownElement.setDescription("description1");
040:                this .breakdownElement.setPrefix("prefix1");
041:                this .breakdownElement.setIsOptional(true);
042:                this .breakdownElement.setIsPlanned(false);
043:                this .breakdownElement.setHasMultipleOccurrences(false);
044:            }
045:
046:            @After
047:            public void tearDown() throws Exception {
048:                //None.
049:            }
050:
051:            @Test
052:            public void testClone() {
053:                try {
054:                    assertEquals(this .breakdownElement, this .breakdownElement
055:                            .clone());
056:                } catch (CloneNotSupportedException e) {
057:                    fail("Error CloneNotSupportedException in the testClone method");
058:                }
059:            }
060:
061:            @Test
062:            public void testHashCode() {
063:                // Rk: the setUp method is called here.
064:
065:                BreakdownElement bdeTmp1 = new BreakdownElement();
066:                bdeTmp1.setGuid("idEPF1");
067:                bdeTmp1.setName("name1");
068:                bdeTmp1.setDescription("description1");
069:                bdeTmp1.setPrefix("prefix1");
070:                bdeTmp1.setIsOptional(true);
071:                bdeTmp1.setIsPlanned(false);
072:                bdeTmp1.setHasMultipleOccurrences(false);
073:
074:                assertNotNull(this .breakdownElement.hashCode());
075:                assertNotNull(bdeTmp1.hashCode());
076:                assertEquals(this .breakdownElement.hashCode(), bdeTmp1
077:                        .hashCode());
078:
079:                // Rk: the tearDown method is called here.
080:            }
081:
082:            @Test
083:            public void testEquals() {
084:                // Rk: the setUp method is called here.
085:
086:                // Assert if it's equal by references.
087:                assertTrue("By references", this .breakdownElement
088:                        .equals(this .breakdownElement));
089:
090:                // Assert if it's equal field by field.
091:                BreakdownElement bdeTmp1 = new BreakdownElement();
092:                bdeTmp1.setGuid("idEPF1");
093:                bdeTmp1.setName("name1");
094:                bdeTmp1.setDescription("description1");
095:                bdeTmp1.setPrefix("prefix1");
096:                bdeTmp1.setIsOptional(true);
097:                bdeTmp1.setIsPlanned(false);
098:                bdeTmp1.setHasMultipleOccurrences(false);
099:                assertTrue("Field by field", this .breakdownElement
100:                        .equals(bdeTmp1));
101:
102:                // Assert if it's not equal.
103:                BreakdownElement bdeTmp2 = new BreakdownElement();
104:                bdeTmp2.setGuid("idEPF2");
105:                bdeTmp2.setName("name2");
106:                bdeTmp2.setDescription("description2");
107:                bdeTmp2.setPrefix("prefix2");
108:                bdeTmp2.setIsOptional(true);
109:                bdeTmp2.setIsPlanned(false);
110:                bdeTmp2.setHasMultipleOccurrences(false);
111:                assertFalse("Not equals", this .breakdownElement.equals(bdeTmp2));
112:
113:                // Rk: the tearDown method is called here.
114:            }
115:
116:            @Test
117:            public void testAddToActivity() {
118:                // Rk: the setUp method is called here.
119:
120:                assertTrue("Empty (begin)", this .breakdownElement
121:                        .getSuperActivities().isEmpty());
122:
123:                Activity activity1 = new Activity();
124:                activity1.setGuid("idEPF");
125:                activity1.setName("name1");
126:                activity1.setDescription("description1");
127:                activity1.setPrefix("prefix1");
128:                activity1.setIsOptional(true);
129:                activity1.setIsPlanned(false);
130:                activity1.setHasMultipleOccurrences(false);
131:                activity1.setIsEvenDriven(true);
132:                activity1.setIsOngoing(false);
133:                activity1.setIsRepeatable(true);
134:                this .breakdownElement.addSuperActivity(activity1);
135:                assertTrue("acts.size == 1", this .breakdownElement
136:                        .getSuperActivities().size() == 1);
137:                assertTrue("bdes.size1 == 1", activity1.getBreakdownElements()
138:                        .size() == 1);
139:
140:                Activity activity2 = new Activity();
141:                activity2.setGuid("idEPF");
142:                activity2.setName("name2");
143:                activity2.setDescription("description2");
144:                activity2.setPrefix("prefix2");
145:                activity2.setIsOptional(true);
146:                activity2.setIsPlanned(false);
147:                activity2.setHasMultipleOccurrences(false);
148:                activity2.setIsEvenDriven(true);
149:                activity2.setIsOngoing(false);
150:                activity2.setIsRepeatable(true);
151:                this .breakdownElement.addSuperActivity(activity2);
152:                assertTrue("acts.size ==  2", this .breakdownElement
153:                        .getSuperActivities().size() == 2);
154:                assertTrue("bdes.size2 ==  1", activity2.getBreakdownElements()
155:                        .size() == 1);
156:
157:                // Rk: the tearDown method is called here.
158:            }
159:
160:            @Test
161:            public void testAddToAllActivities() {
162:                // Rk: the setUp method is called here.
163:
164:                Activity activity1 = new Activity();
165:                activity1.setGuid("idEPF");
166:                activity1.setName("name1");
167:                activity1.setDescription("description1");
168:                activity1.setPrefix("prefix1");
169:                activity1.setIsOptional(true);
170:                activity1.setIsPlanned(false);
171:                activity1.setHasMultipleOccurrences(false);
172:                activity1.setIsEvenDriven(true);
173:                activity1.setIsOngoing(false);
174:                activity1.setIsRepeatable(true);
175:
176:                Activity activity2 = new Activity();
177:                activity2.setGuid("idEPF");
178:                activity2.setName("name2");
179:                activity2.setDescription("description2");
180:                activity2.setPrefix("prefix2");
181:                activity2.setIsOptional(true);
182:                activity2.setIsPlanned(false);
183:                activity2.setHasMultipleOccurrences(false);
184:                activity2.setIsEvenDriven(true);
185:                activity2.setIsOngoing(false);
186:                activity2.setIsRepeatable(true);
187:
188:                Set<Activity> activities = new HashSet<Activity>();
189:                activities.add(activity1);
190:                activities.add(activity2);
191:
192:                this .breakdownElement.addAllSuperActivities(activities);
193:
194:                assertTrue("acts.size ==  2", this .breakdownElement
195:                        .getSuperActivities().size() == 2);
196:                assertTrue("bdes1.size == 1", activity1.getBreakdownElements()
197:                        .size() == 1);
198:                assertTrue("bdes2.size == 1", activity2.getBreakdownElements()
199:                        .size() == 1);
200:
201:                // Rk: the tearDown method is called here.
202:            }
203:
204:            @Test
205:            public void testRemoveFromActivity() {
206:                // Rk: the setUp method is called here.
207:
208:                Activity activity = new Activity();
209:                activity.setGuid("idEPF");
210:                activity.setName("name1");
211:                activity.setDescription("description1");
212:                activity.setPrefix("prefix1");
213:                activity.setIsOptional(true);
214:                activity.setIsPlanned(false);
215:                activity.setHasMultipleOccurrences(false);
216:                activity.setIsEvenDriven(true);
217:                activity.setIsOngoing(false);
218:                activity.setIsRepeatable(true);
219:                this .breakdownElement.addSuperActivity(activity);
220:                this .breakdownElement.removeSuperActivity(activity);
221:
222:                assertTrue(this .breakdownElement.getSuperActivities().isEmpty());
223:                assertTrue(activity.getBreakdownElements().isEmpty());
224:
225:                // Rk: the tearDown method is called here.
226:            }
227:
228:            @Test
229:            public void testRemoveFromAllActivities() {
230:                // Rk: the setUp method is called here.
231:
232:                Activity activity = new Activity();
233:                activity.setGuid("idEPF");
234:                activity.setName("name1");
235:                activity.setDescription("description1");
236:                activity.setPrefix("prefix1");
237:                activity.setIsOptional(true);
238:                activity.setIsPlanned(false);
239:                activity.setHasMultipleOccurrences(false);
240:                activity.setIsEvenDriven(true);
241:                activity.setIsOngoing(false);
242:                activity.setIsRepeatable(true);
243:
244:                Activity activity2 = new Activity();
245:                activity2.setGuid("idEPF");
246:                activity2.setName("name2");
247:                activity2.setDescription("description2");
248:                activity2.setPrefix("prefix2");
249:                activity2.setIsOptional(true);
250:                activity2.setIsPlanned(false);
251:                activity2.setHasMultipleOccurrences(false);
252:                activity2.setIsEvenDriven(true);
253:                activity2.setIsOngoing(false);
254:                activity2.setIsRepeatable(true);
255:
256:                Set<Activity> set = new HashSet<Activity>();
257:                set.add(activity);
258:                set.add(activity2);
259:
260:                this .breakdownElement.addAllSuperActivities(set);
261:                this .breakdownElement.removeAllSuperActivities();
262:
263:                assertTrue(this .breakdownElement.getSuperActivities().isEmpty());
264:                assertTrue(activity.getBreakdownElements().isEmpty());
265:                assertTrue(activity2.getBreakdownElements().isEmpty());
266:
267:                // Rk: the tearDown method is called here.
268:            }
269:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.