Package procdef

Source Code of procdef.ProcContext

/*
* This file is part of the WfMOpen project.
* Copyright (C) 2001-2003 Danet GmbH (www.danet.de), GS-AN.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
* $Id: ProcContext.java 1733 2006-10-13 13:59:37Z drmlipp $
*
* $Log$
* Revision 1.3  2006/10/07 20:41:34  mlipp
* Merged J2EE 1.4 adaptions from test branch.
*
* Revision 1.2  2006/09/29 12:32:09  drmlipp
* Consistently using WfMOpen as projct name now.
*
* Revision 1.1.1.2  2003/12/19 13:01:47  drmlipp
* Updated to 1.1rc1
*
* Revision 1.10  2003/10/21 21:00:45  lipp
* Moved EJBClientTest to new junit sub-package.
*
* Revision 1.9  2003/10/08 07:42:34  lipp
* Made tests weblogic compatible.
*
* Revision 1.8  2003/06/27 09:44:13  lipp
* Fixed copyright/license information.
*
* Revision 1.7  2003/05/14 08:30:07  lipp
* Package import behaviour changed.
*
* Revision 1.6  2003/04/26 16:46:55  lipp
* Made unittests and systemtests coexist in eclipse.
*
* Revision 1.5  2003/04/16 19:25:04  lipp
* Adapted to jdk 1.4
*
* Revision 1.4  2003/04/08 14:01:03  lipp
* Fixed test case.
*
* Revision 1.3  2003/03/31 16:50:29  huaiyang
* Logging using common-logging.
*
* Revision 1.2  2003/03/28 12:46:48  huaiyang
* more datatypes for datafield supported.
*
* Revision 1.1  2002/11/05 08:20:14  huaiyang
* new test.
*
*
*/
package procdef;

import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import javax.security.auth.login.LoginException;

import de.danet.an.util.junit.EJBClientTest;

import de.danet.an.workflow.omgcore.ProcessDataInfo;

import de.danet.an.workflow.api.ProcessDefinitionDirectory;
import de.danet.an.workflow.api.ProcessMgr;
import de.danet.an.workflow.api.WorkflowServiceFactory;

import de.danet.an.workflow.ejbs.admin.ProcessDefinitionDirectoryHome;

import common.UTLoginContext;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

public class ProcContext extends TestCase {

    static final org.apache.commons.logging.Log logger
  = org.apache.commons.logging.LogFactory.getLog(ProcContext.class);

    private static UTLoginContext plc = null;
    static {
  try {
      plc = new UTLoginContext();
      plc.login();
  } catch (LoginException e) {
      throw new IllegalStateException (e.getMessage ());
  }
    }

    /**
     * Constructor of this TestCase
     */
    public ProcContext(String name) {
  super (name);
    }

    /**
     * Stellt diese TestSuite zusammen.
     */
    public static Test suite() {
        TestSuite suite = new TestSuite();
     suite.addTest(new ProcContext("contextSignature"));
        return new EJBClientTest (plc, suite);
    }

    private ProcessMgr getProcessMgr (String pkgId, String prcId)
        throws Exception {
        ProcessDefinitionDirectory procDir
            = WorkflowServiceFactory.newInstance()
            .newWorkflowService().processDefinitionDirectory();
  return procDir.processMgr(pkgId, prcId);
    }

    /**
     * Check context signature.
     */
    public void contextSignature() throws Exception {
  Basic.importProcessDefinitions("/procdef/initialProcesses.xml");
  // create the process
  ProcessMgr processMgr = getProcessMgr("ut-procdef", "jut1");
  ProcessDataInfo procDataInfo = processMgr.contextSignature ();
  assertTrue (procDataInfo.containsKey("packageTestValue1"));
  assertTrue (procDataInfo.get("packageTestValue1")
        .equals (java.lang.String.class));
  assertTrue (procDataInfo.containsKey("packageTestValue2"));
  assertTrue (procDataInfo.get("packageTestValue2")
        .equals (java.lang.Double.class));
  assertTrue (procDataInfo.containsKey("processTestValue1"));
  assertTrue (procDataInfo.get("processTestValue1")
        .equals (java.lang.Long.class));
  assertTrue (procDataInfo.containsKey("processTestValue2"));
  assertTrue (procDataInfo.get("processTestValue2")
        .equals (java.util.Date.class));
  assertTrue (procDataInfo.containsKey("processTestValue3"));
  assertTrue (procDataInfo.get("processTestValue3")
        .equals (java.lang.Boolean.class));
    }
 
}
TOP

Related Classes of procdef.ProcContext

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.