You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by jk...@apache.org on 2007/08/15 06:08:06 UTC
svn commit: r566017 [3/3] - in /incubator/woden/trunk/java:
src/org/apache/woden/ src/org/apache/woden/internal/
src/org/apache/woden/internal/util/ src/org/apache/woden/internal/wsdl20/
src/org/apache/woden/internal/wsdl20/extensions/ src/org/apache/w...
Modified: incubator/woden/trunk/java/test/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidatorTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidatorTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidatorTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/internal/wsdl20/validation/WSDLDocumentValidatorTest.java Tue Aug 14 21:08:03 2007
@@ -30,21 +30,18 @@
import org.apache.woden.ErrorReporter;
import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.DOMWSDLFactory;
import org.apache.woden.internal.ErrorReporterImpl;
import org.apache.woden.internal.schema.ImportedSchemaImpl;
import org.apache.woden.internal.schema.InlinedSchemaImpl;
import org.apache.woden.internal.wsdl20.Constants;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
-import org.apache.woden.internal.wsdl20.extensions.PopulatedExtensionRegistry;
import org.apache.woden.schema.ImportedSchema;
import org.apache.woden.schema.InlinedSchema;
import org.apache.woden.tests.TestErrorHandler;
import org.apache.woden.wsdl20.xml.DescriptionElement;
import org.apache.woden.wsdl20.xml.InterfaceElement;
-import org.apache.woden.wsdl20.xml.InterfaceFaultElement;
-import org.apache.woden.wsdl20.xml.InterfaceMessageReferenceElement;
-import org.apache.woden.wsdl20.xml.InterfaceOperationElement;
import org.apache.woden.wsdl20.xml.TypesElement;
import org.apache.ws.commons.schema.XmlSchema;
import org.apache.ws.commons.schema.XmlSchemaCollection;
@@ -883,12 +880,19 @@
{
fail("There was a problem creating the test URIs: " + e);
}
-
+
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
// Test that a schema without any style defaults is valid.
handler.reset();
try
{
- DescriptionImpl desc = new DescriptionImpl();
+ DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElem = desc.addInterfaceElement();
if(!val.testAssertionInterface1012(interfaceElem, reporter))
{
@@ -904,7 +908,7 @@
handler.reset();
try
{
- DescriptionImpl desc = new DescriptionImpl();
+ DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElem = desc.addInterfaceElement();
interfaceElem.addStyleDefaultURI(absoluteURI);
if(!val.testAssertionInterface1012(interfaceElem, reporter))
@@ -921,7 +925,7 @@
handler.reset();
try
{
- DescriptionImpl desc = new DescriptionImpl();
+ DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElem = desc.addInterfaceElement();
interfaceElem.addStyleDefaultURI(relativeURI);
if(val.testAssertionInterface1012(interfaceElem, reporter))
@@ -938,7 +942,7 @@
handler.reset();
try
{
- DescriptionImpl desc = new DescriptionImpl();
+ DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElem = desc.addInterfaceElement();
interfaceElem.addStyleDefaultURI(absoluteURI);
interfaceElem.addStyleDefaultURI(relativeURI);
@@ -956,7 +960,7 @@
handler.reset();
try
{
- DescriptionImpl desc = new DescriptionImpl();
+ DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElem = desc.addInterfaceElement();
interfaceElem.addStyleDefaultURI(relativeURI);
interfaceElem.addStyleDefaultURI(relativeURI2);
@@ -982,6 +986,13 @@
*/
public void testTestAssertionSchema1066()
{
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
// Create a schema for use in the tests and add it to a types section.
InlinedSchema schema = new InlinedSchemaImpl();
XmlSchema xs1 = null;
@@ -1006,19 +1017,19 @@
schemaNS = new URI("http://www.sample.org");
schema.setSchemaDefinition(xs1);
schema.setNamespace(schemaNS);
- TypesElement types = new DescriptionImpl().addTypesElement();
+ TypesElement types = factory.newDescription().addTypesElement();
types.addSchema(schema);
}
catch(Exception e)
{
fail("An error occurred while creating the sample types section.");
}
-
+
// Test that a null namespace returns true.
handler.reset();
try
{
- DescriptionElement descElem = new DescriptionImpl();
+ DescriptionElement descElem = factory.newDescription();
TypesElement types = descElem.addTypesElement();
types.addSchema(schema);
@@ -1037,7 +1048,7 @@
handler.reset();
try
{
- DescriptionElement descElem = new DescriptionImpl();
+ DescriptionElement descElem = factory.newDescription();
TypesElement types = descElem.addTypesElement();
types.addSchema(schema);
@@ -1056,7 +1067,7 @@
handler.reset();
try
{
- DescriptionElement descElem = new DescriptionImpl();
+ DescriptionElement descElem = factory.newDescription();
TypesElement typesImported = descElem.addTypesElement();
ImportedSchema importedSchema = new ImportedSchemaImpl();
importedSchema.setSchemaDefinition(xs1);
@@ -1077,7 +1088,7 @@
handler.reset();
try
{
- DescriptionElement descElem = new DescriptionImpl();
+ DescriptionElement descElem = factory.newDescription();
//descElem.setTypesElement(types);
if(!val.testAssertionSchema1066(descElem, new QName(Constants.TYPE_XSD_2001, "myElement"), reporter))
@@ -1095,7 +1106,7 @@
handler.reset();
try
{
- DescriptionElement descElem = new DescriptionImpl();
+ DescriptionElement descElem = factory.newDescription();
//descElem.setTypesElement(types);
if(val.testAssertionSchema1066(descElem, new QName("http://www.sample2.org", "myElement"), reporter))
@@ -1114,7 +1125,7 @@
handler.reset();
try
{
- DescriptionElement descElem = new DescriptionImpl();
+ DescriptionElement descElem = factory.newDescription();
TypesElement typesImported = descElem.addTypesElement();
InlinedSchema inlinedSchema = new InlinedSchemaImpl();
typesImported.addSchema(inlinedSchema);
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingFaultReferenceTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingFaultReferenceTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingFaultReferenceTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingFaultReferenceTest.java Tue Aug 14 21:08:03 2007
@@ -22,11 +22,11 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.apache.woden.internal.ErrorReporterImpl;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.BindingFaultReferenceImpl;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
import org.apache.woden.wsdl20.xml.BindingElement;
import org.apache.woden.wsdl20.xml.BindingFaultReferenceElement;
import org.apache.woden.wsdl20.xml.BindingOperationElement;
@@ -45,7 +45,6 @@
private BindingFaultReferenceElement fFaultRefElement = null;
private BindingFaultReference fFaultRef = null;
- private ExtensionRegistry fExtensionRegistry = null;
public static Test suite()
{
@@ -60,8 +59,6 @@
super.setUp();
fFaultRefElement = new BindingFaultReferenceImpl();
fFaultRef = (BindingFaultReference) fFaultRefElement;
- fExtensionRegistry = new ExtensionRegistry();
- fExtensionRegistry.setErrorReporter(new ErrorReporterImpl());
}
/*
@@ -78,11 +75,15 @@
*/
public void testGetInterfaceFaultReference()
{
- DescriptionElement descriptionElement = new DescriptionImpl();
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement descriptionElement = factory.newDescription();
- // TODO - should this be strictly necessary for DescriptionElement.toComponent() not to NPE?
- descriptionElement.setExtensionRegistry(fExtensionRegistry);
-
// Create the BindingElement<->InterfaceElement->InterfaceOperationElement->InterfaceFaultReferenceElement hierarchy
BindingElement bindingElement = descriptionElement.addBindingElement();
bindingElement.setInterfaceName(new QName("interface1"));
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingFaultTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingFaultTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingFaultTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingFaultTest.java Tue Aug 14 21:08:03 2007
@@ -22,6 +22,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.BindingFaultImpl;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
@@ -70,7 +72,14 @@
*/
public void testGetInterfaceFault()
{
- DescriptionElement descriptionElement = new DescriptionImpl();
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement descriptionElement = factory.newDescription();
// Create the BindingElement<->InterfaceElement->InterfaceFaultElement hierarchy
BindingElement bindingElement = descriptionElement.addBindingElement();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingMessageReferenceTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingMessageReferenceTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingMessageReferenceTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingMessageReferenceTest.java Tue Aug 14 21:08:03 2007
@@ -22,11 +22,11 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.apache.woden.internal.ErrorReporterImpl;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.BindingMessageReferenceImpl;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
import org.apache.woden.wsdl20.xml.BindingElement;
import org.apache.woden.wsdl20.xml.BindingMessageReferenceElement;
import org.apache.woden.wsdl20.xml.BindingOperationElement;
@@ -44,7 +44,6 @@
private BindingMessageReferenceElement fBindingMessageRefElement = null;
private BindingMessageReference fBindingMessageRef = null;
- private ExtensionRegistry fExtensionRegistry = null;
public static Test suite()
{
@@ -59,8 +58,6 @@
super.setUp();
fBindingMessageRefElement = new BindingMessageReferenceImpl();
fBindingMessageRef = (BindingMessageReference) fBindingMessageRefElement;
- fExtensionRegistry = new ExtensionRegistry();
- fExtensionRegistry.setErrorReporter(new ErrorReporterImpl());
}
/*
@@ -78,11 +75,15 @@
*/
public void testGetInterfaceMessageReference()
{
- DescriptionElement descriptionElement = new DescriptionImpl();
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement descriptionElement = factory.newDescription();
- // TODO - should this be strictly necessary for DescriptionElement.toComponent() not to NPE?
- descriptionElement.setExtensionRegistry(fExtensionRegistry);
-
// Create the BindingElement<->InterfaceElement->InterfaceOperationElement->InterfaceMessageReferenceElement hierarchy
BindingElement bindingElement = descriptionElement.addBindingElement();
bindingElement.setInterfaceName(new QName("interface1"));
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingOperationTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingOperationTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingOperationTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingOperationTest.java Tue Aug 14 21:08:03 2007
@@ -25,10 +25,10 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.apache.woden.internal.ErrorReporterImpl;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
import org.apache.woden.wsdl20.xml.BindingElement;
import org.apache.woden.wsdl20.xml.BindingFaultReferenceElement;
import org.apache.woden.wsdl20.xml.BindingMessageReferenceElement;
@@ -50,7 +50,6 @@
private BindingElement fBindingElement = null;
private BindingOperationElement fBindingOperationElement = null;
private BindingOperation fBindingOperation = null;
- private ExtensionRegistry fExtensionRegistry = null;
public static Test suite()
{
@@ -63,16 +62,18 @@
protected void setUp() throws Exception
{
super.setUp();
- fDescriptionElement = new DescriptionImpl();
+
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ fDescriptionElement = factory.newDescription();
fBindingElement = fDescriptionElement.addBindingElement();
fBindingOperationElement = fBindingElement.addBindingOperationElement();
fBindingOperation = (BindingOperation) fBindingOperationElement;
-
- // TODO - should this be strictly necessary
- // for DescriptionElement.toComponent() not to NPE?
- fExtensionRegistry = new ExtensionRegistry();
- fExtensionRegistry.setErrorReporter(new ErrorReporterImpl());
- fDescriptionElement.setExtensionRegistry(fExtensionRegistry);
}
/*
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/BindingTest.java Tue Aug 14 21:08:03 2007
@@ -26,6 +26,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
import org.apache.woden.wsdl20.xml.BindingElement;
@@ -58,7 +60,15 @@
protected void setUp() throws Exception
{
super.setUp();
- fDescriptionElement = new DescriptionImpl();
+
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ fDescriptionElement = factory.newDescription();
fBindingElement = fDescriptionElement.addBindingElement();
fBindingElement.setName(new NCName("binding"));
//fBinding = (Binding) fBindingElement;
@@ -83,8 +93,15 @@
Interface retrievedInterface = fBinding.getInterface();
assertNull("Retrieved Interface should be null if none set -", retrievedInterface);
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
// Create and name an Interface Element
- DescriptionElement desc = new DescriptionImpl();
+ DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElement = desc.addInterfaceElement();
interfaceElement.setName(new NCName("interface1"));
@@ -101,7 +118,7 @@
// getInterface() - interface attribute specified, and hierarchy in place:
// Set the "interface" attribute to reference the new Interface Element
// (have to recreate whole desc hierarchy as toComponent() will not rerun if already run!)
- desc = new DescriptionImpl();
+ desc = factory.newDescription();
interfaceElement = desc.addInterfaceElement();
interfaceElement.setName(new NCName("interface1"));
fBindingElement = desc.addBindingElement();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/DescriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/DescriptionTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/DescriptionTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/DescriptionTest.java Tue Aug 14 21:08:03 2007
@@ -1,10 +1,10 @@
/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@@ -22,6 +22,7 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.internal.wsdl20.ElementDeclarationImpl;
import org.apache.woden.internal.wsdl20.TypeDefinitionImpl;
@@ -55,7 +56,8 @@
protected void setUp() throws Exception
{
super.setUp();
- fDescriptionElement = new DescriptionImpl();
+ WSDLFactory factory = WSDLFactory.newInstance();
+ fDescriptionElement = factory.newDescription();
fBindingElement = fDescriptionElement.addBindingElement();
fBindingElement.setName(new NCName("bindingName"));
fInterfaceElement = fDescriptionElement.addInterfaceElement();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/EndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/EndpointTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/EndpointTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/EndpointTest.java Tue Aug 14 21:08:03 2007
@@ -24,6 +24,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.internal.wsdl20.EndpointImpl;
import org.apache.woden.types.NCName;
@@ -104,9 +106,16 @@
* necessary prerequisite partial hierarchy
* Note create the minimum necessary wsdl20 objects
*/
+
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
// Description...
- DescriptionElement fDescElement = new DescriptionImpl();
+ DescriptionElement fDescElement = factory.newDescription();
// Binding...
fBindingQName = new QName("binding1");
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceFaultReferenceTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceFaultReferenceTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceFaultReferenceTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceFaultReferenceTest.java Tue Aug 14 21:08:03 2007
@@ -22,9 +22,10 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.internal.wsdl20.InterfaceFaultReferenceImpl;
-import org.apache.woden.internal.wsdl20.InterfaceImpl;
import org.apache.woden.types.NCName;
import org.apache.woden.wsdl20.enumeration.Direction;
import org.apache.woden.wsdl20.xml.DescriptionElement;
@@ -92,8 +93,15 @@
*/
public void testGetInterfaceFault()
{
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
// Create the DescriptionElement->InterfaceElement->InterfaceOperationElement->InterfaceFaultReference hierarchy
- DescriptionElement desc = new DescriptionImpl();
+ DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElement = desc.addInterfaceElement();
InterfaceOperationElement interfaceOperationElement = interfaceElement.addInterfaceOperationElement();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceFaultTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceFaultTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceFaultTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceFaultTest.java Tue Aug 14 21:08:03 2007
@@ -22,6 +22,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.internal.wsdl20.ElementDeclarationImpl;
import org.apache.woden.types.NCName;
@@ -55,7 +57,13 @@
protected void setUp() throws Exception
{
super.setUp();
- fDescriptionElement = new DescriptionImpl();
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+ fDescriptionElement = factory.newDescription();
fInterfaceElement = fDescriptionElement.addInterfaceElement();
fInterfaceElement.setName(new NCName(INTF_NAME));
fFaultElement = fInterfaceElement.addInterfaceFaultElement();
@@ -84,7 +92,7 @@
// Default case
assertNull("The retrieved Element Declaration when unset should be null", fFault.getElementDeclaration());
- // set and asscoiciate the Element Declaration
+ // set and associate the Element Declaration
ElementDeclarationImpl ed = new ElementDeclarationImpl();
ed.setName(new QName(FAULT_NAME));
((DescriptionImpl)fDescriptionElement).addElementDeclaration(ed);
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceOperationTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceOperationTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceOperationTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/InterfaceOperationTest.java Tue Aug 14 21:08:03 2007
@@ -26,6 +26,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.ErrorReporterImpl;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
@@ -65,8 +67,15 @@
*/
protected void setUp() throws Exception
{
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
super.setUp();
- fDescriptionElement = new DescriptionImpl();
+ fDescriptionElement = factory.newDescription();
fInterfaceElement = fDescriptionElement.addInterfaceElement();
fInterfaceElement.setName(new NCName(INTF_NAME));
fInterfaceOperationElement = fInterfaceElement.addInterfaceOperationElement();
@@ -75,11 +84,6 @@
fPattern = new URI("http://www.w3.org/0000/00/wsdl/in-out");
fInterfaceOperationElement.setPattern(fPattern);
- // TODO - should this stanza be strictly necessary for DescriptionElement.toComponent() not to NPE?
- ExtensionRegistry er = new ExtensionRegistry();
- er.setErrorReporter(new ErrorReporterImpl());
- fDescriptionElement.setExtensionRegistry(er);
-
fDescription = fDescriptionElement.toComponent();
Interface iface = fDescription.getInterface(new QName(INTF_NAME));
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/ServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/ServiceTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/ServiceTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/ServiceTest.java Tue Aug 14 21:08:03 2007
@@ -22,6 +22,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.internal.wsdl20.ServiceImpl;
import org.apache.woden.types.NCName;
@@ -50,7 +52,15 @@
protected void setUp() throws Exception
{
super.setUp();
- DescriptionElement desc = new DescriptionImpl();
+
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement desc = factory.newDescription();
desc.addServiceElement();
fEmptyService = desc.toComponent().getServices()[0];
}
@@ -104,8 +114,15 @@
* - Service using that same Interface.
*/
- // Description...
- DescriptionElement fDescElement = new DescriptionImpl();
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ // Description...
+ DescriptionElement fDescElement = factory.newDescription();
// Interface
InterfaceElement fInterfaceElement = fDescElement.addInterfaceElement();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/FragmentIdentificationTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/FragmentIdentificationTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/FragmentIdentificationTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/fragids/FragmentIdentificationTest.java Tue Aug 14 21:08:03 2007
@@ -36,7 +36,7 @@
try {
desc = reader.readWSDL(wsdlURL2.toString());
} catch(Exception e) {
-
+ fail("Failed with unexpected exception: " + e);
}
assertEquals("wsdl.description()", desc.toString());
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingElementTest.java Tue Aug 14 21:08:03 2007
@@ -26,6 +26,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
@@ -40,6 +42,7 @@
private DescriptionElement fDescriptionElement = null;
private BindingElement fBindingElement = null;
private URI fTypeURI = null;
+ private WSDLFactory fFactory = null;
public static Test suite()
{
@@ -52,7 +55,14 @@
protected void setUp() throws Exception
{
super.setUp();
- fDescriptionElement = new DescriptionImpl();
+
+ try {
+ fFactory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ fDescriptionElement = fFactory.newDescription();
fBindingElement = fDescriptionElement.addBindingElement();
fTypeURI = new URI("http://www.w3.org/0000/00/apacheType");
}
@@ -92,7 +102,7 @@
assertNull("Retrieved Interface Element should be null if none set -", retrievedInterfaceElement);
// Create and name an Interface Element
- DescriptionElement desc = new DescriptionImpl();
+ DescriptionElement desc = fFactory.newDescription();
InterfaceElement interfaceElement = desc.addInterfaceElement();
interfaceElement.setName(new NCName("interface1"));
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultElementTest.java Tue Aug 14 21:08:03 2007
@@ -22,6 +22,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.BindingFaultImpl;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
@@ -73,7 +75,14 @@
*/
public void testGetInterfaceFaultElement()
{
- DescriptionElement descriptionElement = new DescriptionImpl();
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement descriptionElement = factory.newDescription();
// Create the BindingElement<->InterfaceElement->InterfaceFaultElement hierarchy
BindingElement bindingElement = descriptionElement.addBindingElement();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultReferenceElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultReferenceElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultReferenceElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingFaultReferenceElementTest.java Tue Aug 14 21:08:03 2007
@@ -22,11 +22,11 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.apache.woden.internal.ErrorReporterImpl;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.BindingFaultReferenceImpl;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
-import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
/**
* Unit tests for the BindingFaultReferenceElement class.
@@ -36,7 +36,6 @@
public class BindingFaultReferenceElementTest extends TestCase {
private BindingFaultReferenceElement fFaultReference = null;
- private ExtensionRegistry fExtensionRegistry = null;
public static Test suite()
{
@@ -50,8 +49,6 @@
{
super.setUp();
fFaultReference = new BindingFaultReferenceImpl();
- fExtensionRegistry = new ExtensionRegistry();
- fExtensionRegistry.setErrorReporter(new ErrorReporterImpl());
}
/*
@@ -90,10 +87,14 @@
*/
public void testGetInterfaceFaultReferenceElement()
{
- DescriptionElement descriptionElement = new DescriptionImpl();
-
- // TODO - should this be strictly necessary for DescriptionElement.toComponent() not to NPE?
- descriptionElement.setExtensionRegistry(fExtensionRegistry);
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement descriptionElement = factory.newDescription();
// Create the BindingElement<->InterfaceElement->InterfaceOperationElement->InterfaceFaultReferenceElement hierarchy
BindingElement bindingElement = descriptionElement.addBindingElement();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingOperationElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingOperationElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingOperationElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/BindingOperationElementTest.java Tue Aug 14 21:08:03 2007
@@ -25,6 +25,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
@@ -41,6 +43,7 @@
private BindingElement fBindingElement = null;
private BindingOperationElement fBindingOperationElement = null;
private final String BOP_NAME = "BindingOperationName";
+ private WSDLFactory fFactory = null;
public static Test suite()
{
@@ -53,7 +56,14 @@
protected void setUp() throws Exception
{
super.setUp();
- fDescriptionElement = new DescriptionImpl();
+
+ try {
+ fFactory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ fDescriptionElement = fFactory.newDescription();
fBindingElement = fDescriptionElement.addBindingElement();
fBindingOperationElement = fBindingElement.addBindingOperationElement();
}
@@ -187,7 +197,7 @@
assertNull("Retrieved Interface Operation Element should be null if none set -", retrievedIntOpElement);
// Create and name an Interface Element
- DescriptionElement desc = new DescriptionImpl();
+ DescriptionElement desc = fFactory.newDescription();
InterfaceElement interfaceElement = desc.addInterfaceElement();
interfaceElement.setName(new NCName("interface1"));
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ChildElementCreationTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ChildElementCreationTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ChildElementCreationTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ChildElementCreationTest.java Tue Aug 14 21:08:03 2007
@@ -22,6 +22,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
/**
@@ -33,6 +35,8 @@
*/
public class ChildElementCreationTest extends TestCase {
+ private WSDLFactory fFactory = null;
+
public static void main(String[] args) {
junit.textui.TestRunner.run(ChildElementCreationTest.class);
}
@@ -41,10 +45,17 @@
return new TestSuite(ChildElementCreationTest.class);
}
+ public void setUp() {
+ try {
+ fFactory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+ }
// Elements addable to Binding
public void testBindingFaultElement() {
- DescriptionElement descEl = new DescriptionImpl();
+ DescriptionElement descEl = fFactory.newDescription();
BindingElement bindEl = descEl.addBindingElement();
BindingFaultElement bindFEl = bindEl.addBindingFaultElement();
@@ -55,7 +66,7 @@
}
public void testBindingOperationElement() {
- DescriptionElement descEl = new DescriptionImpl();
+ DescriptionElement descEl = fFactory.newDescription();
BindingElement bindEl = descEl.addBindingElement();
BindingOperationElement bindOpEl = bindEl.addBindingOperationElement();
@@ -66,7 +77,7 @@
}
public void testBindingFaultReferenceElement() {
- DescriptionElement descEl = new DescriptionImpl();
+ DescriptionElement descEl = fFactory.newDescription();
BindingElement bindEl = descEl.addBindingElement();
BindingOperationElement bindOpEl = bindEl.addBindingOperationElement();
BindingFaultReferenceElement bindFREl = bindOpEl.addBindingFaultReferenceElement();
@@ -77,7 +88,7 @@
}
public void testBindingMessageReferenceElement() {
- DescriptionElement descEl = new DescriptionImpl();
+ DescriptionElement descEl = fFactory.newDescription();
BindingElement bindEl = descEl.addBindingElement();
BindingOperationElement bindOpEl = bindEl.addBindingOperationElement();
BindingMessageReferenceElement bindMREl = bindOpEl.addBindingMessageReferenceElement();
@@ -89,7 +100,7 @@
// Elements addable to Interface
public void testInterfaceFaultElement() {
- DescriptionElement descEl = new DescriptionImpl();
+ DescriptionElement descEl = fFactory.newDescription();
InterfaceElement interfaceEl = descEl.addInterfaceElement();
InterfaceFaultElement interfaceFEl = interfaceEl.addInterfaceFaultElement();
@@ -100,7 +111,7 @@
}
public void testInterfaceOperationElement() {
- DescriptionElement descEl = new DescriptionImpl();
+ DescriptionElement descEl = fFactory.newDescription();
InterfaceElement interfaceEl = descEl.addInterfaceElement();
InterfaceOperationElement interfaceOpEl = interfaceEl.addInterfaceOperationElement();
@@ -111,7 +122,7 @@
}
public void testInterfaceFaultReferenceElement() {
- DescriptionElement descEl = new DescriptionImpl();
+ DescriptionElement descEl = fFactory.newDescription();
InterfaceElement interfaceEl = descEl.addInterfaceElement();
InterfaceOperationElement interfaceOpEl = interfaceEl.addInterfaceOperationElement();
InterfaceFaultReferenceElement interfaceFREl = interfaceOpEl.addInterfaceFaultReferenceElement();
@@ -122,7 +133,7 @@
}
public void testInterfaceMessageReferenceElement() {
- DescriptionElement descEl = new DescriptionImpl();
+ DescriptionElement descEl = fFactory.newDescription();
InterfaceElement interfaceEl = descEl.addInterfaceElement();
InterfaceOperationElement interfaceOpEl = interfaceEl.addInterfaceOperationElement();
InterfaceMessageReferenceElement interfaceMREl = interfaceOpEl.addInterfaceMessageReferenceElement();
@@ -133,7 +144,7 @@
}
public void testEndpointElement() {
- DescriptionElement descEl = new DescriptionImpl();
+ DescriptionElement descEl = fFactory.newDescription();
ServiceElement serviceEl = descEl.addServiceElement();
EndpointElement endpointEl = serviceEl.addEndpointElement();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DescriptiontElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DescriptiontElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DescriptiontElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DescriptiontElementTest.java Tue Aug 14 21:08:03 2007
@@ -23,10 +23,11 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.wsdl20.Description;
import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
-import org.apache.woden.WSDLException;
/**
* Unit tests for the DescriptionElement class.
@@ -41,6 +42,7 @@
private URI fNamespace1 = null;
private URI fNamespace2 = null;
private URI fDocBaseUri = null;
+ private WSDLFactory fFactory = null;
public static Test suite()
{
@@ -53,7 +55,14 @@
protected void setUp() throws Exception
{
super.setUp();
- fDescriptionElement = new DescriptionImpl();
+
+ try {
+ fFactory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ fDescriptionElement = fFactory.newDescription();
fNamespace1 = new URI("http://apache.org/namespaceURIa");
fNamespace2 = new URI("http://apache.org/namespaceURIb");
fDocBaseUri = new URI("http://apache.org/documentbaseURI");
@@ -171,14 +180,6 @@
}
// check subsequent getTypesElement invocation...
assertSame(typesElement, fDescriptionElement.getTypesElement());
- }
-
- public void testSetGetExtensionRegistry() {
- ExtensionRegistry er = new ExtensionRegistry();
- fDescriptionElement.setExtensionRegistry(er);
- ExtensionRegistry erRetrieved = fDescriptionElement.getExtensionRegistry();
- assertNotNull("Null given but ExtensionRegistry object expected", erRetrieved);
- assertSame("Retrieved ExtensionRegistry object differs from that set", er, erRetrieved);
}
public void testToComponent() {
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DocumentationElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DocumentationElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DocumentationElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/DocumentationElementTest.java Tue Aug 14 21:08:03 2007
@@ -26,6 +26,7 @@
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.XMLElement;
/**
@@ -85,12 +86,25 @@
}
}
+ private WSDLFactory fFactory = null;
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ try {
+ fFactory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+ }
+
/**
* Test method for {@link org.apache.woden.internal.wsdl20.DocumentationImpl#setContent(java.lang.Object)}.
* Test method for {@link org.apache.woden.internal.wsdl20.DocumentationImpl#setContent(java.lang.Object)}.
*/
public void testSetGetContent() {
- DescriptionElement descElem = new DescriptionImpl();
+ DescriptionElement descElem = fFactory.newDescription();
DocumentationElement docElem = descElem.addDocumentationElement();
//check that the doc element is empty when first created
@@ -106,7 +120,7 @@
* Test method for {@link org.apache.woden.internal.wsdl20.DocumentationImpl#getParentElement()}.
*/
public void testGetParentElement() {
- DescriptionElement descElem1 = new DescriptionImpl();
+ DescriptionElement descElem1 = fFactory.newDescription();
DocumentationElement docElem = descElem1.addDocumentationElement();
//check the parent
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ImportElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ImportElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ImportElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ImportElementTest.java Tue Aug 14 21:08:03 2007
@@ -23,6 +23,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.internal.wsdl20.ImportImpl;
@@ -34,8 +36,9 @@
public class ImportElementTest extends TestCase {
private ImportElement fImport = new ImportImpl();
- private DescriptionElement fDescriptionElement = new DescriptionImpl();
+ private DescriptionElement fDescriptionElement = null;
private URI fURI = null;
+ private WSDLFactory fFactory = null;
public static Test suite()
{
@@ -48,6 +51,14 @@
protected void setUp() throws Exception
{
super.setUp();
+
+ try {
+ fFactory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ fDescriptionElement = fFactory.newDescription();
}
/*
@@ -104,7 +115,7 @@
}
public void testGetParentElement() {
- DescriptionElement desc = new DescriptionImpl();
+ DescriptionElement desc = fFactory.newDescription();
ImportElement importEl = desc.addImportElement();
DescriptionElement parent = (DescriptionElement)importEl.getParentElement();
assertSame("The import's parent should be the description that created it", desc, parent);
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/IncludeElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/IncludeElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/IncludeElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/IncludeElementTest.java Tue Aug 14 21:08:03 2007
@@ -23,6 +23,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.internal.wsdl20.IncludeImpl;
@@ -34,14 +36,31 @@
public class IncludeElementTest extends TestCase {
private IncludeElement fInclude = new IncludeImpl();
- private DescriptionElement fDescriptionElement = new DescriptionImpl();
+ private DescriptionElement fDescriptionElement = null;
private URI fURI = null;
+ private WSDLFactory fFactory = null;
public static Test suite()
{
return new TestSuite(IncludeElementTest.class);
}
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ try {
+ fFactory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ fDescriptionElement = fFactory.newDescription();
+ }
+
/**
* Test that a Description Element can be successfully set and retrieved from an IncludeElement
*/
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceElementTest.java Tue Aug 14 21:08:03 2007
@@ -26,7 +26,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.apache.woden.internal.wsdl20.DescriptionImpl;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.types.NCName;
/**
@@ -53,7 +54,15 @@
protected void setUp() throws Exception
{
super.setUp();
- fDescriptionElement = new DescriptionImpl();
+
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ fDescriptionElement = factory.newDescription();
fInterfaceElement = fDescriptionElement.addInterfaceElement();
fStyleDefaultURI1 = new URI("http://www.w3.org/0000/00/apacheStyle");
fStyleDefaultURI2 = new URI("http://www.w3.org/0000/00/anotherApacheStyle");
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceFaultElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceFaultElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceFaultElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceFaultElementTest.java Tue Aug 14 21:08:03 2007
@@ -22,6 +22,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.internal.wsdl20.InterfaceFaultImpl;
import org.apache.woden.types.NCName;
@@ -41,7 +43,15 @@
}
public void setUp() {
- DescriptionElement desc = new DescriptionImpl();
+
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement desc = factory.newDescription();
fFault = (desc.addInterfaceElement()).addInterfaceFaultElement();
}
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceFaultReferenceElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceFaultReferenceElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceFaultReferenceElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceFaultReferenceElementTest.java Tue Aug 14 21:08:03 2007
@@ -22,9 +22,10 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.internal.wsdl20.InterfaceFaultReferenceImpl;
-import org.apache.woden.internal.wsdl20.InterfaceImpl;
import org.apache.woden.types.NCName;
import org.apache.woden.wsdl20.enumeration.Direction;
@@ -100,8 +101,15 @@
*/
public void testGetInterfaceFaultElement()
{
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
// Create the DescriptionElement->InterfaceElement->InterfaceOperationElement->InterfaceFaultReference hierarchy
- DescriptionElement desc = new DescriptionImpl();
+ DescriptionElement desc = factory.newDescription();
InterfaceElement interfaceElement = desc.addInterfaceElement();
InterfaceOperationElement interfaceOperationElement = interfaceElement.addInterfaceOperationElement();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceMessageReferenceElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceMessageReferenceElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceMessageReferenceElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceMessageReferenceElementTest.java Tue Aug 14 21:08:03 2007
@@ -24,21 +24,15 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.apache.woden.internal.ErrorReporterImpl;
-import org.apache.woden.internal.schema.ImportedSchemaImpl;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.Constants;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.internal.wsdl20.ElementDeclarationImpl;
import org.apache.woden.internal.wsdl20.InterfaceMessageReferenceImpl;
-import org.apache.woden.internal.wsdl20.extensions.InterfaceOperationExtensionsImpl;
-import org.apache.woden.schema.Schema;
import org.apache.woden.types.NCName;
import org.apache.woden.wsdl20.ElementDeclaration;
-import org.apache.woden.wsdl20.InterfaceOperation;
import org.apache.woden.wsdl20.enumeration.Direction;
-import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
import org.apache.ws.commons.schema.XmlSchemaElement;
@@ -51,7 +45,6 @@
public class InterfaceMessageReferenceElementTest extends TestCase {
private InterfaceMessageReferenceElement fMessageReference = null;
- private ExtensionRegistry fExtensionRegistry = null;
private URI fNamespace = null;
public static Test suite()
@@ -67,8 +60,6 @@
super.setUp();
fMessageReference = new InterfaceMessageReferenceImpl();
fNamespace = new URI("http://apache.org/testns");
- fExtensionRegistry = new ExtensionRegistry();
- fExtensionRegistry.setErrorReporter(new ErrorReporterImpl());
}
/*
@@ -135,13 +126,17 @@
public void testGetElement()
{
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
// Create the DescriptionElement->InterfaceElement->InterfaceOperationElement->InterfaceMessageReferenceElement hierarchy
- DescriptionElement descriptionElement = new DescriptionImpl();
+ DescriptionElement descriptionElement = factory.newDescription();
InterfaceElement interfaceElement = descriptionElement.addInterfaceElement();
InterfaceOperationElement interfaceOperationElement = interfaceElement.addInterfaceOperationElement();
-
- // TODO - should this be strictly necessary for DescriptionElement.toComponent() not to NPE?
- descriptionElement.setExtensionRegistry(fExtensionRegistry);
// create the InterfaceMessageReferenceElement to test
InterfaceMessageReferenceElement messageReference = interfaceOperationElement.addInterfaceMessageReferenceElement();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceOperationElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceOperationElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceOperationElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/InterfaceOperationElementTest.java Tue Aug 14 21:08:03 2007
@@ -26,6 +26,8 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
import org.apache.woden.types.NCName;
@@ -56,7 +58,15 @@
protected void setUp() throws Exception
{
super.setUp();
- fDescriptionElement = new DescriptionImpl();
+
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ fDescriptionElement = factory.newDescription();
fInterfaceElement = fDescriptionElement.addInterfaceElement();
fInterfaceOperationElement = fInterfaceElement.addInterfaceOperationElement();
fStyleURI1 = new URI("http://www.w3.org/0000/00/apacheStyle");
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/NameAttributeTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/NameAttributeTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/NameAttributeTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/NameAttributeTest.java Tue Aug 14 21:08:03 2007
@@ -20,8 +20,9 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.woden.WSDLException;
+import org.apache.woden.WSDLFactory;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
-import org.apache.woden.internal.wsdl20.InterfaceImpl;
import org.apache.woden.types.NCName;
public class NameAttributeTest extends TestCase {
@@ -41,7 +42,14 @@
* of the emptystring.
*/
public void testNamespaceOfGetNameReturnValue() {
- DescriptionElement de = new DescriptionImpl();
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement de = factory.newDescription();
InterfaceElement ie = de.addInterfaceElement();
ie.setName(new NCName("foo"));
String namespace = ie.getName().getNamespaceURI();
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/OMServiceElementTest.java Tue Aug 14 21:08:03 2007
@@ -26,6 +26,7 @@
import junit.framework.TestSuite;
import org.apache.woden.ErrorHandler;
+import org.apache.woden.WSDLException;
import org.apache.woden.WSDLFactory;
import org.apache.woden.WSDLReader;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
@@ -97,7 +98,14 @@
* Test that the QName specified on the setName method is returned by getName.
*/
public void testSetAndGetNameFromOM() throws Exception{
- DescriptionElement descElem = new DescriptionImpl();
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement descElem = factory.newDescription();
descElem.setTargetNamespace(new URI("urn:woden"));
ServiceElement service = descElem.addServiceElement();
service.setName(new NCName(fQName.getLocalPart()));
Modified: incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/wsdl20/xml/ServiceElementTest.java Tue Aug 14 21:08:03 2007
@@ -26,6 +26,7 @@
import junit.framework.TestSuite;
import org.apache.woden.ErrorHandler;
+import org.apache.woden.WSDLException;
import org.apache.woden.WSDLFactory;
import org.apache.woden.WSDLReader;
import org.apache.woden.internal.wsdl20.DescriptionImpl;
@@ -103,7 +104,14 @@
*/
public void testSetAndGetName() throws Exception
{
- DescriptionElement descElem = new DescriptionImpl();
+ WSDLFactory factory = null;
+ try {
+ factory = WSDLFactory.newInstance();
+ } catch (WSDLException e) {
+ fail("Can't instantiate the WSDLFactory object.");
+ }
+
+ DescriptionElement descElem = factory.newDescription();
descElem.setTargetNamespace(new URI("urn:woden"));
ServiceElement service = descElem.addServiceElement();
service.setName(new NCName(fQName.getLocalPart()));
Modified: incubator/woden/trunk/java/test/org/apache/woden/xml/IntOrTokenAttrTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/xml/IntOrTokenAttrTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/xml/IntOrTokenAttrTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/xml/IntOrTokenAttrTest.java Tue Aug 14 21:08:03 2007
@@ -58,7 +58,6 @@
handler = new TestErrorHandler();
reporter = new ErrorReporterImpl();
reporter.setErrorHandler(handler);
- attr = new IntOrTokenAnyAttrImpl();
}
/*
@@ -75,7 +74,7 @@
public void testAttributeType() throws Exception
{
String attrVal = "#any";
- attr.init(el, qn, attrVal);
+ attr = new IntOrTokenAnyAttrImpl(el, qn, attrVal, reporter);
String expectedQN = qn.toString();
String actualQN = attr.getAttributeType().toString();
assertEquals("Expected attribute type qname '" + expectedQN + "' but actual qname was '" + actualQN + "'.",
@@ -86,7 +85,7 @@
public void testValidToken() throws Exception
{
String attrVal = "#any";
- attr.init(el, qn, attrVal);
+ attr = new IntOrTokenAnyAttrImpl(el, qn, attrVal, reporter);
assertTrue("isValid() should return true", attr.isValid());
assertTrue("getContent() should return instance of 'String' but actual object type was '" + attr.getContent().getClass().getName() + "'.",
@@ -106,7 +105,7 @@
public void testValidInt() throws Exception
{
String attrVal = "123";
- attr.init(el, qn, attrVal);
+ attr = new IntOrTokenAnyAttrImpl(el, qn, attrVal, reporter);
assertTrue("isValid() should return true", attr.isValid());
assertTrue("getContent() should return instance of 'Integer' but actual object type was '" + attr.getContent().getClass().getName() + "'.",
@@ -126,8 +125,7 @@
public void testInvalidValue() throws Exception
{
String attrVal = "#rubbish";
- attr.setErrorReporter(reporter); //to check expected error msg
- attr.init(el, qn, attrVal);
+ attr = new IntOrTokenAnyAttrImpl(el, qn, attrVal, reporter);
ErrorInfo errInfo = (ErrorInfo)handler.errors.get("WSDL512");
assertNotNull("An error should have been reported", errInfo);
@@ -145,8 +143,7 @@
public void testNullValue() throws Exception
{
String attrVal = null;
- attr.setErrorReporter(reporter); //to check expected error msg
- attr.init(el, qn, attrVal);
+ attr = new IntOrTokenAnyAttrImpl(el, qn, attrVal, reporter);
ErrorInfo errInfo = (ErrorInfo)handler.errors.get("WSDL512");
assertNotNull("An error should have been reported", errInfo);
Modified: incubator/woden/trunk/java/test/org/apache/woden/xml/TokenAttrTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/xml/TokenAttrTest.java?view=diff&rev=566017&r1=566016&r2=566017
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/xml/TokenAttrTest.java (original)
+++ incubator/woden/trunk/java/test/org/apache/woden/xml/TokenAttrTest.java Tue Aug 14 21:08:03 2007
@@ -57,7 +57,6 @@
handler = new TestErrorHandler();
reporter = new ErrorReporterImpl();
reporter.setErrorHandler(handler);
- attr = new TokenAttrImpl();
}
/*
@@ -74,7 +73,7 @@
public void testAttributeType() throws Exception
{
String attrVal = "#any";
- attr.init(el, qn, attrVal);
+ attr = new TokenAttrImpl(el, qn, attrVal, reporter);
String expectedQN = qn.toString();
String actualQN = attr.getAttributeType().toString();
assertEquals("Expected attribute type qname '" + expectedQN + "' but actual qname was '" + actualQN + "'.",
@@ -85,7 +84,7 @@
public void testValidToken() throws Exception
{
String attrVal = "#any";
- attr.init(el, qn, attrVal);
+ attr = new TokenAttrImpl(el, qn, attrVal, reporter);
assertTrue("isValid() should return true", attr.isValid());
assertNotNull("getToken() should not return null", attr.getToken());
@@ -101,8 +100,7 @@
public void testNullValue() throws Exception
{
String attrVal = null;
- attr.setErrorReporter(reporter); //to check expected error msg
- attr.init(el, qn, attrVal);
+ attr = new TokenAttrImpl(el, qn, attrVal, reporter);
ErrorInfo errInfo = (ErrorInfo)handler.errors.get("WSDL508");
assertNotNull("An error should have been reported", errInfo);
---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org