Source Code Cross Referenced for JdoCommunityTest.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:
018:        import junit.framework.*;
019:        import com.sun.portal.community.mc.*;
020:        import com.sun.portal.community.mc.ConfigTable.ConfigKey;
021:        import com.sun.portal.community.mc.impl.*;
022:        import java.io.*;
023:
024:        public abstract class JdoCommunityTest extends TestCase {
025:            protected static final String CTY1_VISITOR_DP = "*** cty1 visitor ***";
026:            protected static final String CTY1_MEMBER_DP = "*** cty1 member ***";
027:            protected static final String CTY1_OWNER_DP = "*** cty1 owner ***";
028:            protected static final String CTY1_BANNED_DP = "*** cty1 banned ***";
029:            protected static final String CTY1_PENDING_DP = "*** cty1 pending ***";
030:            protected static final String CTY1_REJECTED_DP = "*** cty1 rejected ***";
031:            protected static final String CTY1_INVITED_DP = "*** cty1 invited ***";
032:            protected static final String CTY1_DISABLED_DP = "*** cty1 disabled ***";
033:
034:            protected static final String CTY2_VISITOR_DP = "*** cty2 visitor ***";
035:            protected static final String CTY2_MEMBER_DP = "*** cty2 member ***";
036:            protected static final String CTY2_OWNER_DP = "*** cty2 owner ***";
037:            protected static final String CTY2_BANNED_DP = "*** cty2 banned ***";
038:            protected static final String CTY2_PENDING_DP = "*** cty2 pending ***";
039:            protected static final String CTY2_REJECTED_DP = "*** cty2 rejected ***";
040:            protected static final String CTY2_INVITED_DP = "*** cty2 invited ***";
041:            protected static final String CTY2_DISABLED_DP = "*** cty2 disabled ***";
042:
043:            protected ConfigKey cty1VisitorCk;
044:            protected ConfigKey cty1MemberCk;
045:            protected ConfigKey cty1OwnerCk;
046:            protected ConfigKey cty1RejectedCk;
047:            protected ConfigKey cty1InvitedCk;
048:            protected ConfigKey cty1BannedCk;
049:            protected ConfigKey cty1PendingCk;
050:            protected ConfigKey cty1DisabledCk;
051:
052:            protected CMCPrincipal cty1Cp;
053:            protected CMCNode cty1Node;
054:
055:            protected String tUserName;
056:            protected String uUserName;
057:            protected String vUserName;
058:            protected String wUserName;
059:            protected String xUserName;
060:            protected String yUserName;
061:            protected String zUserName;
062:
063:            protected CMCUser tUser;
064:            protected CMCUser uUser;
065:            protected CMCUser vUser;
066:            protected CMCUser wUser;
067:            protected CMCUser xUser;
068:            protected CMCUser yUser;
069:            protected CMCUser zUser;
070:
071:            public JdoCommunityTest(String testName) {
072:                super (testName);
073:            }
074:
075:            protected void setUp() throws java.lang.Exception {
076:                super .setUp();
077:                Debug.log("JdoCommunityTest", "setUp", "called");
078:
079:                cty1Cp = new CMCPrincipal("jdo", "cty1." + getName());
080:
081:                tUserName = "tUser." + getName();
082:                tUserName = tUserName.toLowerCase();
083:
084:                uUserName = "uUser." + getName();
085:                uUserName = uUserName.toLowerCase();
086:
087:                vUserName = "vUser." + getName();
088:                vUserName = vUserName.toLowerCase();
089:
090:                wUserName = "wUser." + getName();
091:                wUserName = wUserName.toLowerCase();
092:
093:                xUserName = "xUser." + getName();
094:                xUserName = xUserName.toLowerCase();
095:
096:                yUserName = "yUser." + getName();
097:                yUserName = yUserName.toLowerCase();
098:
099:                zUserName = "zUser." + getName();
100:                zUserName = zUserName.toLowerCase();
101:
102:                cty1VisitorCk = new ConfigKey(cty1Cp,
103:                        CMCRolePrincipal.VISITOR_ROLE);
104:                cty1MemberCk = new ConfigKey(cty1Cp,
105:                        CMCRolePrincipal.MEMBER_ROLE);
106:                cty1OwnerCk = new ConfigKey(cty1Cp, CMCRolePrincipal.OWNER_ROLE);
107:                cty1PendingCk = new ConfigKey(cty1Cp,
108:                        CMCRolePrincipal.PENDING_ROLE);
109:                cty1RejectedCk = new ConfigKey(cty1Cp,
110:                        CMCRolePrincipal.REJECTED_ROLE);
111:                cty1InvitedCk = new ConfigKey(cty1Cp,
112:                        CMCRolePrincipal.INVITED_ROLE);
113:                cty1BannedCk = new ConfigKey(cty1Cp,
114:                        CMCRolePrincipal.BANNED_ROLE);
115:                cty1DisabledCk = new ConfigKey(cty1Cp,
116:                        CMCRolePrincipal.DISABLED_ROLE);
117:
118:                try {
119:                    cty1Node = CMCFactory.getInstance().getCMCNode(cty1Cp);
120:
121:                    tUser = CMCFactory.getInstance().getCMCUser(tUserName);
122:                    uUser = CMCFactory.getInstance().getCMCUser(uUserName);
123:                    vUser = CMCFactory.getInstance().getCMCUser(vUserName);
124:                    wUser = CMCFactory.getInstance().getCMCUser(wUserName);
125:                    xUser = CMCFactory.getInstance().getCMCUser(xUserName);
126:                    yUser = CMCFactory.getInstance().getCMCUser(yUserName);
127:                    zUser = CMCFactory.getInstance().getCMCUser(zUserName);
128:                } catch (CMCException ce) {
129:                    Debug.log("JdoCommunityUserTest", "setUp", ce);
130:                    fail(ce.getMessage());
131:                }
132:            }
133:
134:            protected void tearDown() throws java.lang.Exception {
135:                super .tearDown();
136:                Debug.log("JdoCommunityTest", "tearDown", "called");
137:            }
138:
139:            public void createNodes() throws CMCException {
140:                Debug.log("JdoCommunityTest", "createNode", "called");
141:                cty1Node.create();
142:            }
143:
144:            public void addUsers() throws CMCException {
145:                Debug.log("JdoCommunityTest", "addUsers", "called");
146:
147:                Set users = new HashSet();
148:                users.add(xUserName);
149:                cty1Node.addUsers(users, CMCRolePrincipal.VISITOR_ROLE);
150:
151:                users.clear();
152:                users.add(yUserName);
153:                users.add(zUserName);
154:                cty1Node.addUsers(users, CMCRolePrincipal.MEMBER_ROLE);
155:
156:                users.clear();
157:                users.add(zUserName);
158:                cty1Node.addUsers(users, CMCRolePrincipal.OWNER_ROLE);
159:
160:                users.clear();
161:                users.add(tUserName);
162:                cty1Node.addUsers(users, CMCRolePrincipal.PENDING_ROLE);
163:
164:                users.clear();
165:                users.add(uUserName);
166:                cty1Node.addUsers(users, CMCRolePrincipal.BANNED_ROLE);
167:
168:                users.clear();
169:                users.add(vUserName);
170:                cty1Node.addUsers(users, CMCRolePrincipal.INVITED_ROLE);
171:
172:                users.clear();
173:                users.add(wUserName);
174:                cty1Node.addUsers(users, CMCRolePrincipal.REJECTED_ROLE);
175:            }
176:
177:            public void addRoles() throws CMCException {
178:                Debug.log("JdoCommunityTest", "addRoles", "called");
179:                cty1Node.addRole(CMCRolePrincipal.DISABLED_ROLE);
180:            }
181:
182:            public void removeRoles() throws CMCException {
183:                Debug.log("JdoCommunityTest", "removeRoles", "called");
184:                cty1Node.removeRole(CMCRolePrincipal.DISABLED_ROLE);
185:            }
186:
187:            public void removeNodes() throws CMCException {
188:                Debug.log("JdoCommunityTest", "testRemove", "called");
189:                cty1Node.remove();
190:            }
191:
192:            public void setDPDocuments() throws CMCException {
193:                Debug.log("JdoCommunityTest", "setDPDocuments", "called");
194:
195:                ConfigTable dpDocs = new ConfigTable();
196:
197:                try {
198:                    dpDocs
199:                            .put(cty1VisitorCk, CTY1_VISITOR_DP
200:                                    .getBytes("UTF-8"));
201:                    dpDocs.put(cty1MemberCk, CTY1_MEMBER_DP.getBytes("UTF-8"));
202:                    dpDocs.put(cty1OwnerCk, CTY1_OWNER_DP.getBytes("UTF-8"));
203:                    dpDocs.put(cty1RejectedCk, CTY1_REJECTED_DP
204:                            .getBytes("UTF-8"));
205:                    dpDocs
206:                            .put(cty1PendingCk, CTY1_PENDING_DP
207:                                    .getBytes("UTF-8"));
208:                    dpDocs
209:                            .put(cty1InvitedCk, CTY1_INVITED_DP
210:                                    .getBytes("UTF-8"));
211:                    dpDocs.put(cty1BannedCk, CTY1_BANNED_DP.getBytes("UTF-8"));
212:                    dpDocs.put(cty1DisabledCk, CTY1_DISABLED_DP
213:                            .getBytes("UTF-8"));
214:                } catch (UnsupportedEncodingException uee) {
215:                    fail("unsupported encoding");
216:                }
217:                cty1Node.setDPDocuments(dpDocs);
218:            }
219:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.