Source Code Cross Referenced for AappTest.java in  » Blogger-System » apache-roller-3.1 » org » apache » roller » webservices » adminapi » 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 » Blogger System » apache roller 3.1 » org.apache.roller.webservices.adminapi 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  The ASF licenses this file to You
004:         * under the Apache License, Version 2.0 (the "License"); you may not
005:         * use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *     http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.  For additional information regarding
015:         * copyright in this work, please see the NOTICE file in the top level
016:         * directory of this distribution.
017:         */
018:        package org.apache.roller.webservices.adminapi;
019:
020:        import java.util.Date;
021:        import java.util.Locale;
022:        import java.util.TimeZone;
023:        import junit.framework.TestCase;
024:        import org.apache.roller.webservices.adminapi.sdk.MemberEntry;
025:        import org.apache.roller.webservices.adminapi.sdk.MemberEntrySet;
026:        import org.apache.roller.webservices.adminapi.sdk.UserEntry;
027:        import org.apache.roller.webservices.adminapi.sdk.UserEntrySet;
028:        import org.apache.roller.webservices.adminapi.sdk.WeblogEntry;
029:        import org.apache.roller.webservices.adminapi.sdk.WeblogEntrySet;
030:
031:        public abstract class AappTest extends TestCase {
032:            private static final Date sampleDate = new Date();
033:            private static final String DEFAULT_ENDPOINT_URL = "http://localhost:8080/roller/roller-services/aapp";
034:            private static final String DEFAULT_USER = "jtb";
035:            private static final String DEFAULT_PASSWORD = "iplanet";
036:
037:            protected static String getEndpointUrl() {
038:                String endpoint = System.getProperty("aapp.endpoint");
039:                if (endpoint == null) {
040:                    endpoint = DEFAULT_ENDPOINT_URL;
041:                }
042:
043:                //System.err.println("endpoint=" + endpoint);
044:                return endpoint;
045:            }
046:
047:            protected static String getUser() {
048:                String user = System.getProperties().getProperty("aapp.user");
049:                if (user == null) {
050:                    user = DEFAULT_USER;
051:                }
052:
053:                //System.err.println("user=" + user);
054:                return user;
055:            }
056:
057:            protected static String getPassword() {
058:                String password = System.getProperties().getProperty(
059:                        "aapp.password");
060:                if (password == null) {
061:                    password = DEFAULT_PASSWORD;
062:                }
063:
064:                //System.err.println("password=" + password);
065:                return password;
066:            }
067:
068:            protected static UserEntry getSampleUserEntry() {
069:                UserEntry ue = new UserEntry("foo", getEndpointUrl());
070:                ue.setEmailAddress("foo@bar.org");
071:                ue.setFullName("Foo Bar");
072:                ue.setLocale(Locale.getDefault());
073:                ue.setTimezone(TimeZone.getDefault());
074:                ue.setPassword("foo");
075:                ue.setEnabled(Boolean.TRUE);
076:
077:                return ue;
078:            }
079:
080:            protected static MemberEntry getSampleMemberEntry() {
081:                MemberEntry me = new MemberEntry("fooblog", "foo",
082:                        getEndpointUrl());
083:                me.setPermission(MemberEntry.Permissions.AUTHOR);
084:                return me;
085:            }
086:
087:            protected static UserEntry updateSampleUserEntry(UserEntry ue) {
088:                UserEntry ueUpdate = new UserEntry(ue.getName(),
089:                        getEndpointUrl());
090:                ueUpdate.setEmailAddress("billy@bob.org");
091:                ueUpdate.setFullName("Billy Bob");
092:                ueUpdate.setLocale(new Locale("ms", "MY"));
093:                ueUpdate.setTimezone(TimeZone.getTimeZone("Asia/Kuala_Lumpur"));
094:                ueUpdate.setPassword("billy");
095:                ueUpdate.setEnabled(Boolean.FALSE);
096:
097:                return ueUpdate;
098:            }
099:
100:            protected static WeblogEntry updateSampleWeblogEntry(WeblogEntry we) {
101:                WeblogEntry weUpdate = new WeblogEntry(we.getHandle(),
102:                        getEndpointUrl());
103:                weUpdate.setEmailAddress("billy@bob.org");
104:                weUpdate.setName("Billy Bob Weblog Name");
105:                weUpdate.setLocale(new Locale("ms", "MY"));
106:                weUpdate.setTimezone(TimeZone.getTimeZone("Asia/Kuala_Lumpur"));
107:                weUpdate.setDescription("Billy Bob Weblog Description");
108:                weUpdate.setCreatingUser(we.getCreatingUser());
109:                weUpdate.setEnabled(Boolean.FALSE);
110:
111:                return weUpdate;
112:            }
113:
114:            protected static MemberEntry updateSampleMemberEntry(MemberEntry me) {
115:                MemberEntry meUpdate = new MemberEntry(me.getHandle(), me
116:                        .getName(), getEndpointUrl());
117:                meUpdate.setPermission(MemberEntry.Permissions.LIMITED);
118:
119:                return meUpdate;
120:            }
121:
122:            protected static UserEntrySet updateSampleUserEntrySet(
123:                    UserEntrySet ues) {
124:                UserEntry ue = (UserEntry) ues.getEntries()[0];
125:                UserEntry ueUpdated = updateSampleUserEntry(ue);
126:                UserEntrySet uesUpdated = new UserEntrySet(getEndpointUrl());
127:                uesUpdated.setEntries(new UserEntry[] { ueUpdated });
128:
129:                return uesUpdated;
130:            }
131:
132:            protected static WeblogEntrySet updateSampleWeblogEntrySet(
133:                    WeblogEntrySet wes) {
134:                WeblogEntry we = (WeblogEntry) wes.getEntries()[0];
135:                WeblogEntry weUpdated = updateSampleWeblogEntry(we);
136:                WeblogEntrySet wesUpdated = new WeblogEntrySet(getEndpointUrl());
137:                wesUpdated.setEntries(new WeblogEntry[] { weUpdated });
138:
139:                return wesUpdated;
140:            }
141:
142:            protected static MemberEntrySet updateSampleMemberEntrySet(
143:                    MemberEntrySet mes) {
144:                MemberEntry me = (MemberEntry) mes.getEntries()[0];
145:                MemberEntry meUpdated = updateSampleMemberEntry(me);
146:                MemberEntrySet mesUpdated = new MemberEntrySet(getEndpointUrl());
147:                mesUpdated.setEntries(new MemberEntry[] { meUpdated });
148:
149:                return mesUpdated;
150:            }
151:
152:            protected static WeblogEntry getSampleWeblogEntry() {
153:                WeblogEntry we = new WeblogEntry("fooblog", getEndpointUrl());
154:                we.setEmailAddress("foo@bar.org");
155:                we.setCreatingUser("foo");
156:                we.setDescription("Foo Weblog Description");
157:                we.setLocale(Locale.getDefault());
158:                we.setTimezone(TimeZone.getDefault());
159:                we.setName("Foo Weblog Name");
160:                we.setEnabled(Boolean.TRUE);
161:
162:                return we;
163:            }
164:
165:            protected static UserEntrySet getSampleUserEntrySet() {
166:                UserEntry ue = getSampleUserEntry();
167:                UserEntrySet ues = new UserEntrySet(getEndpointUrl());
168:                ues.setEntries(new UserEntry[] { ue });
169:
170:                return ues;
171:            }
172:
173:            protected static WeblogEntrySet getSampleWeblogEntrySet() {
174:                WeblogEntry we = getSampleWeblogEntry();
175:                WeblogEntrySet wes = new WeblogEntrySet(getEndpointUrl());
176:                wes.setEntries(new WeblogEntry[] { we });
177:
178:                return wes;
179:            }
180:
181:            protected static MemberEntrySet getSampleMemberEntrySet() {
182:                MemberEntry me = getSampleMemberEntry();
183:                MemberEntrySet mes = new MemberEntrySet(getEndpointUrl());
184:                mes.setEntries(new MemberEntry[] { me });
185:
186:                return mes;
187:            }
188:
189:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.