Source Code Cross Referenced for ContelligentTestCase.java in  » Content-Management-System » contelligent » de » finix » contelligent » 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 » Content Management System » contelligent » de.finix.contelligent.test 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001-2006 C:1 Financial Services GmbH
003:         *
004:         * This software is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License Version 2.1, as published by the Free Software Foundation.
007:         *
008:         * This software is distributed in the hope that it will be useful,
009:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
010:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
011:         * Lesser General Public License for more details.
012:         *
013:         * You should have received a copy of the GNU Lesser General Public
014:         * License along with this library; if not, write to the Free Software
015:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
016:         */
017:
018:        package de.finix.contelligent.test;
019:
020:        import java.util.ArrayList;
021:        import java.util.List;
022:
023:        import junit.framework.TestCase;
024:        import de.finix.contelligent.CallData;
025:        import de.finix.contelligent.ComponentManager;
026:        import de.finix.contelligent.ComponentPath;
027:        import de.finix.contelligent.Contelligent;
028:        import de.finix.contelligent.Session;
029:        import de.finix.contelligent.core.ContelligentImpl;
030:        import de.finix.contelligent.core.security.ContelligentSecurityManager;
031:        import de.finix.contelligent.core.security.User;
032:        import de.finix.contelligent.util.ThreadedMem;
033:
034:        /**
035:         * This is the base class for all JUnit tests concerning Contelligent. Its main
036:         * purpose is to provide utility methods such as access to logging or JNDI but
037:         * currently there aren't any such methods so if you need one feel free to
038:         * implement it ...
039:         */
040:        public class ContelligentTestCase extends TestCase {
041:            final static public ComponentPath TEST_ROOT_DIR = new ComponentPath(
042:                    "/contelligent/test/");
043:
044:            final static public ComponentPath TEST_WORK_DIR = TEST_ROOT_DIR
045:                    .append("work");
046:
047:            final static public ComponentPath TEST_PAGES_DIR = TEST_ROOT_DIR
048:                    .append("pages");
049:
050:            final static public String ALLPROPS_TYPE_NAME = "contelligent.test.TypeWithAllPropertyTypes";
051:
052:            final static public String FOLDER_TYPE_NAME = ComponentManager.DEFAULT_FOLDER_TYPE;
053:
054:            final Contelligent contelligentSystem;
055:
056:            public ContelligentTestCase(String s) {
057:                super (s);
058:                contelligentSystem = ContelligentImpl.getInstance();
059:            }
060:
061:            // ==============================================================================
062:            // non-public util methods:
063:            // ==============================================================================
064:
065:            protected Contelligent getContelligent() {
066:                return contelligentSystem;
067:            }
068:
069:            protected Session beginSession(String userId, String groupId,
070:                    String password) throws Exception {
071:                return contelligentSystem.beginSession(userId, groupId,
072:                        password);
073:            }
074:
075:            protected void endSession(Session session) {
076:                contelligentSystem.invalidateSession(session);
077:            }
078:
079:            protected void beginTx(CallData callData) throws Exception {
080:                ThreadedMem.setCallData(callData);
081:                ThreadedMem.setActualManager(callData.getActualManager());
082:                contelligentSystem.beginTx();
083:            }
084:
085:            protected void commitTx() throws Exception {
086:                contelligentSystem.commitTx();
087:            }
088:
089:            protected void rollbackTx() throws Exception {
090:                contelligentSystem.rollbackTx();
091:            }
092:
093:            protected CallData createCallData(Session session) {
094:                return contelligentSystem.createCallData(session);
095:            }
096:
097:            protected void deleteComponent(ComponentPath target, String name,
098:                    CallData callData) throws Exception {
099:                ComponentManager cm = callData.getActualManager();
100:
101:                beginTx(callData);
102:                cm.lockComponent(target, callData);
103:                cm.deleteComponentTree(callData, target.append(name));
104:                cm.unlockComponent(target, callData);
105:                commitTx();
106:            }
107:
108:            protected List createList(Object obj1) {
109:                ArrayList list = new ArrayList();
110:                list.add(obj1);
111:                return list;
112:            }
113:
114:            protected void changeCM(CallData callData, ComponentManager manager) {
115:                contelligentSystem.changeCM(callData, manager);
116:            }
117:
118:            protected User getSystemUser() {
119:                return ContelligentSecurityManager.getSystemUser();
120:            }
121:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.