001: /*
002: * Danet GmbH
003: * Beratung und Software-Entwicklung
004: * Geschäftstelle AN
005: *
006: * $Id: ProcDir.java,v 1.3 2006/10/13 13:58:32 drmlipp Exp $
007: *
008: * $Log: ProcDir.java,v $
009: * Revision 1.3 2006/10/13 13:58:32 drmlipp
010: * Adapted to new environment.
011: *
012: * Revision 1.2 2006/10/07 20:41:34 mlipp
013: * Merged J2EE 1.4 adaptions from test branch.
014: *
015: * Revision 1.1.1.2 2003/12/19 13:01:48 drmlipp
016: * Updated to 1.1rc1
017: *
018: * Revision 1.11 2003/10/21 21:00:45 lipp
019: * Moved EJBClientTest to new junit sub-package.
020: *
021: * Revision 1.10 2003/10/08 11:52:55 huaiyang
022: * make test weblogic compatible.
023: *
024: * Revision 1.9 2003/04/26 16:46:55 lipp
025: * Made unittests and systemtests coexist in eclipse.
026: *
027: * Revision 1.8 2003/04/16 19:25:04 lipp
028: * Adapted to jdk 1.4
029: *
030: * Revision 1.7 2002/09/08 19:19:18 lipp
031: * Replaced process type with process manager.
032: *
033: * Revision 1.6 2002/08/30 13:37:05 lipp
034: * Using Workflow engine facade now.
035: *
036: * Revision 1.5 2002/08/26 20:23:14 lipp
037: * Lots of method renames.
038: *
039: * Revision 1.4 2002/08/21 22:06:48 lipp
040: * Finished transition to ProcessMgrStub.
041: *
042: * Revision 1.3 2002/06/27 10:48:07 lipp
043: * Obscure test disabled.
044: *
045: * Revision 1.2 2002/02/04 16:18:59 huaiyang
046: * Add the test method of getProcessMgr.
047: *
048: * Revision 1.1 2002/02/03 21:41:42 lipp
049: * Cleaned up unittests.
050: *
051: * Revision 1.9 2002/01/23 15:42:04 lipp
052: * Adapted to interface changes.
053: *
054: * Revision 1.8 2001/12/13 21:00:05 lipp
055: * Simplified temporary implementation of a requester.
056: *
057: * Revision 1.7 2001/12/11 09:54:45 lipp
058: * Introduced security for workflow.
059: *
060: * Revision 1.6 2001/11/07 11:39:00 montag
061: * changed to internal ejb references
062: *
063: * Revision 1.5 2001/09/25 12:12:03 montag
064: * unittests corrected
065: *
066: * Revision 1.4 2001/09/24 13:54:15 montag
067: * WfProcessPK, WfActivityPK and ContributorPK removed.
068: *
069: * Revision 1.3 2001/09/03 15:10:34 schlue
070: * Assertion for process list added
071: *
072: * Revision 1.2 2001/08/29 14:40:16 lipp
073: * New functions for listing processes
074: *
075: * Revision 1.1 2001/08/29 10:59:11 lipp
076: * Tests split in groups.
077: *
078: */
079: package process;
080:
081: import java.util.Collection;
082:
083: import javax.naming.InitialContext;
084: import javax.rmi.PortableRemoteObject;
085:
086: import junit.framework.Test;
087: import junit.framework.TestCase;
088: import junit.framework.TestSuite;
089:
090: import common.UTLoginContext;
091:
092: import javax.security.auth.login.LoginException;
093:
094: import de.danet.an.util.junit.EJBClientTest;
095: import de.danet.an.workflow.api.ProcessDefinitionDirectory;
096: import de.danet.an.workflow.api.ProcessDirectory;
097: import de.danet.an.workflow.api.WorkflowServiceFactory;
098: import de.danet.an.workflow.ejbs.admin.ProcessDirectoryHome;
099:
100: /**
101: * Zusammenstellung aller TimerObjectTests.
102: */
103: public class ProcDir extends TestCase {
104: private static UTLoginContext plc = null;
105: static {
106: try {
107: plc = new UTLoginContext();
108: plc.login();
109: } catch (LoginException e) {
110: throw new IllegalStateException(e.getMessage());
111: }
112: }
113:
114: /**
115: * Konstruktor zum Erzeugen eines TestCase
116: */
117: public ProcDir(String name) {
118: super (name);
119: }
120:
121: /**
122: * Stellt diese TestSuite zusammen.
123: */
124: public static Test suite() {
125: TestSuite suite = new TestSuite();
126: suite.addTest(new ProcDir("listProcessTypes"));
127: suite.addTest(new ProcDir("listProcesses"));
128: suite.addTest(new ProcDir("listActivities"));
129: return new EJBClientTest(plc, suite);
130: }
131:
132: /**
133: * Returns a list of all defined process types
134: * from the ProcessDirectory bean.
135: */
136: public void listProcessTypes() throws Exception {
137: ProcessDirectory pdir = WorkflowServiceFactory.newInstance()
138: .newWorkflowService().processDirectory();
139: Collection processTypes = pdir.processMgrNames();
140: assertTrue(processTypes.size() > 0);
141: }
142:
143: /**
144: * Returns a list of all defined process types
145: * from the ProcessDirectory bean.
146: */
147: public void listProcesses() throws Exception {
148: ProcessDirectory pdir = WorkflowServiceFactory.newInstance()
149: .newWorkflowService().processDirectory();
150: Collection pts = pdir.processMgrNames();
151: Collection procs = pdir.processes();
152: }
153:
154: /**
155: * Returns a list of all activities assigned to a given user
156: * from the ProcessDirectory bean.
157: */
158: public void listActivities() throws Exception {
159: ProcessDirectory pdir = WorkflowServiceFactory.newInstance()
160: .newWorkflowService().processDirectory();
161: // Collection c = pdir.getActivities();
162: // assertTrue (c != null);
163: }
164:
165: }
|