summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java6
-rw-r--r--java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java6
-rw-r--r--java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java6
-rw-r--r--java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java3
-rw-r--r--java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java9
-rw-r--r--java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java21
6 files changed, 25 insertions, 26 deletions
diff --git a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
index 03625981c9..de59964422 100644
--- a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
+++ b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
@@ -35,6 +35,8 @@ import org.apache.tuscany.sca.interfacedef.util.XMLType;
import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
+import org.junit.Before;
+import org.junit.Test;
/**
* Test case for InterfaceWSDLIntrospectorImpl.
@@ -51,7 +53,8 @@ public class WSDLInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
* @see junit.framework.TestCase#setUp()
*/
@Override
- protected void setUp() throws Exception {
+ @Before
+ public void setUp() throws Exception {
super.setUp();
URL url = getClass().getResource("../xml/stockquote.wsdl");
@@ -61,6 +64,7 @@ public class WSDLInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
}
+ @Test
@SuppressWarnings("unchecked")
public final void testIntrospectPortType() throws InvalidInterfaceException {
WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver);
diff --git a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
index 7c2d22c997..d4f624ad90 100644
--- a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
+++ b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
@@ -19,6 +19,8 @@
package org.apache.tuscany.sca.interfacedef.wsdl.introspect;
+import static org.junit.Assert.fail;
+
import java.net.URI;
import java.net.URL;
import java.util.List;
@@ -35,6 +37,7 @@ import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
+import org.junit.Test;
/**
* Test case for WSDLOperation.
@@ -47,6 +50,7 @@ public class WSDLOperationIntrospectorTestCase extends AbstractWSDLTestCase {
@SuppressWarnings("unchecked")
+ @Test
public final void testWrappedOperation() throws Exception {
URL url = getClass().getResource("../xml/stockquote.wsdl");
WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url);
@@ -77,6 +81,7 @@ public class WSDLOperationIntrospectorTestCase extends AbstractWSDLTestCase {
Assert.assertEquals(new QName(null, "price"), childType.getLogical().getElementName());
}
+ @Test
public final void testUnwrappedOperation() throws Exception {
URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl");
WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("unwrapped-stockquote.wsdl"), url);
@@ -94,6 +99,7 @@ public class WSDLOperationIntrospectorTestCase extends AbstractWSDLTestCase {
Assert.assertEquals(2, op.getInputType().getLogical().size());
}
+ @Test
public final void testInvalidWSDL() throws Exception {
URL url = getClass().getResource("../xml/invalid-stockquote.wsdl");
WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("invalid-stockquote.wsdl"), url);
diff --git a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
index 717c94e981..39c8247206 100644
--- a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
+++ b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLPolicyAnnotatedInterfaceIntrospectorTestCase.java
@@ -34,6 +34,8 @@ import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
import org.apache.tuscany.sca.policy.Intent;
+import org.junit.Before;
+import org.junit.Test;
/**
* Test case for InterfaceWSDLIntrospectorImpl.
@@ -50,8 +52,9 @@ public class WSDLPolicyAnnotatedInterfaceIntrospectorTestCase extends AbstractWS
/**
* @see junit.framework.TestCase#setUp()
*/
+ @Before
@Override
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
super.setUp();
URL url = getClass().getResource("/policy/stockquote_policy.wsdl");
@@ -61,6 +64,7 @@ public class WSDLPolicyAnnotatedInterfaceIntrospectorTestCase extends AbstractWS
portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
}
+ @Test
public final void testIntrospectPortType() throws InvalidInterfaceException {
WSDLInterface contract = wsdlFactory.createWSDLInterface(portType, definition, resolver);
Assert.assertEquals(contract.getName().getLocalPart(), "StockQuotePortType");
diff --git a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
index 8fda9ac11b..9fbd955e12 100644
--- a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
+++ b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WrapperStyleOperationTestCase.java
@@ -31,6 +31,7 @@ import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation;
import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
+import org.junit.Test;
/**
* Test case for WSDLOperation.
@@ -40,6 +41,7 @@ import org.apache.tuscany.sca.interfacedef.wsdl.xml.AbstractWSDLTestCase;
public class WrapperStyleOperationTestCase extends AbstractWSDLTestCase {
private static final QName PORTTYPE_NAME = new QName("http://example.com/stockquote.wsdl", "StockQuotePortType");
+ @Test
public final void testWrappedOperation() throws Exception {
URL url = getClass().getResource("../xml/stockquote.wsdl");
WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("stockquote.wsdl"), url);
@@ -53,6 +55,7 @@ public class WrapperStyleOperationTestCase extends AbstractWSDLTestCase {
Assert.assertEquals(1, op.getWrapper().getOutputChildElements().size());
}
+ @Test
public final void testUnwrappedOperation() throws Exception {
URL url = getClass().getResource("../xml/unwrapped-stockquote.wsdl");
WSDLDefinition definition = (WSDLDefinition)documentProcessor.read(null, new URI("unwrapped-stockquote.wsdl"), url);
diff --git a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java
index 5cafcccea1..32a205a2be 100644
--- a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java
+++ b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/AbstractWSDLTestCase.java
@@ -19,8 +19,6 @@
package org.apache.tuscany.sca.interfacedef.wsdl.xml;
-import junit.framework.TestCase;
-
import org.apache.tuscany.sca.contribution.Contribution;
import org.apache.tuscany.sca.contribution.ContributionFactory;
import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor;
@@ -34,13 +32,14 @@ import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory;
import org.apache.tuscany.sca.xsd.XSDFactory;
+import org.junit.Before;
/**
* Test case for WSDLOperation.
*
* @version $Rev$ $Date$
*/
-public abstract class AbstractWSDLTestCase extends TestCase {
+public abstract class AbstractWSDLTestCase {
protected URLArtifactProcessor<Object> documentProcessor;
protected ModelResolver resolver;
protected WSDLFactory wsdlFactory;
@@ -49,8 +48,8 @@ public abstract class AbstractWSDLTestCase extends TestCase {
/**
* @see junit.framework.TestCase#setUp()
*/
- @Override
- protected void setUp() throws Exception {
+ @Before
+ public void setUp() throws Exception {
ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
FactoryExtensionPoint modelFactories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
wsdlFactory = modelFactories.getFactory(WSDLFactory.class);
diff --git a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
index 6574bbd7c4..14eb6456ca 100644
--- a/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
+++ b/java/sca/modules/interface-wsdl-xml/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLDocumentProcessorTestCase.java
@@ -19,6 +19,8 @@
package org.apache.tuscany.sca.interfacedef.wsdl.xml;
+import static org.junit.Assert.assertNotNull;
+
import java.net.URI;
import java.net.URL;
import java.util.List;
@@ -29,8 +31,6 @@ import javax.xml.namespace.QName;
import junit.framework.Assert;
import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition;
-import org.junit.After;
-import org.junit.Before;
import org.junit.Test;
/**
@@ -38,23 +38,6 @@ import org.junit.Test;
*/
public class WSDLDocumentProcessorTestCase extends AbstractWSDLTestCase {
- /**
- * @throws java.lang.Exception
- */
- @Before
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
-
- /**
- * @throws java.lang.Exception
- */
- @After
- @Override
- public void tearDown() throws Exception {
- }
-
@Test
public void testWSDL() throws Exception {