Source Code Cross Referenced for JdoCommunityNodeTest.java in  » Portal » Open-Portal » com » sun » portal » community » mc » test » 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 » Portal » Open Portal » com.sun.portal.community.mc.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005 Sun Microsystems, Inc. All
003:         * rights reserved. Use of this product is subject
004:         * to license terms. Federal Acquisitions:
005:         * Commercial Software -- Government Users
006:         * Subject to Standard License Terms and
007:         * Conditions.
008:         *
009:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
010:         * are trademarks or registered trademarks of Sun Microsystems,
011:         * Inc. in the United States and other countries.
012:         */
013:        package com.sun.portal.community.mc.test;
014:
015:        import java.util.*;
016:        import java.util.regex.*;
017:        import com.sun.portal.community.mc.*;
018:        import junit.framework.*;
019:        import com.sun.portal.community.mc.impl.Debug;
020:        import java.io.UnsupportedEncodingException;
021:
022:        public class JdoCommunityNodeTest extends JdoCommunityTest implements 
023:                CMCNodeTest {
024:            public JdoCommunityNodeTest(String testName) {
025:                super (testName);
026:            }
027:
028:            protected void setUp() throws java.lang.Exception {
029:                super .setUp();
030:                Debug.log("JdoCommunityNodeTest", "setUp", "called");
031:            }
032:
033:            protected void tearDown() throws java.lang.Exception {
034:                super .tearDown();
035:                Debug.log("JdoCommunityNodeTest", "tearDown", "called");
036:            }
037:
038:            public static Test suite() {
039:                TestSuite suite = new TestSuite(JdoCommunityNodeTest.class);
040:                return suite;
041:            }
042:
043:            public void testGetCommunityPrincipal() {
044:                Debug.log("JdoCommunityNodeTest", "testGetCommunityPrincipal",
045:                        "called");
046:
047:                try {
048:                    CMCPrincipal cp = cty1Node.getCMCPrincipal();
049:                    assertNotNull(cp);
050:                    assertEquals(cty1Cp, cp);
051:                } catch (CMCException ce) {
052:                    Debug.log("JdoCommunityNodeTest",
053:                            "testGetCommunityPrincipal", ce);
054:                    fail(ce.getMessage());
055:                }
056:            }
057:
058:            public void testCreate() {
059:                Debug.log("JdoCommunityNodeTest", "testCreate", "called");
060:
061:                try {
062:                    createNodes();
063:                    removeNodes();
064:                } catch (CMCException ce) {
065:                    Debug.log("JdoCommunityNodeTest", "testCreate", ce);
066:                    fail(ce.getMessage());
067:                }
068:            }
069:
070:            public void testSupportsCreate() {
071:                try {
072:                    Debug.log("JdoCommunityNodeTest", "testSupportsCreate",
073:                            "called");
074:                    assertTrue(cty1Node.supportsCreate());
075:                } catch (CMCException ce) {
076:                    Debug.log("JdoCommunityNodeTest", "testSupportsCreate", ce);
077:                    fail(ce.getMessage());
078:                }
079:            }
080:
081:            public void testExists() {
082:                Debug.log("JdoCommunityNodeTest", "testExists", "called");
083:
084:                try {
085:                    assertFalse(cty1Node.exists());
086:                    createNodes();
087:                    assertTrue(cty1Node.exists());
088:                    removeNodes();
089:                } catch (CMCException ce) {
090:                    Debug.log("JdoCommunityNodeTest", "testExists", ce);
091:                    fail(ce.getMessage());
092:                }
093:            }
094:
095:            public void testAddUsers() {
096:                Debug.log("JdoCommunityNodeTest", "testAddUsers", "called");
097:
098:                try {
099:                    createNodes();
100:                    addUsers();
101:                    removeNodes();
102:                } catch (CMCException ce) {
103:                    Debug.log("JdoCommunityNodeTest", "testAddUsers", ce);
104:                    fail(ce.getMessage());
105:                }
106:            }
107:
108:            public void testAddRole() {
109:                Debug.log("JdoCommunityNodeTest", "testAddRole", "called");
110:
111:                try {
112:                    createNodes();
113:                    addRoles();
114:                    removeNodes();
115:                } catch (CMCException ce) {
116:                    Debug.log("JdoCommunityNodeTest", "testAddRole", ce);
117:                    fail(ce.getMessage());
118:                }
119:            }
120:
121:            public void testGetUsers() {
122:                Debug.log("JdoCommunityNodeTest", "testGetUsers", "called");
123:
124:                try {
125:                    createNodes();
126:
127:                    Set allUsers = cty1Node.getUsers();
128:                    assertEquals(0, allUsers.size());
129:
130:                    Set visitorUsers = cty1Node.getUsers(Collections
131:                            .singleton(CMCRolePrincipal.VISITOR_ROLE));
132:                    assertEquals(0, visitorUsers.size());
133:
134:                    Set memberUsers = cty1Node.getUsers(Collections
135:                            .singleton(CMCRolePrincipal.MEMBER_ROLE));
136:                    assertEquals(0, memberUsers.size());
137:
138:                    Set ownerUsers = cty1Node.getUsers(Collections
139:                            .singleton(CMCRolePrincipal.OWNER_ROLE));
140:                    assertEquals(0, ownerUsers.size());
141:
142:                    Set invitedUsers = cty1Node.getUsers(Collections
143:                            .singleton(CMCRolePrincipal.INVITED_ROLE));
144:                    assertEquals(0, invitedUsers.size());
145:
146:                    Set rejectedUsers = cty1Node.getUsers(Collections
147:                            .singleton(CMCRolePrincipal.REJECTED_ROLE));
148:                    assertEquals(0, rejectedUsers.size());
149:
150:                    Set bannedUsers = cty1Node.getUsers(Collections
151:                            .singleton(CMCRolePrincipal.BANNED_ROLE));
152:                    assertEquals(0, bannedUsers.size());
153:
154:                    Set pendingUsers = cty1Node.getUsers(Collections
155:                            .singleton(CMCRolePrincipal.PENDING_ROLE));
156:                    assertEquals(0, pendingUsers.size());
157:
158:                    addUsers();
159:
160:                    allUsers = cty1Node.getUsers();
161:                    assertEquals(7, allUsers.size());
162:
163:                    visitorUsers = cty1Node.getUsers(Collections
164:                            .singleton(CMCRolePrincipal.VISITOR_ROLE));
165:                    assertEquals(1, visitorUsers.size());
166:
167:                    memberUsers = cty1Node.getUsers(Collections
168:                            .singleton(CMCRolePrincipal.MEMBER_ROLE));
169:                    assertEquals(2, memberUsers.size());
170:
171:                    ownerUsers = cty1Node.getUsers(Collections
172:                            .singleton(CMCRolePrincipal.OWNER_ROLE));
173:                    assertEquals(1, ownerUsers.size());
174:
175:                    invitedUsers = cty1Node.getUsers(Collections
176:                            .singleton(CMCRolePrincipal.INVITED_ROLE));
177:                    assertEquals(1, invitedUsers.size());
178:
179:                    rejectedUsers = cty1Node.getUsers(Collections
180:                            .singleton(CMCRolePrincipal.REJECTED_ROLE));
181:                    assertEquals(1, rejectedUsers.size());
182:
183:                    bannedUsers = cty1Node.getUsers(Collections
184:                            .singleton(CMCRolePrincipal.BANNED_ROLE));
185:                    assertEquals(1, bannedUsers.size());
186:
187:                    pendingUsers = cty1Node.getUsers(Collections
188:                            .singleton(CMCRolePrincipal.PENDING_ROLE));
189:                    assertEquals(1, pendingUsers.size());
190:
191:                    removeNodes();
192:                } catch (CMCException ce) {
193:                    Debug.log("JdoCommunityNodeTest", "testGetUsers", ce);
194:                    fail(ce.getMessage());
195:                }
196:            }
197:
198:            public void testGetRoles() {
199:                Debug.log("JdoCommunityNodeTest", "testGetRoles", "called");
200:
201:                try {
202:                    createNodes();
203:
204:                    Set roles = cty1Node.getRoles();
205:                    assertEquals(0, roles.size());
206:
207:                    addRoles();
208:
209:                    roles = cty1Node.getRoles();
210:                    assertEquals(1, roles.size());
211:
212:                    removeNodes();
213:                } catch (CMCException ce) {
214:                    Debug.log("JdoCommunityNodeTest", "testGetRoles", ce);
215:                    fail(ce.getMessage());
216:                }
217:            }
218:
219:            public void testSupportsAddUsers() {
220:                try {
221:                    Debug.log("JdoCommunityNodeTest", "testSupportsAddUsers",
222:                            "called");
223:                    assertTrue(cty1Node.supportsAddUsers());
224:                } catch (CMCException ce) {
225:                    Debug.log("JdoCommunityNodeTest", "testSupportsAddUsers",
226:                            ce);
227:                    fail(ce.getMessage());
228:                }
229:            }
230:
231:            public void testSupportsAddRole() {
232:                try {
233:                    Debug.log("JdoCommunityNodeTest", "testSupportsAddRole",
234:                            "called");
235:                    assertTrue(cty1Node.supportsAddRole());
236:                } catch (CMCException ce) {
237:                    Debug
238:                            .log("JdoCommunityNodeTest", "testSupportsAddRole",
239:                                    ce);
240:                    fail(ce.getMessage());
241:                }
242:            }
243:
244:            public void testRemoveUsers() {
245:                Debug.log("JdoCommunityNodeTest", "testRemoveUsers", "called");
246:
247:                try {
248:                    createNodes();
249:
250:                    addUsers();
251:                    assertEquals(7, cty1Node.getUsers().size());
252:
253:                    Set users = new HashSet();
254:                    users.add(xUserName);
255:
256:                    Set rps = new HashSet();
257:                    rps.add(CMCRolePrincipal.VISITOR_ROLE);
258:
259:                    cty1Node.removeUsers(users, rps);
260:                    assertEquals(6, cty1Node.getUsers().size());
261:
262:                    rps.add(CMCRolePrincipal.MEMBER_ROLE);
263:                    cty1Node.removeUsers(users, rps);
264:
265:                    assertEquals(6, cty1Node.getUsers().size());
266:
267:                    users.add(yUserName);
268:                    cty1Node.removeUsers(users, rps);
269:                    assertEquals(5, cty1Node.getUsers().size());
270:
271:                    users.add(zUserName);
272:                    cty1Node.removeUsers(users, rps);
273:                    assertEquals(5, cty1Node.getUsers().size());
274:
275:                    rps.add(CMCRolePrincipal.OWNER_ROLE);
276:                    cty1Node.removeUsers(users, rps);
277:                    assertEquals(4, cty1Node.getUsers().size());
278:
279:                    users.add(tUserName);
280:                    rps.add(CMCRolePrincipal.PENDING_ROLE);
281:                    cty1Node.removeUsers(users, rps);
282:                    assertEquals(3, cty1Node.getUsers().size());
283:
284:                    users.add(uUserName);
285:                    rps.add(CMCRolePrincipal.BANNED_ROLE);
286:                    cty1Node.removeUsers(users, rps);
287:                    assertEquals(2, cty1Node.getUsers().size());
288:
289:                    users.add(vUserName);
290:                    rps.add(CMCRolePrincipal.INVITED_ROLE);
291:                    cty1Node.removeUsers(users, rps);
292:                    assertEquals(1, cty1Node.getUsers().size());
293:
294:                    users.add(wUserName);
295:                    rps.add(CMCRolePrincipal.REJECTED_ROLE);
296:                    cty1Node.removeUsers(users, rps);
297:                    assertEquals(0, cty1Node.getUsers().size());
298:
299:                    removeNodes();
300:                } catch (CMCException ce) {
301:                    Debug.log("JdoCommunityNodeTest", "testAddUsers", ce);
302:                    fail(ce.getMessage());
303:                }
304:            }
305:
306:            public void testRemoveRole() {
307:                Debug.log("JdoCommunityNodeTest", "testRemoveRole", "called");
308:
309:                try {
310:                    createNodes();
311:
312:                    addRoles();
313:                    assertEquals(1, cty1Node.getRoles().size());
314:
315:                    removeRoles();
316:                    assertEquals(0, cty1Node.getRoles().size());
317:
318:                    removeNodes();
319:                } catch (CMCException ce) {
320:                    Debug.log("JdoCommunityNodeTest", "testRemoveRole", ce);
321:                    fail(ce.getMessage());
322:                }
323:            }
324:
325:            public void testSupportsRemoveUsers() {
326:                try {
327:                    Debug.log("JdoCommunityNodeTest",
328:                            "testSupportsRemoveUsers", "called");
329:                    assertTrue(cty1Node.supportsRemoveUsers());
330:                } catch (CMCException ce) {
331:                    Debug.log("JdoCommunityNodeTest",
332:                            "testSupportsRemoveUsers", ce);
333:                    fail(ce.getMessage());
334:                }
335:            }
336:
337:            public void testSupportsRemoveRole() {
338:                try {
339:                    Debug.log("JdoCommunityNodeTest", "testSupportsRemoveRole",
340:                            "called");
341:                    assertTrue(cty1Node.supportsRemoveRole());
342:                } catch (CMCException ce) {
343:                    Debug.log("JdoCommunityNodeTest", "testSupportsRemoveRole",
344:                            ce);
345:                    fail(ce.getMessage());
346:                }
347:            }
348:
349:            public void testSupportsRole() {
350:                try {
351:                    Debug.log("JdoCommunityNodeTest", "testSupportsRole",
352:                            "called");
353:                    assertTrue(cty1Node
354:                            .supportsRole(CMCRolePrincipal.VISITOR_ROLE));
355:                    assertTrue(cty1Node
356:                            .supportsRole(CMCRolePrincipal.MEMBER_ROLE));
357:                    assertTrue(cty1Node
358:                            .supportsRole(CMCRolePrincipal.OWNER_ROLE));
359:                    assertTrue(cty1Node
360:                            .supportsRole(CMCRolePrincipal.INVITED_ROLE));
361:                    assertTrue(cty1Node
362:                            .supportsRole(CMCRolePrincipal.REJECTED_ROLE));
363:                    assertTrue(cty1Node
364:                            .supportsRole(CMCRolePrincipal.PENDING_ROLE));
365:                    assertTrue(cty1Node
366:                            .supportsRole(CMCRolePrincipal.BANNED_ROLE));
367:
368:                } catch (CMCException ce) {
369:                    Debug.log("JdoCommunityNodeTest", "testSupportsRole", ce);
370:                    fail(ce.getMessage());
371:                }
372:            }
373:
374:            public void testRemove() {
375:                Debug.log("JdoCommunityNodeTest", "testRemove", "called");
376:
377:                try {
378:                    createNodes();
379:                    addUsers();
380:                    removeNodes();
381:                    assertFalse(cty1Node.exists());
382:                } catch (CMCException ce) {
383:                    Debug.log("JdoCommunityNodeTest", "testRemove", ce);
384:                    fail(ce.getMessage());
385:                }
386:            }
387:
388:            public void testSupportsRemove() {
389:                try {
390:                    Debug.log("JdoCommunityNodeTest", "testSupportsRemove",
391:                            "called");
392:                    assertTrue(cty1Node.supportsRemove());
393:                } catch (CMCException ce) {
394:                    Debug.log("JdoCommunityNodeTest", "testSupportsRemove", ce);
395:                    fail(ce.getMessage());
396:                }
397:            }
398:
399:            public void testSetDPDocuments() {
400:                Debug.log("JdoCommunityNodeTest", "testSetDPDocuments",
401:                        "called");
402:
403:                try {
404:                    createNodes();
405:                    setDPDocuments();
406:                    removeNodes();
407:                } catch (CMCException ce) {
408:                    Debug.log("CommunityUserTest", "testSetDPDocuments", ce);
409:                    fail(ce.getMessage());
410:                }
411:            }
412:
413:            public void testGetDPDocuments() {
414:                Debug.log("JdoCommunityNodeTest", "testGetDPDocuments",
415:                        "called");
416:
417:                try {
418:                    createNodes();
419:                    setDPDocuments();
420:
421:                    ConfigTable dpDocuments = cty1Node.getDPDocuments();
422:
423:                    try {
424:                        byte[] dpv = (byte[]) dpDocuments.get(cty1VisitorCk);
425:                        assertNotNull(dpv);
426:                        String dpvString = new String(dpv, "UTF-8");
427:                        assertEquals(CTY1_VISITOR_DP, dpvString);
428:
429:                        byte[] dpm = (byte[]) dpDocuments.get(cty1MemberCk);
430:                        assertNotNull(dpm);
431:                        String dpmString = new String(dpm, "UTF-8");
432:                        assertEquals(dpmString, CTY1_MEMBER_DP);
433:
434:                        byte[] dpo = (byte[]) dpDocuments.get(cty1OwnerCk);
435:                        assertNotNull(dpo);
436:                        String dpoString = new String(dpo, "UTF-8");
437:                        assertEquals(dpoString, CTY1_OWNER_DP);
438:
439:                        byte[] dpr = (byte[]) dpDocuments.get(cty1RejectedCk);
440:                        assertNotNull(dpr);
441:                        String dprString = new String(dpr, "UTF-8");
442:                        assertEquals(dprString, CTY1_REJECTED_DP);
443:
444:                        byte[] dpi = (byte[]) dpDocuments.get(cty1InvitedCk);
445:                        assertNotNull(dpi);
446:                        String dpiString = new String(dpi, "UTF-8");
447:                        assertEquals(dpiString, CTY1_INVITED_DP);
448:
449:                        byte[] dpb = (byte[]) dpDocuments.get(cty1BannedCk);
450:                        assertNotNull(dpb);
451:                        String dpbString = new String(dpb, "UTF-8");
452:                        assertEquals(dpbString, CTY1_BANNED_DP);
453:
454:                        byte[] dpp = (byte[]) dpDocuments.get(cty1PendingCk);
455:                        assertNotNull(dpp);
456:                        String dppString = new String(dpp, "UTF-8");
457:                        assertEquals(dppString, CTY1_PENDING_DP);
458:
459:                    } catch (UnsupportedEncodingException uee) {
460:                        fail("unsupported encoding");
461:                    }
462:                    removeNodes();
463:                } catch (CMCException ce) {
464:                    Debug.log("JdoCommunityNodeTest", "testExists", ce);
465:                    fail(ce.getMessage());
466:                }
467:            }
468:
469:            public void testGetDescription() {
470:                Debug.log("JDOCommunityNodeTest", "testGetDescription",
471:                        "called");
472:                try {
473:                    createNodes();
474:                    cty1Node.setDescription("TestDescription");
475:                    assertEquals("TestDescription", cty1Node.getDescription());
476:                    //removeNodes();
477:                } catch (UnsupportedOperationException ce) {
478:                    fail("unsupported description");
479:                } catch (CMCException ce) {
480:                    Debug.log("JdoCommunityNodeTest", "testGetDescription", ce);
481:                    fail(ce.getMessage());
482:                }
483:
484:            }
485:
486:            public void testSetDescription() {
487:                Debug.log("JDOCommunityNodeTest", "testSetDescription",
488:                        "called");
489:
490:                try {
491:                    createNodes();
492:                    cty1Node.setDescription("TestDescription");
493:                    assertEquals("TestDescription", cty1Node.getDescription());
494:                    removeNodes();
495:                } catch (UnsupportedOperationException ce) {
496:                    fail("unsupported description");
497:                } catch (CMCException ce) {
498:                    Debug.log("JdoCommunityNodeTest", "testGetDescription", ce);
499:                    fail(ce.getMessage());
500:                }
501:            }
502:
503:            public void testSupportsDescription() {
504:                Debug.log("JDOCommunityNodeTest", "testSupportsCategory",
505:                        "called");
506:                try {
507:                    assertTrue(cty1Node.supportsDescription());
508:                } catch (CMCException ce) {
509:                    Debug.log("JDOCommunityNodeTest", "testSupportsCategory",
510:                            ce);
511:                    fail(ce.getMessage());
512:                }
513:            }
514:
515:            public void testGetCategory() {
516:                Debug.log("JDOCommunityNodeTest", "testGetCategory", "called");
517:
518:                try {
519:                    createNodes();
520:                    cty1Node.setCategory("TestCategory");
521:                    assertEquals("TestCategory", cty1Node.getCategory());
522:                    removeNodes();
523:
524:                } catch (UnsupportedOperationException ce) {
525:                    fail("unsupported Category");
526:                } catch (CMCException ce) {
527:                    Debug.log("JDOCommunityNodeTest", "testGetCategory", ce);
528:                    fail(ce.getMessage());
529:                }
530:
531:            }
532:
533:            public void testSetCategory() {
534:                Debug.log("JDOCommunityNodeTest", "testGetCategory", "called");
535:
536:                try {
537:                    createNodes();
538:                    cty1Node.setCategory("TestCategory");
539:                    assertEquals("TestCategory", cty1Node.getCategory());
540:                    removeNodes();
541:                } catch (UnsupportedOperationException ce) {
542:                    fail("unsupported Category");
543:                } catch (CMCException ce) {
544:                    Debug.log("JDOCommunityNodeTest", "testgetCategory", ce);
545:                    fail(ce.getMessage());
546:                }
547:            }
548:
549:            public void testSupportsCategory() {
550:                Debug.log("JDOCommunityNodeTest", "testSupportsCategory",
551:                        "called");
552:                try {
553:                    assertTrue(cty1Node.supportsCategory());
554:                } catch (CMCException ce) {
555:                    Debug.log("JDOCommunityNodeTest", "testSupportsCategory",
556:                            ce);
557:                    fail(ce.getMessage());
558:                }
559:            }
560:
561:            public void testGetCommunityCreationTime() {
562:                Debug.log("JDOCommunityNodeTest",
563:                        "testGetCommunityCreationTime", "called");
564:
565:                try {
566:                    createNodes();
567:                    long time = cty1Node.getCommunityCreationTime();
568:                    assertTrue(time != -1);
569:                    assertTrue(time != 0);
570:                    removeNodes();
571:                } catch (UnsupportedOperationException ce) {
572:                    fail("unsupported getCommunityCreationTime");
573:                } catch (CMCException ce) {
574:                    Debug.log("JDOCommunityNodeTest",
575:                            "testCommunityCreationTime", ce);
576:                    fail(ce.getMessage());
577:                }
578:            }
579:
580:            public void testSupportsCommunityCreationTime() {
581:                Debug.log("JDOCommunityNodeTest",
582:                        "testSupportsCommunityCreationTime", "called");
583:                try {
584:                    assertTrue(cty1Node.supportsCommunityCreationTime());
585:                } catch (CMCException ce) {
586:                    Debug.log("JDOCommunityNodeTest",
587:                            "testSupportsCommunityCreationTime", ce);
588:                    fail(ce.getMessage());
589:                }
590:            }
591:
592:            public void testIsMembershipRestricted() {
593:                Debug.log("JDOCommunityNodeTest", "testIsMembershipRestricted",
594:                        "called");
595:
596:                try {
597:
598:                    createNodes();
599:                    cty1Node.setMembershipRestricted(false);
600:                    assertEquals(false, cty1Node.isMembershipRestricted());
601:                    cty1Node.setMembershipRestricted(true);
602:                    assertEquals(true, cty1Node.isMembershipRestricted());
603:                    removeNodes();
604:                } catch (UnsupportedOperationException ce) {
605:                    fail("unsupported testIsMembershipRestricted");
606:                } catch (CMCException ce) {
607:                    Debug.log("JDOCommunityNodeTest",
608:                            "testIsMembershipRestricted", ce);
609:                    fail(ce.getMessage());
610:                }
611:            }
612:
613:            public void testSetMembershipRestricted() {
614:                Debug.log("JDOCommunityNodeTest",
615:                        "testSetMembershipRestricted", "called");
616:
617:                try {
618:
619:                    createNodes();
620:                    cty1Node.setMembershipRestricted(false);
621:                    assertEquals(false, cty1Node.isMembershipRestricted());
622:                    cty1Node.setMembershipRestricted(true);
623:                    assertEquals(true, cty1Node.isMembershipRestricted());
624:                    removeNodes();
625:                } catch (UnsupportedOperationException ce) {
626:                    fail("unsupported testSetMembershipRestricted");
627:                } catch (CMCException ce) {
628:                    Debug.log("JDOCommunityNodeTest",
629:                            "testSetMembershipRestricted", ce);
630:                    fail(ce.getMessage());
631:                }
632:            }
633:
634:            public void testSupportsMembershipRestriction() {
635:                Debug.log("JDOCommunityNodeTest",
636:                        "testSupportsMembershipRestriction", "called");
637:                try {
638:                    assertTrue(cty1Node.supportsMembershipRestriction());
639:                } catch (CMCException ce) {
640:                    Debug.log("JDOCommunityNodeTest",
641:                            "testSupportsMembershipRestriction", ce);
642:                    fail(ce.getMessage());
643:                }
644:            }
645:
646:            public void testIsSecure() {
647:                Debug.log("JDOCommunityNodeTest", "testIsSecure", "called");
648:
649:                try {
650:
651:                    createNodes();
652:                    cty1Node.setSecure(false);
653:                    assertEquals(false, cty1Node.isSecure());
654:                    cty1Node.setSecure(true);
655:                    assertEquals(true, cty1Node.isSecure());
656:                    removeNodes();
657:                } catch (UnsupportedOperationException ce) {
658:                    fail("unsupported testIsSecure");
659:                } catch (CMCException ce) {
660:                    Debug.log("JDOCommunityNodeTest", "testIsSecure", ce);
661:                    fail(ce.getMessage());
662:                }
663:            }
664:
665:            public void testSetSecure() {
666:                Debug.log("JDOCommunityNodeTest", "testSetSecure", "called");
667:
668:                try {
669:
670:                    createNodes();
671:                    cty1Node.setSecure(false);
672:                    assertEquals(false, cty1Node.isSecure());
673:                    cty1Node.setSecure(true);
674:                    assertEquals(true, cty1Node.isSecure());
675:                    removeNodes();
676:                } catch (UnsupportedOperationException ce) {
677:                    fail("unsupported testSetSecure");
678:                } catch (CMCException ce) {
679:                    Debug.log("JDOCommunityNodeTest", "testSetSecure", ce);
680:                    fail(ce.getMessage());
681:                }
682:            }
683:
684:            public void testSupportsSecuring() {
685:                Debug.log("JDOCommunityNodeTest", "testSupportsSecuring",
686:                        "called");
687:                try {
688:                    createNodes();
689:                    assertTrue(cty1Node.supportsSecuring());
690:                    removeNodes();
691:                } catch (CMCException ce) {
692:                    Debug.log("JDOCommunityNodeTest", "testSupportsSecuring",
693:                            ce);
694:                    fail(ce.getMessage());
695:                }
696:            }
697:
698:            public void testIsListed() {
699:                Debug.log("JDOCommunityNodeTest", "testIsListed", "called");
700:
701:                try {
702:
703:                    createNodes();
704:                    cty1Node.setListed(false);
705:                    assertEquals(false, cty1Node.isListed());
706:                    cty1Node.setListed(true);
707:                    assertEquals(true, cty1Node.isListed());
708:                    removeNodes();
709:                } catch (UnsupportedOperationException ce) {
710:                    fail("unsupported testIsListed");
711:                } catch (CMCException ce) {
712:                    Debug.log("JDOCommunityNodeTest", "testIsListed", ce);
713:                    fail(ce.getMessage());
714:                }
715:            }
716:
717:            public void testSetListed() {
718:                Debug.log("JDOCommunityNodeTest", "testIsListed", "called");
719:
720:                try {
721:
722:                    createNodes();
723:                    cty1Node.setListed(false);
724:                    assertEquals(false, cty1Node.isListed());
725:                    cty1Node.setListed(true);
726:                    assertEquals(true, cty1Node.isListed());
727:                    removeNodes();
728:                } catch (UnsupportedOperationException ce) {
729:                    fail("unsupported testSetListed");
730:                } catch (CMCException ce) {
731:                    Debug.log("JDOCommunityNodeTest", "testSetListed", ce);
732:                    fail(ce.getMessage());
733:                }
734:            }
735:
736:            public void testSupportsListing() {
737:                Debug.log("JDOCommunityNodeTest", "testSupportsListing",
738:                        "called");
739:                try {
740:                    createNodes();
741:                    assertTrue(cty1Node.supportsListing());
742:                    removeNodes();
743:                } catch (CMCException ce) {
744:                    Debug
745:                            .log("JDOCommunityNodeTest", "testSupportsListing",
746:                                    ce);
747:                    fail(ce.getMessage());
748:                }
749:            }
750:
751:            public void testSupportsRoleCreationTime() {
752:                Debug.log("JDOCommunityNodeTest",
753:                        "testSupportsRoleCreationTime", "called");
754:                try {
755:                    createNodes();
756:                    assertTrue(cty1Node.supportsRoleCreationTime());
757:                    removeNodes();
758:                } catch (CMCException ce) {
759:                    Debug.log("JDOCommunityNodeTest",
760:                            "testSupportsRoleCreationTime", ce);
761:                    fail(ce.getMessage());
762:                }
763:            }
764:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.