From: <bsc...@us...> - 2009-04-15 07:40:54
|
Revision: 4496 http://unicore.svn.sourceforge.net/unicore/?rev=4496&view=rev Author: bschuller Date: 2009-04-15 07:40:45 +0000 (Wed, 15 Apr 2009) Log Message: ----------- convert tests from junit to testng Modified Paths: -------------- workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestAppWrapper.java workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestDelegates.java workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestSubmissionClient.java workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/WSSTestBase.java workflow/trunk/workflowservice/testng-unittests.xml Modified: workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestAppWrapper.java =================================================================== --- workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestAppWrapper.java 2009-04-15 07:05:30 UTC (rev 4495) +++ workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestAppWrapper.java 2009-04-15 07:40:45 UTC (rev 4496) @@ -1,20 +1,20 @@ package org.chemomentum.dsws; -import junit.framework.TestCase; - import org.chemomentum.dsws.rp.ApplicationsResourceProperty.AppWrapper; +import org.testng.annotations.Test; -public class TestAppWrapper extends TestCase { +public class TestAppWrapper { + @Test public void testEquality(){ AppWrapper a1=new AppWrapper("Date","1.0"); AppWrapper a2=new AppWrapper("Date","1.0"); - assertEquals(a1,a2); + assert(a1.equals(a2)); AppWrapper a3=new AppWrapper("Date","2.0"); - assertFalse(a1.equals(a3)); + assert(!a1.equals(a3)); AppWrapper a4=new AppWrapper("Date",null); - assertEquals(a1,a4); - assertEquals(a3,a4); + assert(a1.equals(a4)); + assert(a3.equals(a4)); } } Modified: workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestDelegates.java =================================================================== --- workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestDelegates.java 2009-04-15 07:05:30 UTC (rev 4495) +++ workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestDelegates.java 2009-04-15 07:40:45 UTC (rev 4496) @@ -3,6 +3,8 @@ import org.chemomentum.common.ws.IWorkflowFactory; import org.chemomentum.workflow.xmlbeans.CreateWorkflowResourceDocument; import org.chemomentum.workflow.xmlbeans.CreateWorkflowResponseDocument; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import de.fzj.unicore.wsrflite.xmlbeans.client.BaseWSRFClient; @@ -12,6 +14,7 @@ private MockDelegate fooMock=new MockDelegate("foo"); private MockDelegate barMock=new MockDelegate("bar"); + @BeforeClass protected void setUp()throws Exception{ //add some dialects WorkflowFactoryImpl.addDelegate(fooMock.getDialect(), fooMock); @@ -19,6 +22,7 @@ super.setUp(); } + @Test public void test1(){ try{ String rd=wssClient.getResourceProperty(WorkflowFactoryImpl.RP_DIALECTS); @@ -30,6 +34,7 @@ } } + @Test public void test2(){ try{ //make a client and submit a workflow Modified: workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestSubmissionClient.java =================================================================== --- workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestSubmissionClient.java 2009-04-15 07:05:30 UTC (rev 4495) +++ workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/TestSubmissionClient.java 2009-04-15 07:40:45 UTC (rev 4496) @@ -5,6 +5,8 @@ import org.chemomentum.common.impl.workflow.WorkflowSubmissionClient; import org.chemomentum.dsws.groovy.GroovyDelegate; import org.chemomentum.workflow.xmlbeans.WorkflowDocument.Workflow; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; /** * some tests on basic service deployment @@ -13,6 +15,7 @@ private MockDelegate fooMock=new MockDelegate("foo"); + @BeforeClass protected void setUp()throws Exception{ //add a dialect WorkflowFactoryImpl.addDelegate(fooMock.getDialect(), fooMock); @@ -20,7 +23,7 @@ super.setUp(); } - + @Test public void test1(){ try{ WorkflowSubmissionClient wfs=new WorkflowSubmissionClient(wssClient.getEPR().getAddress().getStringValue(),wssClient.getEPR(),wssClient.getSecurityProperties()); Modified: workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/WSSTestBase.java =================================================================== --- workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/WSSTestBase.java 2009-04-15 07:05:30 UTC (rev 4495) +++ workflow/trunk/workflowservice/src/test/java/org/chemomentum/dsws/WSSTestBase.java 2009-04-15 07:40:45 UTC (rev 4496) @@ -5,6 +5,7 @@ import org.chemomentum.common.ws.WorkflowManagement; import org.chemomentum.dsws.util.SetupWorkflowService; import org.chemomentum.workflow.callback.CallbackImpl; +import org.testng.annotations.BeforeClass; import org.w3.x2005.x08.addressing.EndpointReferenceType; import de.fzj.unicore.uas.Registry; @@ -20,7 +21,8 @@ public abstract class WSSTestBase extends JettyTestCase { protected static BaseUASClient wssClient; - + + @BeforeClass protected void setUp()throws Exception{ try{ super.setUp(); Modified: workflow/trunk/workflowservice/testng-unittests.xml =================================================================== --- workflow/trunk/workflowservice/testng-unittests.xml 2009-04-15 07:05:30 UTC (rev 4495) +++ workflow/trunk/workflowservice/testng-unittests.xml 2009-04-15 07:40:45 UTC (rev 4496) @@ -1,5 +1,7 @@ <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="U6-workflow-unittests"> + + <!-- Backend tests --> <test verbose="2" name="XNJS setup" annotations="JDK"> <classes> <class name="eu.unicore.workflow.TestXNJSSetup"/> @@ -30,9 +32,22 @@ <class name="eu.unicore.workflow.pe.model.TestScriptCondition"/> </classes> </test> - <test verbose="2" name="Workflow containing simple loops" annotations="JDK"> + <test verbose="2" name="Workflow containing simple loops" annotations="JDK"> <classes> <class name="eu.unicore.workflow.pe.TestSimpleLoopProcessing"/> </classes> </test> + + <!-- Frontend --> + <test verbose="2" name="App wrapper" annotations="JDK"> + <classes> + <class name="org.chemomentum.dsws.TestAppWrapper"/> + </classes> + </test> + <test verbose="2" name="Service tests" annotations="JDK"> + <classes> + <class name="org.chemomentum.dsws.TestDelegates"/> + <class name="org.chemomentum.dsws.TestSubmissionClient"/> + </classes> + </test> </suite> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |