From 9e88e074f0bb06c01811bc0d4304b8b0e5fd5ade Mon Sep 17 00:00:00 2001 From: rfeng Date: Sat, 8 Aug 2009 04:37:06 +0000 Subject: Fix test cases to avoid NPE git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@802296 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java | 6 ++++-- .../sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'java/sca') diff --git a/java/sca/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java b/java/sca/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java index dafa1497a8..6e3538c47b 100644 --- a/java/sca/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java +++ b/java/sca/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/BindingWSDLGeneratorTestCase.java @@ -24,6 +24,7 @@ import junit.framework.TestCase; import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; import org.apache.tuscany.sca.core.DefaultFactoryExtensionPoint; +import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.core.databinding.processor.DataBindingJavaInterfaceProcessor; import org.apache.tuscany.sca.databinding.DefaultDataBindingExtensionPoint; import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; @@ -47,14 +48,15 @@ import org.oasisopen.sca.annotation.Remotable; public class BindingWSDLGeneratorTestCase extends TestCase { public void testCreateWSDLInterfaceContract() throws InvalidInterfaceException { - org.apache.tuscany.sca.core.FactoryExtensionPoint modelFactories = new DefaultFactoryExtensionPoint(new DefaultExtensionPointRegistry()); + ExtensionPointRegistry registry = new DefaultExtensionPointRegistry(); + org.apache.tuscany.sca.core.FactoryExtensionPoint modelFactories = new DefaultFactoryExtensionPoint(registry); WSDLFactory wsdlFactory = modelFactories.getFactory(WSDLFactory.class); XSDFactory xsdFactory = modelFactories.getFactory(XSDFactory.class); DocumentBuilderFactory documentBuilderFactory = modelFactories.getFactory(DocumentBuilderFactory.class); JavaInterfaceFactory factory = new DefaultJavaInterfaceFactory(); JavaInterfaceContract javaIC = factory.createJavaInterfaceContract(); JavaInterface iface = factory.createJavaInterface(HelloWorld.class); - DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint(); + DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint(registry); JAXWSFaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, null); new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, null).visitInterface(iface); new DataBindingJavaInterfaceProcessor(dataBindings).visitInterface(iface); diff --git a/java/sca/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java b/java/sca/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java index a55bf6de8a..cb866f69a0 100644 --- a/java/sca/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java +++ b/java/sca/modules/binding-ws-wsdlgen/src/test/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGeneratorTestCase.java @@ -51,7 +51,7 @@ public class Interface2WSDLGeneratorTestCase { public void testGenerate() throws Exception { JavaInterfaceFactory iFactory = new DefaultJavaInterfaceFactory(); JavaInterface iface = iFactory.createJavaInterface(TestJavaInterface.class); - DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint(); + DefaultDataBindingExtensionPoint dataBindings = new DefaultDataBindingExtensionPoint(new DefaultExtensionPointRegistry()); JAXWSFaultExceptionMapper faultExceptionMapper = new JAXWSFaultExceptionMapper(dataBindings, null); new JAXWSJavaInterfaceProcessor(dataBindings, faultExceptionMapper, null).visitInterface(iface); new DataBindingJavaInterfaceProcessor(dataBindings).visitInterface(iface); -- cgit v1.2.3