You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mi...@apache.org on 2008/10/10 20:24:10 UTC
svn commit: r703549 - in /ode/branches/APACHE_ODE_1.X: ./
axis2-war/src/test/java/org/apache/ode/axis2/
axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/
axis2-war/src/test/java/org/apache/ode/axis2/management/
Author: midon
Date: Fri Oct 10 11:24:09 2008
New Revision: 703549
URL: http://svn.apache.org/viewvc?rev=703549&view=rev
Log:
ODE-387: migrate from JUnit to TestNG
Conflicts:
axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java
Modified:
ode/branches/APACHE_ODE_1.X/Rakefile
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/EndpointConfigurationTest.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/FailureInvokeTest.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/JettyWrapper.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/MessageStructureTest.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeaderTest.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/XSDReferencesDeployTest.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/HttpBindingTest.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/DeploymentTest.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java
ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTest.java
Modified: ode/branches/APACHE_ODE_1.X/Rakefile
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/Rakefile?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/Rakefile (original)
+++ ode/branches/APACHE_ODE_1.X/Rakefile Fri Oct 10 11:24:09 2008
@@ -178,6 +178,7 @@
end
end
+ test.using :testng
test.with projects("tools"), libs, AXIS2_TEST, AXIOM, JAVAX.servlet, Buildr::Jetty::REQUIRES, HIBERNATE, DOM4J
test.setup task(:prepare_webapp) do |task|
webapp_dir = "target/test-classes/webapp"
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java Fri Oct 10 11:24:09 2008
@@ -1,32 +1,38 @@
package org.apache.ode.axis2;
-import junit.framework.TestCase;
import org.apache.axis2.AxisFault;
-import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisOperation;
import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.WSDL11ToAxisServiceBuilder;
import org.apache.axis2.engine.AxisServer;
import org.apache.axis2.engine.MessageReceiver;
-import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
+import org.apache.ode.axis2.hooks.ODEAxisService;
import org.apache.ode.axis2.util.Axis2UriResolver;
import org.apache.ode.axis2.util.Axis2WSDLLocator;
-import org.apache.ode.axis2.hooks.ODEAxisService;
+import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
import javax.servlet.ServletException;
import javax.wsdl.WSDLException;
import javax.xml.namespace.QName;
-import java.io.*;
-import java.net.URL;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.Iterator;
+import java.net.URL;
import java.util.Collection;
+import java.util.Iterator;
/**
* @author Matthieu Riou <mr...@apache.org>
*/
-public abstract class Axis2TestBase extends TestCase {
+public abstract class Axis2TestBase {
protected ODEAxis2Server server;
@@ -40,14 +46,14 @@
server.stop();
}
+ @BeforeMethod
protected void setUp() throws Exception {
- super.setUp();
startServer();
}
+ @AfterMethod
protected void tearDown() throws Exception {
stopServer();
- super.tearDown();
}
protected class ODEAxis2Server extends AxisServer {
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/EndpointConfigurationTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/EndpointConfigurationTest.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/EndpointConfigurationTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/EndpointConfigurationTest.java Fri Oct 10 11:24:09 2008
@@ -19,16 +19,14 @@
package org.apache.ode.axis2;
-import junit.framework.TestCase;
-import org.apache.ode.axis2.JettyWrapper;
import org.mortbay.jetty.handler.ContextHandler;
import org.mortbay.jetty.handler.HandlerList;
import org.mortbay.jetty.security.Constraint;
import org.mortbay.jetty.security.ConstraintMapping;
-import org.mortbay.jetty.security.SecurityHandler;
import org.mortbay.jetty.security.HashUserRealm;
-
-import java.util.concurrent.CountDownLatch;
+import org.mortbay.jetty.security.SecurityHandler;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
/**
*
@@ -37,6 +35,7 @@
public class EndpointConfigurationTest extends Axis2TestBase {
+ @Test
public void testEndpointProperties() throws Exception {
executeProcess();
}
@@ -69,6 +68,7 @@
* Redo the exact same test but with Basic Authentication activated on the external service
* @throws Exception
*/
+ @Test
public void testHttpAuthentication() throws Exception {
ContextHandler securedEchoContext;
{
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/FailureInvokeTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/FailureInvokeTest.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/FailureInvokeTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/FailureInvokeTest.java Fri Oct 10 11:24:09 2008
@@ -1,17 +1,16 @@
package org.apache.ode.axis2;
import org.apache.axis2.AxisFault;
-import org.junit.Ignore;
+import org.testng.annotations.Test;
/**
* This test requires very specific timing values to work which is why it's set to ignored, it
* probably wouldn't work on most machines. BpelRuntimeContextImpl.scheduleInvokeCheck also has to
* use a timer value of 5s instead of 180s (a bit too long for testing).
*/
-@Ignore
public class FailureInvokeTest extends Axis2TestBase {
- @Ignore
+ @Test(enabled = false)
public void testSimpleFaultCatch() throws Exception {
String bundleName = "TestFailureInInvoke";
// deploy the required service
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/JettyWrapper.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/JettyWrapper.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/JettyWrapper.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/JettyWrapper.java Fri Oct 10 11:24:09 2008
@@ -19,34 +19,25 @@
package org.apache.ode.axis2;
+import org.apache.commons.lang.StringUtils;
+import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.StreamUtils;
+import org.mortbay.jetty.Handler;
+import org.mortbay.jetty.Request;
+import org.mortbay.jetty.Server;
import org.mortbay.jetty.handler.AbstractHandler;
import org.mortbay.jetty.handler.ContextHandler;
import org.mortbay.jetty.handler.ContextHandlerCollection;
-import org.mortbay.jetty.handler.HandlerList;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.Handler;
-import org.mortbay.jetty.Request;
-import org.mortbay.jetty.security.ConstraintMapping;
-import org.mortbay.jetty.security.Constraint;
-import org.mortbay.jetty.security.SecurityHandler;
-import org.mortbay.jetty.security.HashUserRealm;
-import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.utils.StreamUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.axis2.transport.http.HTTPConstants;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Enumeration;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.concurrent.CountDownLatch;
/**
* @author <a href="mailto:midon@intalio.com">Alexis Midon</a>
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/MessageStructureTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/MessageStructureTest.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/MessageStructureTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/MessageStructureTest.java Fri Oct 10 11:24:09 2008
@@ -1,10 +1,13 @@
package org.apache.ode.axis2;
import org.apache.ode.utils.DOMUtils;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import org.w3c.dom.Element;
public class MessageStructureTest extends Axis2TestBase {
+ @Test
public void testAttrWithNsValue() throws Exception {
String bundleName = "TestAttributeNamespaces";
// deploy the required service
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/ServiceFaultCatchTest.java Fri Oct 10 11:24:09 2008
@@ -1,5 +1,8 @@
package org.apache.ode.axis2;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
+
/**
* Tests that a fault thrown by a called service can be caught and is properly
* structured so that an assign on a fault sub-element will succeed.
@@ -8,6 +11,7 @@
*/
public class ServiceFaultCatchTest extends Axis2TestBase {
+ @Test
public void testSimpleFaultCatch() throws Exception {
String bundleName = "TestStructuredFault";
// deploy the required service
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeaderTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeaderTest.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeaderTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/SoapHeaderTest.java Fri Oct 10 11:24:09 2008
@@ -1,14 +1,20 @@
package org.apache.ode.axis2;
-import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.engine.AxisEngine;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.util.Utils;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.*;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.util.Utils;
import org.apache.ode.utils.DOMUtils;
+import static org.testng.AssertJUnit.assertEquals;
+import org.testng.annotations.Test;
import org.w3c.dom.Element;
import javax.xml.namespace.QName;
@@ -20,6 +26,7 @@
*/
public class SoapHeaderTest extends Axis2TestBase {
+ @Test
public void testSimplePassing() throws Exception {
server.deployService("TestSoapHeader", "dummy-service.wsdl",
new QName("http://axis2.ode.apache.org", "DummyService"), "DummyServiceSOAP11port_http",
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/XSDReferencesDeployTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/XSDReferencesDeployTest.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/XSDReferencesDeployTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/XSDReferencesDeployTest.java Fri Oct 10 11:24:09 2008
@@ -1,10 +1,13 @@
package org.apache.ode.axis2;
+import org.testng.annotations.Test;
+
/**
* @author Matthieu Riou <mr...@apache.org>
*/
public class XSDReferencesDeployTest extends Axis2TestBase {
+ @Test
public void testSimpleFaultCatch() throws Exception {
server.deployService(DummyService.class.getCanonicalName());
// If we have a bug, this will throw an exception, no need to assert
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/HttpBindingTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/HttpBindingTest.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/HttpBindingTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/httpbinding/HttpBindingTest.java Fri Oct 10 11:24:09 2008
@@ -1,9 +1,13 @@
package org.apache.ode.axis2.httpbinding;
-import org.apache.ode.axis2.Axis2TestBase;
-import org.apache.ode.axis2.JettyWrapper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.ode.axis2.Axis2TestBase;
+import org.apache.ode.axis2.JettyWrapper;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
import java.util.concurrent.CountDownLatch;
@@ -27,6 +31,7 @@
protected JettyWrapper jettyWrapper;
+ @BeforeMethod
protected void setUp() throws Exception {
super.setUp();
final CountDownLatch latch = new CountDownLatch(1);
@@ -45,11 +50,13 @@
latch.await();
}
+ @AfterMethod
protected void tearDown() throws Exception {
jettyWrapper.stop();
super.tearDown();
}
+ @Test
public void testHttpBinding() throws Exception {
String bundleName = "TestHttpBinding";
// deploy the required service
@@ -67,22 +74,26 @@
}
}
+ @Test
public void testHttpBindingExt_GET() throws Exception {
String bundleName = "TestHttpBindingExt_GET";
executeBundle(bundleName);
}
+ @Test
public void testHttpBindingExt_DELETE() throws Exception {
String bundleName = "TestHttpBindingExt_DELETE";
executeBundle(bundleName);
}
+ @Test
public void testHttpBindingExt_POST() throws Exception {
String bundleName = "TestHttpBindingExt_POST";
executeBundle(bundleName);
}
+ @Test
public void testHttpBindingExt_PUT() throws Exception {
String bundleName = "TestHttpBindingExt_PUT";
executeBundle(bundleName);
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/DeploymentTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/DeploymentTest.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/DeploymentTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/DeploymentTest.java Fri Oct 10 11:24:09 2008
@@ -19,12 +19,20 @@
package org.apache.ode.axis2.management;
-import org.apache.axiom.om.*;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMText;
import org.apache.axiom.om.util.Base64;
import org.apache.axis2.AxisFault;
-import org.apache.ode.axis2.service.ServiceClientUtil;
import org.apache.ode.axis2.Axis2TestBase;
+import org.apache.ode.axis2.service.ServiceClientUtil;
import org.apache.ode.utils.Namespaces;
+import static org.testng.AssertJUnit.*;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
import javax.xml.namespace.QName;
import java.io.ByteArrayOutputStream;
@@ -40,6 +48,7 @@
private ArrayList<QName> _deployed = new ArrayList<QName>();
private String _package;
+ @Test
public void testDeployUndeploy() throws Exception {
// Setup and tear down are doing ost of the job here, just checking in the middle
@@ -74,12 +83,14 @@
assertEquals(_deployed.get(1).toString(), pid.getText());
}
+ @Test
public void testListDeployedPackages() throws Exception {
OMElement root = _client.buildMessage("listDeployedPackages", new String[] {}, new String[] {});
OMElement result = sendToDeployment(root);
assertTrue(result.toString().indexOf(_package) > 0);
}
+ @Test
public void testListProcesses() throws Exception {
OMElement root = _client.buildMessage("listProcesses", new String[] {"packagesNames"},
new String[] {_package});
@@ -90,6 +101,7 @@
assertTrue(result.toString().indexOf("DynPartnerResponder")>=0);
}
+ @Test
public void testGetProcessPackage() throws Exception {
OMElement root = _client.buildMessage("getProcessPackage", new String[] {"processId"},
new Object[] { _deployed.get(0) } );
@@ -102,6 +114,7 @@
assertEquals(_package, result2.getText());
}
+ @Test
public void testMultipleDeployUndeployVersion() throws Exception {
ArrayList<String> deployed = new ArrayList<String>();
// Testing that versions are monotonically increased
@@ -129,6 +142,7 @@
}
}
+ @BeforeMethod
protected void setUp() throws Exception {
super.setUp();
// Create a factory
@@ -143,6 +157,7 @@
Thread.sleep(1000);
}
+ @AfterMethod
protected void tearDown() throws Exception {
undeploy(_package);
super.tearDown();
@@ -218,4 +233,4 @@
return _client.send(msg, "http://localhost:8888/processes/DeploymentService");
}
-}
\ No newline at end of file
+}
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/InstanceManagementTest.java Fri Oct 10 11:24:09 2008
@@ -19,14 +19,20 @@
package org.apache.ode.axis2.management;
-import org.apache.axiom.om.*;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMText;
import org.apache.axiom.om.util.Base64;
import org.apache.axis2.AxisFault;
-import org.apache.ode.axis2.service.ServiceClientUtil;
import org.apache.ode.axis2.Axis2TestBase;
+import org.apache.ode.axis2.service.ServiceClientUtil;
import org.apache.ode.tools.sendsoap.cline.HttpSoapSender;
import org.apache.ode.utils.Namespaces;
-import org.junit.Ignore;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
import javax.xml.namespace.QName;
import java.io.ByteArrayOutputStream;
@@ -44,6 +50,7 @@
private ServiceClientUtil _client;
private String _deployedName;
+ @Test
public void testListInstances() throws Exception {
OMElement listRoot = _client.buildMessage("listInstances", new String[] {"filter", "order", "limit"},
new String[] {"name=DynPartnerMain", "", "10"});
@@ -63,6 +70,7 @@
}
// ODE-385 please fix me
+ @Test(enabled = false)
public void ode_385_testListAllInstances() throws Exception {
OMElement root = _client.buildMessage("listAllInstancesWithLimit", new String[] {"limit"}, new String[] {"1"});
OMElement result = sendToIM(root);
@@ -73,6 +81,7 @@
result.toString().indexOf("DynPartnerResponder") >= 0);
}
+ @Test
public void testInstanceSummaryListProcess() throws Exception {
OMElement listRoot = _client.buildMessage("listProcesses", new String[] {"filter", "orderKeys"},
new String[] {"name=DynPartnerMain", ""});
@@ -90,6 +99,7 @@
}
// ODE-385 please fix me
+ @Test(enabled = false)
public void ode_385_testGetInstanceInfo() throws Exception {
OMElement root = _client.buildMessage("listAllInstances", new String[] {}, new String[] {});
OMElement result = sendToIM(root);
@@ -100,6 +110,7 @@
assert(result.toString().split("instance-info").length == 3);
}
+ @Test
public void testGetInstanceInfoFault() throws Exception {
// Hopefully this id won't exist
OMElement root = _client.buildMessage("getInstanceInfo", new String[] {"iid"}, new String[] {"65431"});
@@ -112,6 +123,7 @@
}
// ODE-385 please fix me
+ @Test(enabled = false)
public void ode_385_testGetScopeInfo() throws Exception {
OMElement root = _client.buildMessage("listAllInstances", new String[] {}, new String[] {});
OMElement result = sendToIM(root);
@@ -125,6 +137,7 @@
assert(result.toString().indexOf("activity-info") >= 0);
}
+ @Test
public void testGetVariableInfo() throws Exception {
OMElement root = _client.buildMessage("listInstances", new String[] {"filter", "order", "limit"},
new String[] {"name=DynPartnerMain", "", "10"});
@@ -155,6 +168,7 @@
// }
// ODE-385 please fix me
+ @Test(enabled = false)
public void ode_385_testDeleteInstances() throws Exception {
OMElement root = _client.buildMessage("listAllInstancesWithLimit", new String[] {"limit"}, new String[] {"1"});
OMElement result = sendToIM(root);
@@ -163,6 +177,7 @@
_client.buildMessage("delete", new String[] {"piid"}, new String[] {iid});
}
+ @BeforeMethod
protected void setUp() throws Exception {
super.setUp();
@@ -203,6 +218,7 @@
Thread.sleep(1000);
}
+ @AfterMethod
protected void tearDown() throws Exception {
// Prepare undeploy message
OMNamespace depns = _factory.createOMNamespace(Namespaces.ODE_PMAPI, "deployapi");
@@ -234,8 +250,4 @@
return _client.send(msg, "http://localhost:8888/processes/DeploymentService");
}
- public static void main(String[] args) {
- junit.textui.TestRunner.run(new InstanceManagementTest());
- }
-
}
Modified: ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTest.java?rev=703549&r1=703548&r2=703549&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTest.java Fri Oct 10 11:24:09 2008
@@ -1,7 +1,8 @@
package org.apache.ode.axis2.management;
import org.apache.ode.axis2.Axis2TestBase;
-import org.apache.ode.axis2.DummyService;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
import javax.xml.namespace.QName;
@@ -10,6 +11,7 @@
*/
public class RetireTest extends Axis2TestBase {
+ @Test
public void testRetiredInstance() throws Exception {
String bundleName = "TestInstanceRetire";
System.out.println("=> " + server.getODEServer().getProcessStore().getPackages());