View Javadoc

1   /*
2    * $Id: GWESWorkflowConverterTest.java 1537 2011-07-27 15:34:04Z hoheisel $
3    *
4    * Copyright (c) 2008, Fraunhofer FIRST
5    * Fraunhofer Institute for Computer Architecture and Software Technology
6    * See http://www.first.fraunhofer.de and http://www.gridworkflow.org/gwes for more details.
7    */
8   package net.kwfgrid.gwes;
9   
10  import net.kwfgrid.gwes.exception.*;
11  import org.apache.log4j.Logger;
12  import junit.framework.Test;
13  import junit.framework.TestSuite;
14  import junit.framework.Assert;
15  
16  import java.io.IOException;
17  
18  import net.kwfgrid.gworkflowdl.structure.WorkflowFormatException;
19  
20  /**
21   * <code>
22   * maven -Dtestcase=net.kwfgrid.gwes.GWESWorkflowConverterTest test:single
23   * </code>
24   *
25   * @author Andreas Hoheisel
26   *         (<a href="http://www.andreas-hoheisel.de">www.andreas-hoheisel.de</a>)
27   * @version $Id: GWESWorkflowConverterTest.java 1537 2011-07-27 15:34:04Z hoheisel $
28   */
29  public final class GWESWorkflowConverterTest extends LocalGWESAbstractTestCase {
30  
31      static Logger logger = Logger.getLogger(GWESWorkflowConverterTest.class);
32  
33      /**
34       * Create the test case.
35       *
36       * @param testName name of the test case
37       */
38      public GWESWorkflowConverterTest(String testName) throws LoggingException {
39          super(testName);
40      }
41  
42      /**
43       * @return the suite of tests being tested
44       */
45      public static Test suite() {
46          return new TestSuite(GWESWorkflowConverterTest.class);
47      }
48  
49      /**
50       * Test EPNML 1.1 -> GWorkflowDL 1.1
51       */
52      public void testEpnml11ToGWorkflowDL11() throws IOException, NoSuchWorkflowException, WorkflowSecurityException, StateTransitionException, WorkflowFormatException, InterruptedException, DatabaseException, LoggingException, GWESException {
53          String workflow = testGWES("examples/pnml/simple_epnml-1-1.pnml", WorkflowStatus.STATUS_COMPLETED);
54  
55          logger.info(workflow);
56  
57          String[] data = gwes.getData(workflowID,"pl2", userID);
58          Assert.assertEquals("Number of tokens on place pl2",1,data.length);
59          Assert.assertEquals("Token on place pl2","<control>true</control>",data[0]);
60  
61          data = gwes.getData(workflowID,"pl3", userID);
62          Assert.assertEquals("Number of tokens on place pl3",1,data.length);
63          Assert.assertEquals("Token on place pl3","<control>true</control>",data[0]);
64  
65      }
66  
67      /**
68       * *******************************************************************************************
69       * End of public test classes.
70       * ********************************************************************************************
71       */
72  
73  }