diff options
Diffstat (limited to 'tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse')
23 files changed, 0 insertions, 3792 deletions
diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/ValidatorTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/ValidatorTest.java deleted file mode 100644 index 678486ce5..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/ValidatorTest.java +++ /dev/null @@ -1,252 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.eclipse; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.util.ResourceBundle; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.xerces.util.XMLGrammarPoolImpl; -import org.eclipse.wst.wsdl.validation.internal.IValidationMessage; -import org.eclipse.wst.wsdl.validation.internal.ValidationInfoImpl; -import org.eclipse.wst.wsdl.validation.internal.ValidationMessageImpl; -import org.eclipse.wst.wsdl.validation.internal.util.MessageGenerator; -import org.eclipse.wst.wsdl.validation.tests.internal.WSDLValidatorTestsPlugin; -import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext; -import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo; -import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage; -import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport; - -/** - * Test the WSDL validation framework Validator. - */ -public class ValidatorTest extends TestCase -{ - ValidatorWrapper validator = new ValidatorWrapper(); - - /** - * Create a tests suite from this test class. - * - * @return A test suite containing this test class. - */ - public static Test suite() - { - return new TestSuite(ValidatorTest.class); - } - - /** - * Test the validate method. Tests to be performed:<br/> - * 1. Test that validating a valid file from a URI or an input stream produces the same result.<br/> - * 2. Test that validating an invalid file from a URI or an input stream produces the same result. - */ - public void testValidate() - { - try - { - // Test that validating a valid file from a URI and an input stream produces the same result. - NestedValidatorContext context = new NestedValidatorContext(); - validator.setupValidation(context); - String PLUGIN_ABSOLUTE_PATH = WSDLValidatorTestsPlugin.getInstallURL(); - String uri = "file:///" + PLUGIN_ABSOLUTE_PATH + "testresources/samples/Paths/Dash-InPath/DashInPathValid.wsdl"; - ValidationReport report1 = validator.validate(uri, null, context); - validator.teardownValidation(context); - validator.setupValidation(context); - ValidationReport report2 = null; - InputStream is = null; - try - { - is = new URL(uri).openStream(); - report2 = validator.validate(uri, is, context); - } - catch(Exception e) - { - fail("A problem occurred while validating a valid file with an inputstream: " + e); - } - finally - { - if(is != null) - { - try - { - is.close(); - } - catch(IOException e) - { - // Do nothing. - } - } - } - validator.teardownValidation(context); - assertTrue("Validation using a URI did not product a valid validation result.", report1.isValid()); - assertEquals("Validation using URI and using inputstream of the same file produces different numbers of errors.", report1.getValidationMessages().length, report2.getValidationMessages().length); - - // Test that validating an invalid file from a URI and an input stream produces the same result. - NestedValidatorContext context2 = new NestedValidatorContext(); - validator.setupValidation(context2); - uri = "file:///" + PLUGIN_ABSOLUTE_PATH + "testresources/samples/Paths/Dash-InPath/DashInPathInvalid.wsdl"; - report1 = validator.validate(uri, null, context2); - validator.teardownValidation(context2); - validator.setupValidation(context2); - report2 = null; - is = null; - try - { - is = new URL(uri).openStream(); - report2 = validator.validate(uri, is, context2); - } - catch(Exception e) - { - fail("A problem occurred while validating an invalid file with an inputstream: " + e); - } - finally - { - if(is != null) - { - try - { - is.close(); - } - catch(IOException e) - { - // Do nothing. - } - } - } - validator.teardownValidation(context2); - assertFalse("Validation using a URI did not product an invalid validation result.", report1.isValid()); - assertEquals("Validation using URI and using inputstream of the same file produces different numbers of errors.", report1.getValidationMessages().length, report2.getValidationMessages().length); - } - catch(Exception e) - { - fail("Unable to locate plug-in location: " + e); - } - } - - /** - * Test the setupValidation method. - * 1. Test that after run for a context XML and XSD grammar pools exist for the context. - */ - public void testSetupValidation() - { - validator.getXMLGrammarPoolsMap().clear(); - validator.getXSDGrammarPoolsMap().clear(); - - NestedValidatorContext context = new NestedValidatorContext(); - assertNull("An XML grammar pool already exists for the context.", validator.getXMLGrammarPoolForContext(context)); - assertNull("An XSD grammar pool already exists for the context.", validator.getXSDGrammarPoolForContext(context)); - - validator.setupValidation(context); - - assertNotNull("An XML grammar pool does not exist after the setupValidation method is run.", validator.getXMLGrammarPoolForContext(context)); - assertNotNull("An XSD grammar pool does not exist after the setupValidation method is run.", validator.getXSDGrammarPoolForContext(context)); - - validator.getXMLGrammarPoolsMap().clear(); - validator.getXSDGrammarPoolsMap().clear(); - } - - /** - * Test the teardownValidation method. - * 1. Test that after run for a context XML and XSD grammar pools do not exist for the context. - */ - public void testTeardownValidation() - { - validator.getXMLGrammarPoolsMap().clear(); - validator.getXSDGrammarPoolsMap().clear(); - - NestedValidatorContext context = new NestedValidatorContext(); - validator.getXMLGrammarPoolsMap().put(context, new XMLGrammarPoolImpl()); - validator.getXSDGrammarPoolsMap().put(context, new InlineSchemaModelGrammarPoolImpl()); - - validator.teardownValidation(context); - - assertNull("An XML grammar pool exists after the teardownValidation method is run.", validator.getXMLGrammarPoolForContext(context)); - assertNull("An XSD grammar pool exists after the teardownValidation method is run.", validator.getXSDGrammarPoolForContext(context)); - - validator.getXMLGrammarPoolsMap().clear(); - validator.getXSDGrammarPoolsMap().clear(); - } - - /** - * Test converting a message. The contents of the message should be included in the - * new report. - * 1. Test that a regular message is added as is. - * 2. Test that a nested message is added as a nested message. - */ - public void testConvertMessage() - { - // 1. Test that a regular message is added as is. - ValidationMessageImpl message = new ValidationMessageImpl("message", 1, 2, IValidationMessage.SEV_ERROR, "file:/someuri"); - ValidationInfo report = new ValidationInfo("file:/someuri"); - validator.convertMessage(message, report); - assertEquals("The report does not have 1 message.", 1, report.getValidationMessages().length); - assertEquals("The message string is incorrect.", "message", report.getValidationMessages()[0].getMessage()); - assertEquals("The message line number is incorrect.", 1, report.getValidationMessages()[0].getLineNumber()); - assertEquals("The message column number is incorrect.", 2, report.getValidationMessages()[0].getColumnNumber()); - assertEquals("The message severity is incorrect.", ValidationMessage.SEV_NORMAL, report.getValidationMessages()[0].getSeverity()); - assertEquals("The message URI is incorrect.", "file:/someuri", report.getValidationMessages()[0].getUri()); - assertEquals("The message has an incorrectly registred nested message.", 0, report.getNestedMessages().size()); - - // 2. Test that a nested message is added as a nested message. - ValidationMessageImpl message2 = new ValidationMessageImpl("message", 1, 2, IValidationMessage.SEV_ERROR, "file:/someuri2"); - ValidationInfo report2 = new ValidationInfo("file:/someuri"); - validator.convertMessage(message2, report2); - assertEquals("The report with the nested message does not have 1 message.", 1, report2.getValidationMessages().length); - assertEquals("The container message URI is incorrect.", "file:/someuri2", report2.getValidationMessages()[0].getUri()); - assertEquals("The container message does not have 1 nested message.", 1, report2.getValidationMessages()[0].getNestedMessages().size()); - assertEquals("The nested message URI is incorrect.", "file:/someuri2", ((ValidationMessage)report2.getValidationMessages()[0].getNestedMessages().get(0)).getUri()); - assertEquals("The nested message string is incorrect.", "message", ((ValidationMessage)report2.getValidationMessages()[0].getNestedMessages().get(0)).getMessage()); - assertEquals("The nested message line number is incorrect.", 1, ((ValidationMessage)report2.getValidationMessages()[0].getNestedMessages().get(0)).getLineNumber()); - assertEquals("The nested message column number is incorrect.", 2, ((ValidationMessage)report2.getValidationMessages()[0].getNestedMessages().get(0)).getColumnNumber()); - assertEquals("The nested message severity is incorrect.", ValidationMessage.SEV_NORMAL, ((ValidationMessage)report2.getValidationMessages()[0].getNestedMessages().get(0)).getSeverity()); - assertEquals("The message does not have a nested message.", 1, report2.getNestedMessages().size()); - } - - /** - * Test converting a WSDL validation report to a XML validation report. - * The contents of the messages should be included in the new report. - * 1. Test that a regular message is added as is. - * 2. Test that a nested message is added as a nested message. - */ - public void testConvertReportToXMLReport() - { - // 1. Test that a regular message is added as is. - ValidationInfoImpl wsdlreport = new ValidationInfoImpl("file:/someuri", new MessageGenerator(ResourceBundle.getBundle("org.eclipse.wst.wsdl.validation.internal.eclipse.validatewsdl"))); - wsdlreport.addError("message", 1, 2, "file:/someuri"); - ValidationReport report = validator.convertReportToXMLReport(wsdlreport); - assertEquals("The report does not have 1 message.", 1, report.getValidationMessages().length); - assertEquals("The message string is incorrect.", "message", report.getValidationMessages()[0].getMessage()); - assertEquals("The message line number is incorrect.", 1, report.getValidationMessages()[0].getLineNumber()); - assertEquals("The message column number is incorrect.", 2, report.getValidationMessages()[0].getColumnNumber()); - assertEquals("The message severity is incorrect.", ValidationMessage.SEV_NORMAL, report.getValidationMessages()[0].getSeverity()); - assertEquals("The message URI is incorrect.", "file:/someuri", report.getValidationMessages()[0].getUri()); - assertEquals("The message has an incorrectly registred nested message.", 0, report.getNestedMessages().size()); - - // 2. Test that a nested message is added as a nested message. - ValidationInfoImpl wsdlreport2 = new ValidationInfoImpl("file:/someuri", new MessageGenerator(ResourceBundle.getBundle("org.eclipse.wst.wsdl.validation.internal.eclipse.validatewsdl"))); - wsdlreport2.addError("message", 1, 2, "file:/someuri2"); - ValidationReport report2 = validator.convertReportToXMLReport(wsdlreport2); - assertEquals("The report does not have 1 message.", 1, report2.getValidationMessages().length); - assertEquals("The message URI is incorrect.", "file:/someuri2", report2.getValidationMessages()[0].getUri()); - assertEquals("The message does not have 1 nested message.", 1, report2.getValidationMessages()[0].getNestedMessages().size()); - assertEquals("The message URI is incorrect.", "file:/someuri2", ((ValidationMessage)report2.getValidationMessages()[0].getNestedMessages().get(0)).getUri()); - assertEquals("The message string is incorrect.", "message", ((ValidationMessage)report2.getValidationMessages()[0].getNestedMessages().get(0)).getMessage()); - assertEquals("The message line number is incorrect.", 1, ((ValidationMessage)report2.getValidationMessages()[0].getNestedMessages().get(0)).getLineNumber()); - assertEquals("The message column number is incorrect.", 2, ((ValidationMessage)report2.getValidationMessages()[0].getNestedMessages().get(0)).getColumnNumber()); - assertEquals("The message severity is incorrect.", ValidationMessage.SEV_NORMAL, ((ValidationMessage)report2.getValidationMessages()[0].getNestedMessages().get(0)).getSeverity()); - assertEquals("The message does not have a nested message.", 1, report2.getNestedMessages().size()); - } - -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/ValidatorWrapper.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/ValidatorWrapper.java deleted file mode 100644 index 2cad38269..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/ValidatorWrapper.java +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.eclipse; - -import java.util.HashMap; - -import org.apache.xerces.xni.grammars.XMLGrammarPool; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; -import org.eclipse.wst.wsdl.validation.internal.IValidationMessage; -import org.eclipse.wst.wsdl.validation.internal.IValidationReport; -import org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext; -import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo; -import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage; -import org.eclipse.wst.xml.core.internal.validation.core.ValidationReport; - -/** - * This class extends validator to expose the protected methods - * for testing. - */ -public class ValidatorWrapper extends Validator -{ - /* (non-Javadoc) - * @see org.eclipse.wst.xml.core.internal.validation.eclipse.Validator#addInfoToMessage(org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage, org.eclipse.wst.validation.internal.provisional.core.IMessage) - */ - public void addInfoToMessage(ValidationMessage validationMessage, IMessage message) - { - super.addInfoToMessage(validationMessage, message); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.xml.core.internal.validation.eclipse.Validator#setupValidation(org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext) - */ - public void setupValidation(NestedValidatorContext context) - { - super.setupValidation(context); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.eclipse.Validator#teardownValidation(org.eclipse.wst.xml.core.internal.validation.core.NestedValidatorContext) - */ - public void teardownValidation(NestedValidatorContext context) - { - super.teardownValidation(context); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.eclipse.Validator#convertMessage(org.eclipse.wst.wsdl.validation.internal.IValidationMessage, org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo) - */ - public void convertMessage(IValidationMessage message, ValidationInfo convertedReport) - { - super.convertMessage(message, convertedReport); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.eclipse.Validator#convertReportToXMLReport(org.eclipse.wst.wsdl.validation.internal.IValidationReport) - */ - public ValidationReport convertReportToXMLReport(IValidationReport report) - { - return super.convertReportToXMLReport(report); - } - - /** - * Get the XML grammar pool defined for the given context. - * - * @param context - * The context to use to retrieve the XML grammar pool. - * @return - * The XML grammar pool associated with the context or null if none is associated. - */ - public XMLGrammarPool getXMLGrammarPoolForContext(NestedValidatorContext context) - { - return (XMLGrammarPool)xmlGrammarPools.get(context); - } - - /** - * Get the XSD grammar pool defined for the given context. - * - * @param context - * The context to use to retrieve the XSD grammar pool. - * @return - * The XSD grammar pool associated with the context or null if none is associated. - */ - public XMLGrammarPool getXSDGrammarPoolForContext(NestedValidatorContext context) - { - return (XMLGrammarPool)xsdGrammarPools.get(context); - } - - /** - * Expose the XML grammar pools HashMap for testing. - * - * @return - * The XML grammar pools HashMap. - */ - public HashMap getXMLGrammarPoolsMap() - { - return xmlGrammarPools; - } - - /** - * Expose the XSD grammar pools HashMap for testing. - * - * @return - * The XSD grammar pools HashMap. - */ - public HashMap getXSDGrammarPoolsMap() - { - return xsdGrammarPools; - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidatorTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidatorTest.java deleted file mode 100644 index cd7b83ac8..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidatorTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.eclipse; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Test the Eclipse specific WSDL validator. - */ -public class WSDLValidatorTest extends TestCase -{ - /** - * Create a tests suite from this test class. - * - * @return A test suite containing this test class. - */ - public static Test suite() - { - return new TestSuite(WSDLValidatorTest.class); - } - - /** - * Test to ensure the URI resolver is not null in the Eclipse - * specific XML validator. - */ - public void testURIResolverIsRegistered() - { - WSDLValidatorWrapper validator = new WSDLValidatorWrapper(); - assertNotNull("The URI resolver is null.", validator.getURIResolver()); - } - -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidatorWrapper.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidatorWrapper.java deleted file mode 100644 index f24234085..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/WSDLValidatorWrapper.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.eclipse; - -import org.eclipse.wst.wsdl.validation.internal.resolver.URIResolver; - -/** - * Wrapper for the Eclipse WSDL validator class to allow for testing. - */ -public class WSDLValidatorWrapper extends WSDLValidator -{ - /** - * Constructor. - */ - public WSDLValidatorWrapper() - { - super(); - } - - /** - * Get the URI resolver registered on the WSDL validator. - * - * @return The URI resolver registered on the WSDL validator. - */ - public URIResolver getURIResolver() - { - return uriResolver; - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/validatewsdl.properties b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/validatewsdl.properties deleted file mode 100644 index 395651b03..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/eclipse/validatewsdl.properties +++ /dev/null @@ -1,2 +0,0 @@ -# Duplicate error message for testing -_REF_FILE_ERROR_MESSAGE = Referenced file contains errors ({0}).
\ No newline at end of file diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/resolver/URIResolverTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/resolver/URIResolverTest.java deleted file mode 100644 index 31dcb9325..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/resolver/URIResolverTest.java +++ /dev/null @@ -1,203 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.resolver; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * URIResolver tests. - */ -public class URIResolverTest extends TestCase -{ - private URIResolver uriResolver = null; - /** - * Create a tests suite from this test class. - * - * @return A test suite containing this test class. - */ - public static Test suite() - { - return new TestSuite(URIResolverTest.class); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception - { - uriResolver = new URIResolver(); - } - - public void testNormalizeAbsoluteFile() - { - // System id is absolute and should not be modified. - String baseLocation = "file:/c:/somepath/somepath/file.txt"; - String systemId = "file:/c:/somepath/myfile.txt"; - assertEquals("systemId is absolute and should not be modified.", systemId, uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - - } - - public void testNormalizeRelativeFile() - { - // System id is relative - String baseLocation = "file:/c:/somepath/somepath/file.txt"; - String systemId = "myfile.txt"; - assertEquals("systemId is simple relative and is not modified correctly.", "file:/c:/somepath/somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileStartsWithDotDot() - { - // System id is relative with ../ - String baseLocation = "file:/c:/somepath/somepath/file.txt"; - String systemId = "../myfile.txt"; - assertEquals("systemId is relative with ../ and is not modified correctly.", "file:/c:/somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileStartsWithDotDotTwice() - { - // System id is relative with ../../ - String baseLocation = "file:/c:/somepath/somepath/file.txt"; - String systemId = "../../myfile.txt"; - assertEquals("systemId is relative with ../../ and is not modified correctly.", "file:/c:/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileStartsWithDot() - { - // System id is relative with ./ - String baseLocation = "file:/c:/somepath/somepath/file.txt"; - String systemId = "./myfile.txt"; - assertEquals("systemId is relative with ./ and is not modified correctly.", "file:/c:/somepath/somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileStartsWithDotTwice() - { - // System id is relative with ././ - String baseLocation = "file:/c:/somepath/somepath/file.txt"; - String systemId = "././myfile.txt"; - assertEquals("systemId is relative with ././ and is not modified correctly.", "file:/c:/somepath/somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileStartsWithSlash() - { - // System id is relative beginning with / - String baseLocation = "file:/c:/somepath/somepath/file.txt"; - String systemId = "/myfile.txt"; - assertEquals("systemId is relative beginning with / and is not modified correctly.", "file:/c:/somepath/somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileDotDotInMiddle() - { - // System id contains ../ in the middle - String baseLocation = "file:/c:/somepath/somepath/file.txt"; - String systemId = "somepath/../myfile.txt"; - assertEquals("systemId is relative and contains ../ in the middle and is not modified correctly.", "file:/c:/somepath/somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileFotInMiddle() - { - // System id contains ./ in the middle - String baseLocation = "file:/c:/somepath/somepath/file.txt"; - String systemId = "somepath/./myfile.txt"; - assertEquals("systemId is relative and contains ./ in the middle and is not modified correctly.", "file:/c:/somepath/somepath/somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormlizeRelativeFileDotDotInMiddleOfBase() - { - // Base location contains ../ in the middle - String baseLocation = "file:/c:/somepath/../somepath/file.txt"; - String systemId = "myfile.txt"; - assertEquals("baseLocation contains ../ in the middle and is not modified correctly.", "file:/c:/somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileDotInMiddleOfBase() - { - // Base location contains ./ in the middle - String baseLocation = "file:/c:/somepath/./somepath/file.txt"; - String systemId = "myfile.txt"; - assertEquals("baseLocation contains ./ in the middle and is not modified correctly.", "file:/c:/somepath/somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileBaseStartsWithSlashDotDot() - { - // Base location starts with /../ - String baseLocation = "file:/../somepath/file.txt"; - String systemId = "myfile.txt"; - assertEquals("baseLocation starts with ../ and is not modified correctly.", "file:/../somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileBaseStartsWithSlashDot() - { - // Base location starts with /./ - String baseLocation = "file:/./somepath/file.txt"; - String systemId = "myfile.txt"; - assertEquals("baseLocation starts with ./ and is not modified correctly.", "file:/somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileBaseStartsWithDotDot() - { - // Base location starts with ../ - String baseLocation = "file:../somepath/file.txt"; - String systemId = "myfile.txt"; - assertEquals("baseLocation starts with ../ and is not modified correctly.", "file:../somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileBaseStartsWithDot() - { - // Base location starts with ./ - String baseLocation = "file:./somepath/file.txt"; - String systemId = "myfile.txt"; - assertEquals("baseLocation starts with ./ and is not modified correctly.", "file:somepath/myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileSomedirDotDot() - { - // System id contains somedir../ in the middle - String baseLocation = "file:/somepath/file.txt"; - String systemId = "somedir../myfile.txt"; - assertEquals("systemId has somedir../ and is not modified correctly.", "file:/somepath/somedir../myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeRelativeFileSomedirDot() - { - // System id contains somedir./ in the middle - String baseLocation = "file:/somepath/file.txt"; - String systemId = "somedir./myfile.txt"; - assertEquals("systemId has somedir./ and is not modified correctly.", "file:/somepath/somedir./myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeNullSystemId() - { - // System id is null - String baseLocation = "file:/somepath/file.txt"; - String systemId = null; - assertEquals("systemId is null.", null, uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeNullBaseLocation() - { - // Base location is null - String baseLocation = null; - String systemId = "somedir./myfile.txt"; - assertEquals("systemId is null.", null, uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - public void testNormalizeSystemIdAbsoluteNullBaseLocation() - { - // Base location is null - String baseLocation = "null"; - String systemId = "file:/somedir./myfile.txt"; - assertEquals("systemId is null.", "file:/somedir./myfile.txt", uriResolver.resolve(baseLocation, null, systemId).getLogicalLocation()); - } - - -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/AntLoggerTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/AntLoggerTest.java deleted file mode 100644 index 4bbc75316..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/AntLoggerTest.java +++ /dev/null @@ -1,187 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.ui.ant; - -import junit.framework.TestCase; - -import org.eclipse.wst.wsdl.validation.internal.logging.ILogger; - -/** - * Tests for the AntLogger. - */ -public class AntLoggerTest extends TestCase -{ - AntLoggerTestTask task = null; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception - { - task = new AntLoggerTestTask(); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception - { - task = null; - } - - /** - * Test that the log method: - * 1. logs errors correctly. - * 2. records the message correctly. - * 3. records the throwable correctly. - */ - public void testLogErrorWithThrowable() - { - AntLogger logger = new AntLogger(task); - logger.log("MESSAGE", ILogger.SEV_ERROR, new Throwable("THROWABLE")); - - assertTrue("Warnings were reported when only errors should have been reported.", task.getWarnings().isEmpty()); - assertTrue("Infos were reported when only errors should have been reported.", task.getInfos().isEmpty()); - assertTrue("Verboses were reported when only errors should have been reported.", task.getVerboses().isEmpty()); - assertEquals("2 errors were not reported.", 2, task.getErrors().size()); - assertEquals("The message was not MESSAGE.", "MESSAGE", task.getErrors().get(0)); - assertEquals("The throwable was not THROWABLE.", "java.lang.Throwable: THROWABLE", task.getErrors().get(1)); - } - - /** - * Test that the log method: - * 1. logs warnings correctly. - * 2. records the message correctly. - * 3. records the throwable correctly. - */ - public void testLogWarningWithThrowable() - { - AntLogger logger = new AntLogger(task); - logger.log("MESSAGE", ILogger.SEV_WARNING, new Throwable("THROWABLE")); - - assertTrue("Errors were reported when only warnings should have been reported.", task.getErrors().isEmpty()); - assertTrue("Infos were reported when only warnings should have been reported.", task.getInfos().isEmpty()); - assertTrue("Verboses were reported when only errors should have been reported.", task.getVerboses().isEmpty()); - assertEquals("2 warnings were not reported.", 2, task.getWarnings().size()); - assertEquals("The message was not MESSAGE.", "MESSAGE", task.getWarnings().get(0)); - assertEquals("The throwable was not THROWABLE.", "java.lang.Throwable: THROWABLE", task.getWarnings().get(1)); - } - - /** - * Test that the log method: - * 1. logs infos correctly. - * 2. records the message correctly. - * 3. records the throwable correctly. - */ - public void testLogInfoWithThrowable() - { - AntLogger logger = new AntLogger(task); - logger.log("MESSAGE", ILogger.SEV_INFO, new Throwable("THROWABLE")); - - assertTrue("Warnings were reported when only infos should have been reported.", task.getWarnings().isEmpty()); - assertTrue("Errors were reported when only infos should have been reported.", task.getErrors().isEmpty()); - assertTrue("Verboses were reported when only errors should have been reported.", task.getVerboses().isEmpty()); - assertEquals("2 infos were not reported.", 2, task.getInfos().size()); - assertEquals("The message was not MESSAGE.", "MESSAGE", task.getInfos().get(0)); - assertEquals("The throwable was not THROWABLE.", "java.lang.Throwable: THROWABLE", task.getInfos().get(1)); - } - - /** - * Test that the log method: - * 1. logs verboses correctly. - * 2. records the message correctly. - * 3. records the throwable correctly. - */ - public void testLogVerboseWithThrowable() - { - AntLogger logger = new AntLogger(task); - logger.log("MESSAGE", ILogger.SEV_VERBOSE, new Throwable("THROWABLE")); - - assertTrue("Warnings were reported when only verboses should have been reported.", task.getWarnings().isEmpty()); - assertTrue("Errors were reported when only verboses should have been reported.", task.getErrors().isEmpty()); - assertTrue("Infos were reported when only verboses should have been reported.", task.getInfos().isEmpty()); - assertEquals("2 verboses were not reported.", 2, task.getVerboses().size()); - assertEquals("The message was not MESSAGE.", "MESSAGE", task.getVerboses().get(0)); - assertEquals("The throwable was not THROWABLE.", "java.lang.Throwable: THROWABLE", task.getVerboses().get(1)); - } - - /** - * Test that the log method: - * 1. logs errors correctly. - * 2. records the message correctly. - * 3. records the throwable correctly. - */ - public void testLogErrorWithoutThrowable() - { - AntLogger logger = new AntLogger(task); - logger.log("MESSAGE", ILogger.SEV_ERROR); - - assertTrue("Warnings were reported when only errors should have been reported.", task.getWarnings().isEmpty()); - assertTrue("Infos were reported when only errors should have been reported.", task.getInfos().isEmpty()); - assertTrue("Verboses were reported when only errors should have been reported.", task.getVerboses().isEmpty()); - assertEquals("1 error was not reported.", 1, task.getErrors().size()); - assertEquals("The message was not MESSAGE.", "MESSAGE", task.getErrors().get(0)); - } - - /** - * Test that the log method: - * 1. logs warnings correctly. - * 2. records the message correctly. - * 3. records the throwable correctly. - */ - public void testLogWarningWithoutThrowable() - { - AntLogger logger = new AntLogger(task); - logger.log("MESSAGE", ILogger.SEV_WARNING); - - assertTrue("Errors were reported when only warnings should have been reported.", task.getErrors().isEmpty()); - assertTrue("Infos were reported when only warnings should have been reported.", task.getInfos().isEmpty()); - assertTrue("Verboses were reported when only errors should have been reported.", task.getVerboses().isEmpty()); - assertEquals("1 error was not reported.", 1, task.getWarnings().size()); - assertEquals("The message was not MESSAGE.", "MESSAGE", task.getWarnings().get(0)); - } - - /** - * Test that the log method: - * 1. logs infos correctly. - * 2. records the message correctly. - * 3. records the throwable correctly. - */ - public void testLogInfoWithoutThrowable() - { - AntLogger logger = new AntLogger(task); - logger.log("MESSAGE", ILogger.SEV_INFO); - - assertTrue("Warnings were reported when only infos should have been reported.", task.getWarnings().isEmpty()); - assertTrue("Errors were reported when only infos should have been reported.", task.getErrors().isEmpty()); - assertTrue("Verboses were reported when only errors should have been reported.", task.getVerboses().isEmpty()); - assertEquals("1 info was not reported.", 1, task.getInfos().size()); - assertEquals("The message was not MESSAGE.", "MESSAGE", task.getInfos().get(0)); - } - - /** - * Test that the log method: - * 1. logs verboses correctly. - * 2. records the message correctly. - * 3. records the throwable correctly. - */ - public void testLogVerboseWithoutThrowable() - { - AntLogger logger = new AntLogger(task); - logger.log("MESSAGE", ILogger.SEV_VERBOSE); - - assertTrue("Warnings were reported when only verboses should have been reported.", task.getWarnings().isEmpty()); - assertTrue("Errors were reported when only verboses should have been reported.", task.getErrors().isEmpty()); - assertTrue("Infos were reported when only verboses should have been reported.", task.getInfos().isEmpty()); - assertEquals("1 verbose was not reported.", 1, task.getVerboses().size()); - assertEquals("The message was not MESSAGE.", "MESSAGE", task.getVerboses().get(0)); - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/AntLoggerTestTask.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/AntLoggerTestTask.java deleted file mode 100644 index 7c2247a53..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/AntLoggerTestTask.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.ui.ant; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tools.ant.Project; -import org.apache.tools.ant.Task; - -/** - * A dummy task that will allow testing of the and logger. - */ -public class AntLoggerTestTask extends Task -{ - protected List errors = new ArrayList(); - protected List warnings = new ArrayList(); - protected List infos = new ArrayList(); - protected List verboses = new ArrayList(); - - /* (non-Javadoc) - * @see org.apache.tools.ant.Task#log(java.lang.String, int) - */ - public void log(String msg, int msgLevel) - { - if(msgLevel == Project.MSG_ERR) - { - errors.add(msg); - } - else if(msgLevel == Project.MSG_WARN) - { - warnings.add(msg); - } - else if(msgLevel == Project.MSG_INFO) - { - infos.add(msg); - } - else if(msgLevel == Project.MSG_VERBOSE) - { - verboses.add(msg); - } - } - - /* (non-Javadoc) - * @see org.apache.tools.ant.Task#log(java.lang.String) - */ - public void log(String msg) - { - log(msg, Project.MSG_INFO); - } - - /** - * Get the errors that were logged. - * - * @return - * The errors that were logged. - */ - public List getErrors() - { - return errors; - } - - /** - * Get the warnings that were logged. - * - * @return - * The warnings that were logged. - */ - public List getWarnings() - { - return warnings; - } - - /** - * Get the infos that were logged. - * - * @return - * The infos that were logged. - */ - public List getInfos() - { - return infos; - } - - /** - * Get the verboses that were logged. - * - * @return - * The verboses that were logged. - */ - public List getVerboses() - { - return verboses; - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/WSDLValidateTask.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/WSDLValidateTask.java deleted file mode 100644 index 907875d96..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/WSDLValidateTask.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.ui.ant; - -import java.util.List; - -/** - * This class is used to expose functionality from the WSDLValidate class for testing. - */ -public class WSDLValidateTask extends WSDLValidate -{ - - /** - * @see org.eclipse.wst.wsdl.validation.internal.ui.ant.WSDLValidate#getFileList() - */ - public List getFileList() - { - return super.getFileList(); - } - -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/WSDLValidateTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/WSDLValidateTest.java deleted file mode 100644 index 8b31f2d5a..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/ant/WSDLValidateTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.ui.ant; - -import java.io.File; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.apache.tools.ant.Project; -import org.apache.tools.ant.types.FileSet; -import org.apache.tools.ant.types.selectors.FilenameSelector; -import org.eclipse.wst.wsdl.validation.tests.internal.BaseTestCase; - -/** - * WSDLValidate ant task tests. - */ -public class WSDLValidateTest extends BaseTestCase -{ - private String BASE_DIR;; - private Project project; - - /** - * Create a tests suite from this test class. - * - * @return A test suite containing this test class. - */ - public static Test suite() - { - return new TestSuite(WSDLValidateTest.class); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception - { - super.setUp(); - try - { - BASE_DIR = PLUGIN_ABSOLUTE_PATH; - BASE_DIR = BASE_DIR.replace('/', File.separatorChar); - if(BASE_DIR.startsWith("\\")) - { - BASE_DIR = BASE_DIR.substring(1); - } - } - catch(Exception e) - { - - } - project = new Project(); - project.setBaseDir(new File(BASE_DIR)); - } - - /** - * Test that a single file with a relative location is resolved properly. - */ - public void testRelativeSingleFileLocation() - { - String fileLoc = "file.wsdl"; - String resolvedLocation = ("file:///" + BASE_DIR + fileLoc).replace('\\','/'); - WSDLValidateTask wsdlValidateTask = new WSDLValidateTask(); - wsdlValidateTask.setProject(project); - wsdlValidateTask.setFile(fileLoc); - List fileList = wsdlValidateTask.getFileList(); - assertEquals("The file list does not contain only one file.", 1, fileList.size()); - // The file locations are converted to lower case to avoid drive letter case differences on windows. ie. C vs c. - assertEquals("The file location '" + fileList.get(0) + "' is not correctly resolved to the base location.", resolvedLocation.toLowerCase(), ((String)fileList.get(0)).toLowerCase()); - - } - - /** - * Test that a single file with an absolute location is resolved properly. - */ - public void testAbsoluteSingleFileLocation() - { - String fileLoc = BASE_DIR + "file.wsdl"; - String resolvedLocation = (FILE_PROTOCOL + fileLoc).replace('\\','/'); - WSDLValidateTask wsdlValidateTask = new WSDLValidateTask(); - wsdlValidateTask.setProject(project); - wsdlValidateTask.setFile(fileLoc); - List fileList = wsdlValidateTask.getFileList(); - assertEquals("The file list does not contain only one file.", 1, fileList.size()); - assertEquals("The file location '" + fileLoc + "' is modified.", resolvedLocation.toLowerCase(), ((String)fileList.get(0)).toLowerCase()); - - } - - /** - * Test that a single file with an absolute, remote location is resolved properly. - */ - public void testAbsoluteSingleFileRemoteLocation() - { - String resolvedLocation = "http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-07/Catalog.wsdl"; - String fileLoc = "http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-07/Catalog.wsdl"; - WSDLValidateTask wsdlValidateTask = new WSDLValidateTask(); - wsdlValidateTask.setProject(project); - wsdlValidateTask.setFile(fileLoc); - List fileList = wsdlValidateTask.getFileList(); - assertEquals("The file list does not contain only one file.", 1, fileList.size()); - assertEquals("The file location '" + fileLoc + "' is modified.", resolvedLocation.toLowerCase(), ((String)fileList.get(0)).toLowerCase()); - - } - -/** - * Test that a single file in a fileset with a relative location is resolved properly - * when no directory is specified. - */ - public void testRelativeSingleFileInFilesetNoDirSpecified() - { - String fileLoc = "Empty.wsdl"; - String base_dir = BASE_DIR + SAMPLES_DIR + "WSDL" + File.separator + "SelfContained"; - String resolvedLocation = ("file:///" + base_dir + "/" + fileLoc).replace('\\','/'); - base_dir = base_dir.replace('/', File.separatorChar); - - WSDLValidateTask wsdlValidateTask = new WSDLValidateTask(); - wsdlValidateTask.setProject(project); - - FileSet fileset = wsdlValidateTask.createFileset(); - fileset.setProject(project); - fileset.setDir(new File(base_dir)); - - FilenameSelector filenameSelector = new FilenameSelector(); - filenameSelector.setName(fileLoc); - fileset.addFilename(filenameSelector); - //fileset.setFile(new File(fileLoc)); - - List fileList = wsdlValidateTask.getFileList(); - assertEquals("The file list does not contain only one file.", 1, fileList.size()); - // The file locations are converted to lower case to avoid drive letter case differences on windows. ie. C vs c. - assertEquals("The file location '" + fileList.get(0) + "' is not correctly resolved to the base location.", resolvedLocation.toLowerCase(), ((String)fileList.get(0)).toLowerCase()); - - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateTest.java deleted file mode 100644 index b6458f203..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateTest.java +++ /dev/null @@ -1,221 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.ui.text; - -import java.text.MessageFormat; -import java.util.List; - -import org.eclipse.wst.wsdl.validation.internal.IValidationMessage; -import org.eclipse.wst.wsdl.validation.internal.IValidationReport; -import org.eclipse.wst.wsdl.validation.internal.ValidationMessageImpl; -import org.eclipse.wst.wsdl.validation.internal.ValidatorRegistry; -import org.eclipse.wst.wsdl.validation.internal.logging.ILogger; -import org.eclipse.wst.wsdl.validation.internal.logging.LoggerFactory; -import org.eclipse.wst.wsdl.validation.internal.logging.StandardLogger; -import org.eclipse.wst.wsdl.validation.tests.internal.BaseTestCase; - -public class WSDLValidateTest extends BaseTestCase -{ - WSDLValidateWrapper validate = null; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception - { - super.setUp(); - validate = new WSDLValidateWrapper(); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception - { - validate = null; - super.tearDown(); - } - - /** - * Test the validateFile method. - * 1. A valid file should report back that it's valid. - * 2. An invalid file should report back that it's invalid. - * 3. A file that can't be found should succeed and report that it's invalid. - */ - public void testValidateFile() - { - String validFile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + "Paths/AngleHat^InPath/AngleHatInPathValid.wsdl"; - if(PLUGIN_ABSOLUTE_PATH.startsWith("/")) - { - validFile = "file://" + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + "Paths/AngleHat^InPath/AngleHatInPathValid.wsdl"; - } - String invalidFile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + "Paths/AngleHat^InPath/AngleHatInPathInvalid.wsdl"; - if(PLUGIN_ABSOLUTE_PATH.startsWith("/")) - { - invalidFile = "file://" + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + "Paths/AngleHat^InPath/AngleHatInPathInvalid.wsdl"; - } - String nonexistantFile = "nonexistantfile.wsdl"; - // 1. A valid file should report back that it's valid. - IValidationReport report = validate.validateFile(validFile); - assertFalse("Errors were reported for a valid file.", report.hasErrors()); - - // 2. An invalid file should report back that it's invalid. - IValidationReport report2 = validate.validateFile(invalidFile); - assertTrue("Errors were not reported for an invalid file.", report2.hasErrors()); - - // 3. A file that can't be found should succeed and report that it's invalid. - IValidationReport report3 = validate.validateFile(nonexistantFile); - assertTrue("Errors were not reported for a nonexistant file.", report3.hasErrors()); - } - - /** - * Test the validate method. - * 1. The method should succeed with one file specified. - * 2. The method should succeed and validate 2 files when 2 are specified. - * 3. The method should output verbose information for valid files when verbose is enabled. - */ - public void testValidate() - { - String validFile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + "Paths/AngleHat^InPath/AngleHatInPathValid.wsdl"; - if(PLUGIN_ABSOLUTE_PATH.startsWith("/")) - { - validFile = "file://" + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + "Paths/AngleHat^InPath/AngleHatInPathValid.wsdl"; - } - String validFile2 = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + "Paths/AngleHatInFilename/AngleHat^InFilenameValid.wsdl"; - if(PLUGIN_ABSOLUTE_PATH.startsWith("/")) - { - validFile2 = "file://" + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + "Paths/AngleHatInFilename/AngleHat^InFilenameValid.wsdl"; - } - ILogger currentLogger = LoggerFactory.getInstance().getLogger(); - WSDLValidateTestLogger logger = new WSDLValidateTestLogger(); - LoggerFactory.getInstance().setLogger(logger); - - // 1. The method should succeed with one file specified. - validate.getWSDLFiles().add(validFile); - validate.validate(); - assertEquals("Validating a single valid file failed.", MessageFormat.format(WSDLValidateTextUIMessages._UI_VALIDATION_SUMMARY, new Object[]{new Integer(1), new Integer(0)}), logger.getInfos().get(0)); - validate.getWSDLFiles().clear(); - logger.getInfos().clear(); - - // 2. The method should succeed and validate 2 files when 2 are specified. - validate.getWSDLFiles().add(validFile); - validate.getWSDLFiles().add(validFile2); - validate.validate(); - assertEquals("Validating two valid files failed.", MessageFormat.format(WSDLValidateTextUIMessages._UI_VALIDATION_SUMMARY, new Object[]{new Integer(2), new Integer(0)}), logger.getInfos().get(0)); - validate.getWSDLFiles().clear(); - logger.getInfos().clear(); - - // 3. The method should output verbose information for valid files when verbose is enabled. - validate.setVerbose(true); - validate.getWSDLFiles().add(validFile); - validate.validate(); - assertEquals("Validating a single valid file failed.", MessageFormat.format(WSDLValidateTextUIMessages._UI_FILE_VALID, new Object[]{validFile}), logger.getVerboses().get(0)); - assertEquals("Validating a single valid file failed.", MessageFormat.format(WSDLValidateTextUIMessages._UI_VALIDATION_SUMMARY, new Object[]{new Integer(1), new Integer(0)}), logger.getInfos().get(0)); - validate.getWSDLFiles().clear(); - validate.setVerbose(false); - logger.getInfos().clear(); - logger.getVerboses().clear(); - - LoggerFactory.getInstance().setLogger(currentLogger); - } - - /** - * Test the getMessages method. - * 1. The method should return a properly formatted string for a single error. - * 2. The method should return a properly formatted string for a single warning. - * 3. The method should return a properly fomatted string for 2 messages. - */ - public void testGetMessages() - { - IValidationMessage errorMessage = new ValidationMessageImpl("MESSAGE", 1, 2, IValidationMessage.SEV_ERROR, "URI"); - IValidationMessage warningMessage = new ValidationMessageImpl("MESSAGE", 1, 2, IValidationMessage.SEV_WARNING, "URI"); - // 1. The method should return a properly formatted string for a single error. - IValidationMessage[] errorMessages = new IValidationMessage[]{errorMessage}; - String message = validate.getMessages(errorMessages); - assertEquals("The error message was not correct.", WSDLValidateTextUIMessages._UI_ERROR_MARKER + " 1:2 MESSAGE", message); - - // 2. The method should return a properly formatted string for a single warning. - IValidationMessage[] warningMessages = new IValidationMessage[]{warningMessage}; - String message2 = validate.getMessages(warningMessages); - assertEquals("The warning message was not correct.", WSDLValidateTextUIMessages._UI_WARNING_MARKER + " 1:2 MESSAGE", message2); - - // 3. The method should return a properly fomatted string for 2 messages. - IValidationMessage[] twoMessages = new IValidationMessage[]{errorMessage, warningMessage}; - String message3 = validate.getMessages(twoMessages); - assertEquals("Two messages was not correct.", WSDLValidateTextUIMessages._UI_ERROR_MARKER + " 1:2 MESSAGE\n" + WSDLValidateTextUIMessages._UI_WARNING_MARKER + " 1:2 MESSAGE", message3); - } - - /** - * Test the parseArguments method. - * 1. -wsdl11v parsing succeeds and registers the validator with the WSDL validator. - * 2. -extv parsing succeeds and registers the validator with the WSDL validator. - * 3. Extension validator parsing where a param is omitted succeeds. - * 4. -logger parsing succeeds and sets the correct logger. - * 5. -D (property) parsing succeeds sets the property on the configuration. - * 6. -v, -verbose parsing succeeds and sets verbose correctly. - * 7. The specified WSDL files are read properly. - * - * Not currently tested: - * -schema - * -schemaDir - * -uriresolver - */ - public void testParseArguments() - { - // 1. -wsdl11v parsing succeeds and registers the validator with the WSDL validator. - String[] args1 = new String[]{WSDLValidateWrapper.PARAM_WSDL11VAL, "http://wsdl11validator", "org.eclipse.wst.wsdl.validation.internal.wsdl11.http.HTTPValidator"}; - validate.parseArguments(args1); - assertTrue("The WSDL 1.1 validator was not registered.", org.eclipse.wst.wsdl.validation.internal.wsdl11.ValidatorRegistry.getInstance().hasRegisteredValidator("http://wsdl11validator")); - - // 2. -extv parsing succeeds and registers the validator with the WSDL validator. - String[] args2 = new String[]{WSDLValidateWrapper.PARAM_EXTVAL, "http://extvalidator", "validatorclass"}; - validate.parseArguments(args2); - assertTrue("The WSDL extension validator was not registered.", ValidatorRegistry.getInstance().hasRegisteredValidator("http://extvalidator", ValidatorRegistry.EXT_VALIDATOR)); - - // 3. Extension validator parsing where a param is omitted succeeds. - String[] args3 = new String[]{WSDLValidateWrapper.PARAM_EXTVAL, "http://extvalidator2", "-dummyparam"}; - validate.parseArguments(args3); - assertFalse("The WSDL extension validator was registered without enough information.", ValidatorRegistry.getInstance().hasRegisteredValidator("http://extvalidator2", ValidatorRegistry.EXT_VALIDATOR)); - - // 4. -logger parsing succeeds and sets the correct logger. - ILogger currentLogger = LoggerFactory.getInstance().getLogger(); - String[] args4 = new String[]{WSDLValidateWrapper.PARAM_LOGGER, "org.eclipse.wst.wsdl.validation.internal.logging.StandardLogger"}; - validate.parseArguments(args4); - assertTrue("The registered logger is not a StandardLogger", LoggerFactory.getInstance().getLogger() instanceof StandardLogger); - assertFalse("The registered logger is the same as originally registered.", currentLogger.equals(LoggerFactory.getInstance().getLogger())); - LoggerFactory.getInstance().setLogger(currentLogger); - - // 5. -D (property) parsing succeeds sets the property on the configuration. - String[] args5 = new String[]{WSDLValidateWrapper.PARAM_PROPERTY + "SAMPLENAME=SAMPLEVALUE"}; - validate.parseArguments(args5); - assertEquals("The parameter was not set correctly.", "SAMPLEVALUE", validate.getConfiguration().getProperty("SAMPLENAME")); - - // 6. -v, -verbose parsing succeeds and sets verbose correctly. - String[] args6 = new String[]{WSDLValidateWrapper.PARAM_VERBOSE}; - validate.setVerbose(false); - validate.parseArguments(args6); - assertTrue("Verbose is not set to true.", validate.isVerbose()); - - String[] args6a = new String[]{WSDLValidateWrapper.PARAM_VERBOSE_SHORT}; - validate.setVerbose(false); - validate.parseArguments(args6a); - assertTrue("Verbose is not set to true.", validate.isVerbose()); - - // 7. The specified WSDL files are read properly. - String[] args7 = new String[]{"filename1.wsdl", "folder/filename2.wsdl", "folder\filename3.wsdl"}; - validate.parseArguments(args7); - List wsdlFiles = validate.getWSDLFiles(); - assertEquals("There were not 3 WSDL files listed to validate.", 3, wsdlFiles.size()); - assertTrue("The WSDL file list did not include filename1.wsdl", wsdlFiles.contains("filename1.wsdl")); - assertTrue("The WSDL file list did not include folder/filename2.wsdl", wsdlFiles.contains("folder/filename2.wsdl")); - assertTrue("The WSDL file list did not include folder\filename3.wsdl", wsdlFiles.contains("folder\filename3.wsdl")); - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateTestLogger.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateTestLogger.java deleted file mode 100644 index 1352a4baa..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateTestLogger.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.ui.text; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.wst.wsdl.validation.internal.logging.ILogger; - -/** - * A helper class for testing that allows access to the messages logged. - */ -public class WSDLValidateTestLogger implements ILogger { - - protected List errors = new ArrayList(); - protected List warnings = new ArrayList(); - protected List infos = new ArrayList(); - protected List verboses = new ArrayList(); - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.logging.ILogger#log(java.lang.String, int) - */ - public void log(String message, int severity) - { - if(severity == ILogger.SEV_ERROR) - { - errors.add(message); - } - else if(severity == ILogger.SEV_WARNING) - { - warnings.add(message); - } - else if(severity == ILogger.SEV_INFO) - { - infos.add(message); - } - else if(severity == ILogger.SEV_VERBOSE) - { - verboses.add(message); - } - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.logging.ILogger#log(java.lang.String, int, java.lang.Throwable) - */ - public void log(String message, int severity, Throwable throwable) - { - log(message, severity); - log(throwable.toString(), severity); - } - - /** - * Get the error list. - * - * @return - * The error list. - */ - public List getErrors() - { - return errors; - } - - /** - * Get the warning list. - * - * @return - * The warning list. - */ - public List getWarnings() - { - return warnings; - } - - /** - * Get the info list. - * - * @return - * The info list. - */ - public List getInfos() - { - return infos; - } - - /** - * Get the verbose list. - * - * @return - * The verbose list. - */ - public List getVerboses() - { - return verboses; - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateWrapper.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateWrapper.java deleted file mode 100644 index 80407bd5e..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/ui/text/WSDLValidateWrapper.java +++ /dev/null @@ -1,113 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.ui.text; - -import java.util.List; - -import org.eclipse.wst.wsdl.validation.internal.IValidationMessage; -import org.eclipse.wst.wsdl.validation.internal.IValidationReport; -import org.eclipse.wst.wsdl.validation.internal.WSDLValidationConfiguration; -import org.eclipse.wst.wsdl.validation.internal.WSDLValidator; - -/** - * A wrapper class of WSDLValidate that exposes internals for testing. - */ -public class WSDLValidateWrapper extends WSDLValidate -{ - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.ui.text.WSDLValidate#getMessages(org.eclipse.wst.wsdl.validation.internal.IValidationMessage[]) - */ - public String getMessages(IValidationMessage[] messages) - { - return super.getMessages(messages); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.ui.text.WSDLValidate#parseArguments(java.lang.String[]) - */ - public void parseArguments(String[] args) - { - super.parseArguments(args); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.ui.text.WSDLValidate#validate() - */ - public void validate() - { - super.validate(); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.ui.text.WSDLValidate#validateFile(java.lang.String) - */ - public IValidationReport validateFile(String filename) - { - return super.validateFile(filename); - } - - /** - * Get the internal WSDL validator. - * - * @return - * The internal WSDL validator. - */ - public WSDLValidator getWSDLValidator() - { - return wsdlValidator; - } - - /** - * Get the WSDL validation configuration. - * - * @return - * The WSDL validation configuration. - */ - public WSDLValidationConfiguration getConfiguration() - { - return configuration; - } - - /** - * Get the list of WSDL files to validate. - * - * @return - * The list of WSDL files to validate. - */ - public List getWSDLFiles() - { - return wsdlFiles; - } - - /** - * Returns true if verbose is on, false otherwise. - * - * @return - * True if verbose is on, false otherwise. - */ - public boolean isVerbose() - { - return verbose; - } - - /** - * Set whether reporting should be done in a verbose way. - * - * @param verbose - * If true reporting will be done in a verbose way, otherwise it will not. - */ - public void setVerbose(boolean verbose) - { - this.verbose = verbose; - } - -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/xsd/InlineSchemaGeneratorTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/xsd/InlineSchemaGeneratorTest.java deleted file mode 100644 index acacb168a..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/xsd/InlineSchemaGeneratorTest.java +++ /dev/null @@ -1,222 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd; - -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.apache.xerces.dom.DocumentImpl; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -import com.ibm.wsdl.Constants; - -/** - * Tests for org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGenerator. - * - */ -public class InlineSchemaGeneratorTest extends TestCase -{ - private InlineSchemaGeneratorWrapper generator; - - /** - * Create a tests suite from this test class. - * - * @return A test suite containing this test class. - */ - public static Test suite() - { - return new TestSuite(InlineSchemaGeneratorTest.class); - } - - /** - * JUnit setup method. - */ - public void setUp() - { - generator = new InlineSchemaGeneratorWrapper(); - } - - /** - * Test that checkSOAPEncodingRequired method. - */ - public void testCheckSOAPEncodingRequired() - { - // Test empty list. - assertFalse("The method does not return false when given an empty list.", generator.checkSOAPEncodingRequired(new ArrayList())); - - // Test that checkSOAPEncodingRequired returns false - // when given a list without the SOAP encoding namespace. - List list = new ArrayList(); - list.add("http://notsoapencodingnamespace"); - assertFalse("The method does not return false when given a list without the SOAP envelope namespace.", generator.checkSOAPEncodingRequired(list)); - - // Test that checkSOAPEncodingRequired returns true - // when given a list with the SOAP encoding namespace. - List list2 = new ArrayList(); - list2.add(InlineSchemaGeneratorWrapper.SOAP_ENCODING_URI); - assertTrue("The method does not return true when given a list with the SOAP encoding namespace.", generator.checkSOAPEncodingRequired(list2)); - } - - /** - * TODO: Implement tests for the CreateXSDStringRecursively method. - */ - public void todoCreateXSDStringRecursively() - { - } - - /** - * TODO: Implement tests for the GetImportNamespace method. - */ - public void todoGetImportNamespaces() - { - } - - /** - * Test that this method returns the correct namespace - * resolver. - */ - public void testGetNSResolver() - { - Document doc = new DocumentImpl(); - Element rootElem = doc.createElementNS(Constants.NS_URI_XSD_2001, "schema"); - - // Check that the resolver is empty. - Hashtable resolver = generator.getNSResolver(rootElem); - assertTrue("The resolver is not empty.", resolver.isEmpty()); - - // Check the resolver contains one value. - rootElem.setAttribute("xmlns", Constants.NS_URI_XSD_2001); - resolver = generator.getNSResolver(rootElem); - assertTrue("The resolver does not contain the empty namespace.", resolver.containsKey("")); - assertEquals("The resolver does not contain the correct value for the empty namespace.", Constants.NS_URI_XSD_2001, resolver.get("")); - - // Check the resolver contains two values. - rootElem.setAttribute("xmlns:other", "http://othernamespace"); - resolver = generator.getNSResolver(rootElem); - assertTrue("The resolver does not contain the other namespace.", resolver.containsKey("other")); - assertEquals("The resolver does not contain the correct value for the other namespace.", "http://othernamespace", resolver.get("other")); - - // Check the resolver still contains the empty namespace. - assertTrue("The resolver does not contain the empty namespace after adding a second namespace.", resolver.containsKey("")); - assertEquals("The resolver does not contain the correct value for the empty namespace after adding a second namespace.", Constants.NS_URI_XSD_2001, resolver.get("")); - - // Check the resolver doesn't contain non-xmlns attribute value. - rootElem.setAttribute("type:other2", "other2:type"); - resolver = generator.getNSResolver(rootElem); - assertFalse("The resolver contains the other2 namespace.", resolver.containsKey("other2")); - } - - /** - * Test that this method returns the required prefixes. - */ - public void testGetPrefixes() - { - // Check document that contains no required namespaces and no prefix. - Document doc = new DocumentImpl(); - Element rootElem = doc.createElementNS(Constants.NS_URI_XSD_2001, "schema"); - rootElem.setAttribute("xmlns",Constants.NS_URI_XSD_2001); - //doc.appendChild(rootElem); - - List reqNSs = generator.getNamespacePrefixes(rootElem); - assertEquals("The required namespace list does not contain one empty string.", 1, reqNSs.size()); - assertEquals("The required namespace list does not contain one empty string.", "", reqNSs.get(0)); - - // Check document that contains no required namespaces and the xsd prefix. - Element rootElem2 = doc.createElementNS(Constants.NS_URI_XSD_2001, "xsd:schema"); - rootElem2.setAttribute("xmlns:xsd",Constants.NS_URI_XSD_2001); - List reqNSs2 = generator.getNamespacePrefixes(rootElem2); - assertEquals("The required namespace list does not contain the one string 'xsd'.", 1, reqNSs2.size()); - assertEquals("The required namespace list does not contain the one string 'xsd'.", "xsd", reqNSs2.get(0)); - - // Check document that contains an element with a required namespace. - Element rootElem4 = doc.createElementNS(Constants.NS_URI_XSD_2001, "xsd:schema"); - rootElem2.setAttribute("xmlns:xsd",Constants.NS_URI_XSD_2001); - Element diffNSElem = doc.createElementNS("http://othernamespace", "other:element"); - rootElem4.appendChild(diffNSElem); - List reqNSs4 = generator.getNamespacePrefixes(rootElem4); - assertTrue("The required namespace list does not contain the prefix 'other' when the namespace is specified for an element.", reqNSs4.contains("other")); - - // Check document that contains a type with a required namespace. - Element rootElem5 = doc.createElementNS(Constants.NS_URI_XSD_2001, "xsd:schema"); - rootElem5.setAttribute("xmlns:xsd",Constants.NS_URI_XSD_2001); - Element otherElem = doc.createElementNS(Constants.NS_URI_XSD_2001, "xsd:element"); - otherElem.setAttribute("type", "other:type"); - rootElem5.appendChild(otherElem); - List reqNSs5 = generator.getNamespacePrefixes(rootElem5); - assertTrue("The required namespace list does not contain 'other' when the namespace is specified for a type.", reqNSs5.contains("other")); - - // Check document that contains an import. Import elements should be ignored. - // This is a contrived example as it contains a type attribute for the import element. - Element rootElem6 = doc.createElementNS(Constants.NS_URI_XSD_2001, "xsd:schema"); - rootElem6.setAttribute("xmlns:xsd",Constants.NS_URI_XSD_2001); - Element importElem = doc.createElementNS(Constants.NS_URI_XSD_2001, "xsd:import"); - importElem.setAttribute("type", "other:type"); - rootElem6.appendChild(importElem); - List reqNSs6 = generator.getNamespacePrefixes(rootElem6); - assertEquals("The required namespace list does not contain the one string 'xsd' when an import element is used.", 1, reqNSs6.size()); - assertEquals("The required namespace list does not contain the one string 'xsd' when an import element is used.", "xsd", reqNSs6.get(0)); - - // Check document that contains an include. Include elements should be ignored. - // This is a contrived example as it contains a type attribute for the include element. - Element rootElem7 = doc.createElementNS(Constants.NS_URI_XSD_2001, "xsd:schema"); - rootElem7.setAttribute("xmlns:xsd",Constants.NS_URI_XSD_2001); - Element includeElem = doc.createElementNS(Constants.NS_URI_XSD_2001, "xsd:include"); - includeElem.setAttribute("type", "other:type"); - rootElem7.appendChild(includeElem); - List reqNSs7 = generator.getNamespacePrefixes(rootElem6); - assertEquals("The required namespace list does not contain the one string 'xsd' when an import element is used.", 1, reqNSs7.size()); - assertEquals("The required namespace list does not contain the one string 'xsd' when an import element is used.", "xsd", reqNSs7.get(0)); - - // Check document that contains attribute with a required namespace. - Element rootElem3 = doc.createElementNS(Constants.NS_URI_XSD_2001, "xsd:schema"); - rootElem3.setAttribute("xmlns:xsd",Constants.NS_URI_XSD_2001); - Element wsdlAttElem = doc.createElementNS(Constants.NS_URI_XSD_2001, "xsd:element"); - wsdlAttElem.setAttributeNS(Constants.NS_URI_WSDL, "wsdl:arrayType", "sometype[]"); - rootElem3.appendChild(wsdlAttElem); - List reqNSs3 = generator.getNamespacePrefixes(rootElem3); - assertTrue("The required namespace list does not contain 'wsdl' when the namespace is specified for an attribute.", reqNSs3.contains("wsdl")); - - } - - /** - * TODO: Implement tests for the RemoveImports method. - */ - public void todoRemoveImports() - { - } - - /** - * TODO: Implement tests for the RemoveLocalNamespace method. - */ - public void todoRemoveLocalNamespaces() - { - } - - /** - * TODO: Implement tests for the ResolveNamespace method. - */ - public void todoResolveNamespaces() - { - } - - /** - * - */ - public void testRestrictImports() - { - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/xsd/InlineSchemaGeneratorWrapper.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/xsd/InlineSchemaGeneratorWrapper.java deleted file mode 100644 index 53799b8eb..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/wsdl11/xsd/InlineSchemaGeneratorWrapper.java +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd; - -import java.util.Hashtable; -import java.util.List; -import java.util.Set; - -import org.w3c.dom.Element; - -/** - * Wrapper for InlineSchemaGenerator to allow testing protected methods. - */ -public class InlineSchemaGeneratorWrapper extends InlineSchemaGenerator -{ - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGenerator#checkSOAPEncodingRequired(java.util.List) - */ - protected boolean checkSOAPEncodingRequired(List reqns) - { - return super.checkSOAPEncodingRequired(reqns); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGenerator#createXSDStringRecursively(org.w3c.dom.Element, java.util.List, java.util.List, java.util.Hashtable, java.lang.String) - */ - protected String createXSDStringRecursively(Element elem, List elements, List requiredNamespaces, Hashtable reqNSDecl, String filelocation) - { - return super.createXSDStringRecursively(elem, elements, requiredNamespaces, - reqNSDecl, filelocation); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGenerator#getImportNamespaces(org.w3c.dom.Element) - */ - protected List getImportNamespaces(Element elem) - { - return super.getImportNamespaces(elem); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGenerator#getNSResolver(org.w3c.dom.Element) - */ - protected Hashtable getNSResolver(Element elem) - { - return super.getNSResolver(elem); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGenerator#getNamespacePrefixes(org.w3c.dom.Element) - */ - protected List getNamespacePrefixes(Element elem) - { - return super.getNamespacePrefixes(elem); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGenerator#removeImports(java.util.List, java.util.List) - */ - protected List removeImports(List namespaces, List importedNamespaces) - { - return super.removeImports(namespaces, importedNamespaces); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGenerator#removeLocalNamespaces(java.util.List, org.w3c.dom.Element) - */ - protected List removeLocalNamespaces(List namespaces, Element elem) - { - return super.removeLocalNamespaces(namespaces, elem); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGenerator#resolveNamespaces(java.util.List, java.util.Hashtable, java.util.Hashtable) - */ - protected Hashtable resolveNamespaces(List namespaces, Hashtable nsResolver, Hashtable parentNSResolver) - { - return super.resolveNamespaces(namespaces, nsResolver, parentNSResolver); - } - - /* (non-Javadoc) - * @see org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGenerator#restrictImports(java.util.List, java.util.Set) - */ - protected List restrictImports(List namespaces, Set validImportNSs) - { - return super.restrictImports(namespaces, validImportNSs); - } - -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/xml/XMLCatalogTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/xml/XMLCatalogTest.java deleted file mode 100644 index 2e7a262b3..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/internal/xml/XMLCatalogTest.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.eclipse.wst.wsdl.validation.internal.xml; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.eclipse.wst.wsdl.validation.tests.internal.BaseTestCase; - -/** - * Tests for the WSDL validator's internal XML catalog. - */ -public class XMLCatalogTest extends BaseTestCase -{ - private String CATALOG_DIR = "testresources/samples/XSD/CatalogSchemas/"; - - /** - * Create a tests suite from this test class. - * - * @return A test suite containing this test class. - */ - public static Test suite() - { - return new TestSuite(XMLCatalogTest.class); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception - { - super.setUp(); - XMLCatalog.reset(); - } - - - -public void testSchemaDir() - { - XMLCatalog.addSchemaDir(PLUGIN_ABSOLUTE_PATH + CATALOG_DIR); - String catalogLocation = PLUGIN_ABSOLUTE_PATH + CATALOG_DIR; - catalogLocation = catalogLocation.replace('\\','/'); - while(catalogLocation.startsWith("/")) - { - catalogLocation = catalogLocation.substring(1); - } - catalogLocation = FILE_PROTOCOL + catalogLocation; - IXMLCatalog catalog = XMLCatalog.getInstance(); - String resolvedLocation = catalog.resolveEntityLocation("http://www.example.org/schema1", ""); - assertEquals("The resolved location is not equal to the expected location.", catalogLocation + "schema1.xsd", resolvedLocation); - resolvedLocation = catalog.resolveEntityLocation("http://www.example.org/schema2", ""); - assertEquals("The second resolved location is not equal to the resolved location.", catalogLocation + "schema2.xsd", resolvedLocation); - - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/AllWSDLTests.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/AllWSDLTests.java deleted file mode 100644 index f5350f86c..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/AllWSDLTests.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.tests.internal; -import junit.framework.Test; - -import org.eclipse.wst.wsdl.validation.internal.eclipse.ValidatorTest; -import org.eclipse.wst.wsdl.validation.internal.resolver.URIResolverTest; -import org.eclipse.wst.wsdl.validation.internal.ui.ant.AntLoggerTest; -import org.eclipse.wst.wsdl.validation.internal.ui.ant.WSDLValidateTest; -import org.eclipse.wst.wsdl.validation.internal.wsdl11.xsd.InlineSchemaGeneratorTest; -import org.eclipse.wst.wsdl.validation.internal.xml.XMLCatalogTest; -/** - * The root test suite that contains all other WSDL validator test suites. - */ -public class AllWSDLTests extends junit.framework.TestSuite -{ - /** - * Create this test suite. - * - * @return This test suite. - */ - public static Test suite() - { - return new AllWSDLTests(); - } - - /** - * Constructor - */ - public AllWSDLTests() - { - super("AllWSDLTests"); - addTest(ValidatorTest.suite()); - //addTest(WSDLValidatorTest.suite()); - addTest(XSDTest.suite()); - addTest(WSDLTest.suite()); - addTest(PathsTest.suite()); - addTest(URIResolverTest.suite()); - addTest(WSDLValidateTest.suite()); - addTest(XMLCatalogTest.suite()); - addTest(InlineSchemaGeneratorTest.suite()); - addTestSuite(LineNumberAdjustmentsTest.class); - addTestSuite(AntLoggerTest.class); - addTestSuite(org.eclipse.wst.wsdl.validation.internal.ui.text.WSDLValidateTest.class); - } -}
\ No newline at end of file diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/BaseTestCase.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/BaseTestCase.java deleted file mode 100644 index eff916f65..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/BaseTestCase.java +++ /dev/null @@ -1,282 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.tests.internal; - -import java.io.BufferedReader; -import java.io.DataOutputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.Reader; -import java.util.Iterator; -import java.util.List; - -import junit.framework.TestCase; - -import org.apache.xerces.util.XMLGrammarPoolImpl; -import org.apache.xerces.xni.grammars.XMLGrammarPool; -import org.eclipse.wst.ws.internal.plugin.WSPlugin; -import org.eclipse.wst.ws.internal.preferences.PersistentWSIContext; -import org.eclipse.wst.wsdl.validation.internal.Constants; -import org.eclipse.wst.wsdl.validation.internal.IValidationMessage; -import org.eclipse.wst.wsdl.validation.internal.IValidationReport; -import org.eclipse.wst.wsdl.validation.internal.WSDLValidationConfiguration; -import org.eclipse.wst.wsdl.validation.internal.eclipse.InlineSchemaModelGrammarPoolImpl; -import org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLValidator; - -/** - * Base test case class which provides methods to - * - create logs - * - read from logs - * - run log comparison tests - */ -public class BaseTestCase extends TestCase -{ - protected String FILE_PROTOCOL = "file:///"; - protected String PLUGIN_ABSOLUTE_PATH; - protected String SAMPLES_DIR = "testresources/samples/"; - protected String GENERATED_RESULTS_DIR = "testresources/generatedResults/"; - protected String IDEAL_RESULTS_DIR = "testresources/idealResults/"; - protected String LOG_FILE_LOCATION = "results.log"; - - protected static final String PLUGIN_NAME = "org.eclipse.wst.wsdl.validation.tests"; - private WSDLValidator validator = WSDLValidator.getInstance(); - - WSDLValidationConfiguration configuration = null; - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception - { - super.setUp(); - - PLUGIN_ABSOLUTE_PATH = WSDLValidatorTestsPlugin.getInstallURL();//getPluginLocation(); - - // Set the WS-I preference to ignore so only WSDL errors will be tested. - WSPlugin wsui = WSPlugin.getInstance(); - PersistentWSIContext wsicontext = wsui.getWSISSBPContext(); - wsicontext.updateWSICompliances(PersistentWSIContext.IGNORE_NON_WSI); - wsicontext = wsui.getWSIAPContext(); - wsicontext.updateWSICompliances(PersistentWSIContext.IGNORE_NON_WSI); - - configuration = new WSDLValidationConfiguration(); - XMLGrammarPool xsdGrammarPool = new InlineSchemaModelGrammarPoolImpl(); - XMLGrammarPool xmlGrammarPool = new XMLGrammarPoolImpl(); - configuration.setProperty(Constants.XMLSCHEMA_CACHE_ATTRIBUTE, xsdGrammarPool); - configuration.setProperty(Constants.XML_CACHE_ATTRIBUTE, xmlGrammarPool); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception - { - configuration = null; - - super.tearDown(); - } - -/** - * Run a validator test. The test will run the validator, log the results and compare the results - * with the ideal results. The test will only pass if the two log files are the same. - * - * @param testfile The file to run the validator test on. - * @param loglocation The location to create the log file. - * @param idealloglocation The location of the ideal log file. - */ - public void runTest(String testfile, String loglocation, String idealloglocation) - { - IValidationReport valreport = validator.validate(testfile, null, configuration); - try - { - createLog(loglocation, valreport); - String generatedLog = getStringFromFile(loglocation); - String idealLog = getStringFromFile(idealloglocation); - assertEquals(idealLog, generatedLog); - } catch (Exception e) - { - fail("Could not compare log files"); - } - } - - /** - * Get a string representation of a file. - * - * @param filename the file name of the file to get the string representation. - * @return The string representation if successful. - * @throws Exception Thrown if unable to create a string representaion of the file. - */ - private String getStringFromFile(String filename) throws Exception - { - if(filename.startsWith("file:")) - { - filename = filename.substring(6); - while(filename.startsWith("\\") || filename.startsWith("/")) - { - filename = filename.substring(1); - } - } - StringBuffer filestring = new StringBuffer(); - Reader reader = null; - BufferedReader bufreader = null; - try - { - File file = new File(filename); - reader = new FileReader(file); - bufreader = new BufferedReader(reader); - while (bufreader.ready()) - { - filestring.append(bufreader.readLine() + "\n"); - } - } catch (FileNotFoundException e) - { - throw new Exception(); - } finally - { - bufreader.close(); - reader.close(); - } - return filestring.toString(); - } - - /** - * Create a log file for an XSD test. - * - * @param filename The name of the log file to create. - * @param valreport The validation report for this file. - * @return The file contents as a string if successful or null if not successful. - */ - private String createLog(String filename, IValidationReport valreport) - { - if(filename.startsWith("file:")) - { - filename = filename.substring(6); - while(filename.startsWith("\\") || filename.startsWith("/")) - { - filename = filename.substring(1); - } - } - IValidationMessage[] valmessages = valreport.getValidationMessages(); - int nummessages = valmessages.length;//validator.getErrors().size() + validator.getWarnings().size(); - StringBuffer errorsString = new StringBuffer(); - StringBuffer warningsString = new StringBuffer(); - int numerrors = 0; - int numwarnings = 0; - for(int i = 0; i < nummessages; i++) - { - IValidationMessage valmes = valmessages[i]; - if(valmes.getSeverity() == IValidationMessage.SEV_WARNING) - { - numwarnings++; - // If the message contains any file references make them relative. - String message = valmes.getMessage(); - message = message.replaceAll("'[^']*" + PLUGIN_NAME + "[^'/]*/", "'"); - message = message.replaceAll("[(][^(]*" + PLUGIN_NAME + "[^'/]*/", "[(]"); - warningsString.append(message + " [" + valmes.getLine() +", " + valmes.getColumn() +"]\n"); - warningsString.append(createNestedMessageString(valmes.getNestedMessages())); - } - else - { - numerrors++; - // If the message contains any file references make them relative. - String message = valmes.getMessage(); - message = message.replaceAll("'[^']*" + PLUGIN_NAME + "[^'/]*/", "'"); - message = message.replaceAll("[(][^(]*" + PLUGIN_NAME + "[^'/]*/", "("); - errorsString.append(message + " [" + valmes.getLine() +", " + valmes.getColumn() +"]\n"); - errorsString.append(createNestedMessageString(valmes.getNestedMessages())); - } - } - StringBuffer log = new StringBuffer(); - log.append("number of errors : " + numerrors + "\n"); - log.append("number of warnings : " + numwarnings + "\n\n"); - log.append("------------error list-------------------------------------------\n"); - if(numerrors == 0) - { - log.append("(none)\n"); - } - else - { - log.append(errorsString.toString()); - } - log.append("------------warning list-----------------------------------------\n"); - if(numwarnings == 0) - { - log.append("(none)\n"); - } - else - { - log.append(warningsString.toString()); - } - log.append("-----------------------------------------------------------------\n"); - - DataOutputStream outStream = null; - try - { - File logfile = new File(filename); - File parent = logfile.getParentFile(); - if (!parent.exists()) - { - parent.mkdirs(); - } - if(logfile.exists()) - { - logfile.delete(); - } - logfile.createNewFile(); - - outStream = new DataOutputStream(new FileOutputStream(filename, true)); - outStream.writeBytes(log.toString()); - outStream.close(); - - } catch (IOException e) - { - // If we can't write the log then clear the log. - log.delete(0, log.length()); - } - return log.toString(); - } - - private String createNestedMessageString(List nestedMessages) - { - return createNestedMessageString(nestedMessages, 0); - } - - private String createNestedMessageString(List nestedMessages, int depth) - { - if(nestedMessages != null && nestedMessages.size() > 0) - { - String messageString = ""; - Iterator nestedMesIter = nestedMessages.iterator(); - while(nestedMesIter.hasNext()) - { - IValidationMessage nesvalmes = (IValidationMessage)nestedMesIter.next(); - for(int i = 0; i < depth; i++) - { - messageString += " "; - } - // If the message contains any file references make them relative. - String message = nesvalmes.getMessage(); - message = message.replaceAll("'[^']*" + PLUGIN_NAME + "[^'/]*/", "'"); - message = message.replaceAll("[(][^(]*" + PLUGIN_NAME + "[^'/]*/", "[(]"); - messageString += ("-> " + message + " [" + nesvalmes.getLine() +", " + nesvalmes.getColumn() +"]\n"); - messageString += createNestedMessageString(nesvalmes.getNestedMessages(), depth + 1); - } - return messageString; - } - else - { - return ""; - } - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/LineNumberAdjustmentsTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/LineNumberAdjustmentsTest.java deleted file mode 100644 index 0c2953429..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/LineNumberAdjustmentsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.tests.internal; - -/** - * Tests for line number adjustments in the WSDL validator's - * XML validator. - */ -public class LineNumberAdjustmentsTest extends BaseTestCase -{ - private String LINE_NUMBER_ADJUSTMENTS_DIR = "LineNumberAdjustments/"; - - /** - * Test /LineNumberAdjustments/cvc-complex-type.2.3/cvc-complex-type.2.3.wsdl - */ - public void testcvccomplextype23() - { - String testname = "cvc-complex-type.2.3"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + LINE_NUMBER_ADJUSTMENTS_DIR + "cvc-complex-type.2.3/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + LINE_NUMBER_ADJUSTMENTS_DIR + "cvc-complex-type.2.3/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + LINE_NUMBER_ADJUSTMENTS_DIR + "cvc-complex-type.2.3/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /LineNumberAdjustments/cvc-complex-type.2.4.b/cvc-complex-type.2.4.b.wsdl - */ - public void testcvccomplextype24b() - { - String testname = "cvc-complex-type.2.4.b"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + LINE_NUMBER_ADJUSTMENTS_DIR + "cvc-complex-type.2.4.b/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + LINE_NUMBER_ADJUSTMENTS_DIR + "cvc-complex-type.2.4.b/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + LINE_NUMBER_ADJUSTMENTS_DIR + "cvc-complex-type.2.4.b/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/PathsTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/PathsTest.java deleted file mode 100644 index 4f17bfaa1..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/PathsTest.java +++ /dev/null @@ -1,569 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.tests.internal; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * Tests for file paths. - */ -public class PathsTest extends BaseTestCase -{ - private String PATHS_DIR = "Paths/"; - - /** - * Create a tests suite from this test class. - * - * @return A test suite containing this test class. - */ - public static Test suite() - { - return new TestSuite(PathsTest.class); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception - { - super.setUp(); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception - { - // Delete the simple project for ImportedSchemaWithSchemaImport test - super.tearDown(); - } - - /** - * Test /Paths/Space InPath/SpaceInPathValid.wsdl - */ - public void testSpaceInPathValid() - { - String testname = "SpaceInPathValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Space InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Space InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Space InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Space InPath/SpaceInPathInvalid.wsdl - */ - public void testSpaceInPathInvalid() - { - String testname = "SpaceInPathInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Space InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Space InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Space InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/AngleHat^InPath/AngleHatInPathValid.wsdl - */ - public void testAngleHatInPathValid() - { - String testname = "AngleHatInPathValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "AngleHat^InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "AngleHat^InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "AngleHat^InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/AngleHat^InPath/AngleHatInPathInvalid.wsdl - */ - public void testAngleHatInPathInvalid() - { - String testname = "AngleHatInPathInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "AngleHat^InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "AngleHat^InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "AngleHat^InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/AngleHatInFilename/AngleHat^InFilenameValid.wsdl - */ - public void testAngleHatInFilenameValid() - { - String testname = "AngleHat^InFilenameValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "AngleHatInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "AngleHatInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "AngleHatInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/AngleHatInFilename/AngleHat^InFilenameInvalid.wsdl - */ - public void testAngleHatInFilenameInvalid() - { - String testname = "AngleHat^InFilenameInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "AngleHatInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "AngleHatInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "AngleHatInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/CloseBracket)InPath/CloseBracketInPathValid.wsdl - */ - public void testCloseBracketInPathValid() - { - String testname = "CloseBracketInPathValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "CloseBracket)InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "CloseBracket)InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "CloseBracket)InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/CloseBracket)InPath/CloseBracketInPathInvalid.wsdl - */ - public void testCloseBracketInPathInvalid() - { - String testname = "CloseBracketInPathInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "CloseBracket)InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "CloseBracket)InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "CloseBracket)InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/CloseBracketInFilename/CloseBracket)InFilenameValid.wsdl - */ - public void testCloseBracketInFilenameValid() - { - String testname = "CloseBracket)InFilenameValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "CloseBracketInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "CloseBracketInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "CloseBracketInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/CloseBracketInFilename/CloseBracket)InFilenameInvalid.wsdl - */ - public void testCloseBracketInFilenameInvalid() - { - String testname = "CloseBracket)InFilenameInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "CloseBracketInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "CloseBracketInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "CloseBracketInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Dash-InPath/DashInPathValid.wsdl - */ - public void testDashInPathValid() - { - String testname = "DashInPathValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Dash-InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Dash-InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Dash-InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Dash-InPath/DashInPathInvalid.wsdl - */ - public void testDashInPathInvalid() - { - String testname = "DashInPathInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Dash-InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Dash-InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Dash-InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/DashInFilename/Dash-InFilenameValid.wsdl - */ - public void testDashInFilenameValid() - { - String testname = "Dash-InFilenameValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "DashInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "DashInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "DashInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/DashInFilename/Dash-InFilenameInvalid.wsdl - */ - public void testDashInFilenameInvalid() - { - String testname = "Dash-InFilenameInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "DashInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "DashInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "DashInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Exclamation!InPath/ExclamationInPathValid.wsdl - */ - public void testExclamationInPathValid() - { - String testname = "ExclamationInPathValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Exclamation!InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Exclamation!InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Exclamation!InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Exclamation!InPath/ExclamationInPathInvalid.wsdl - */ - public void testExclamationInPathInvalid() - { - String testname = "ExclamationInPathInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Exclamation!InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Exclamation!InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Exclamation!InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/ExclamationInFilename/Exclamation!InFilenameValid.wsdl - */ - public void testExclamationInFilenameValid() - { - String testname = "Exclamation!InFilenameValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "ExclamationInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "ExclamationInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "ExclamationInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/ExclamationInFilename/Exclamation!InFilenameInvalid.wsdl - */ - public void testExclamationInFilenameInvalid() - { - String testname = "Exclamation!InFilenameInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "ExclamationInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "ExclamationInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "ExclamationInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/OpenBracket(InPath/OpenBracketInPathValid.wsdl - */ - public void testOpenBracketInPathValid() - { - String testname = "OpenBracketInPathValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "OpenBracket(InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "OpenBracket(InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "OpenBracket(InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/OpenBracket(InPath/OpenBracketInPathInvalid.wsdl - */ - public void testOpenBracketInPathInvalid() - { - String testname = "OpenBracketInPathInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "OpenBracket(InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "OpenBracket(InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "OpenBracket(InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/OpenBracketInFilename/OpenBracket(InFilenameValid.wsdl - */ - public void testOpenBracketInFilenameValid() - { - String testname = "OpenBracket(InFilenameValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "OpenBracketInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "OpenBracketInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "OpenBracketInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/OpenBracketInFilename/OpenBracket(InFilenameInvalid.wsdl - */ - public void testOpenBracketInFilenameInvalid() - { - String testname = "OpenBracket(InFilenameInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "OpenBracketInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "OpenBracketInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "OpenBracketInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Period.InPath/PeriodInPathValid.wsdl - */ - public void testPeriodInPathValid() - { - String testname = "PeriodInPathValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Period.InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Period.InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Period.InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Period.InPath/PeriodInPathInvalid.wsdl - */ - public void testPeriodInPathInvalid() - { - String testname = "PeriodInPathInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Period.InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Period.InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Period.InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/PeriodInFilename/Period.InFilenameValid.wsdl - */ - public void testPeriodInFilenameValid() - { - String testname = "Period.InFilenameValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "PeriodInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "PeriodInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "PeriodInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/PeriodInFilename/Period.InFilenameInvalid.wsdl - */ - public void testPeriodInFilenameInvalid() - { - String testname = "Period.InFilenameInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "PeriodInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "PeriodInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "PeriodInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Quote'InPath/QuoteInPathValid.wsdl - */ - public void testQuoteInPathValid() - { - String testname = "QuoteInPathValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Quote'InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Quote'InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Quote'InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Quote'InPath/QuoteInPathInvalid.wsdl - */ - public void testQuoteInPathInvalid() - { - String testname = "QuoteInPathInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Quote'InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Quote'InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Quote'InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/QuoteInFilename/Quote'InFilenameValid.wsdl - */ - public void testQuoteInFilenameValid() - { - String testname = "Quote'InFilenameValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "QuoteInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "QuoteInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "QuoteInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/QuoteInFilename/Quote'InFilenameInvalid.wsdl - */ - public void testQuoteInFilenameInvalid() - { - String testname = "Quote'InFilenameInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "QuoteInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "QuoteInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "QuoteInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/SpaceInFilename/Space InFilenameValid.wsdl - */ - public void testSpaceInFilenameValid() - { - String testname = "Space InFilenameValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "SpaceInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "SpaceInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "SpaceInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/SpaceInFilename/Space InFilenameInvalid.wsdl - */ - public void testSpaceInFilenameInvalid() - { - String testname = "Space InFilenameInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "SpaceInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "SpaceInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "SpaceInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Tilde~InPath/TildeInPathValid.wsdl - */ - public void testTildeInPathValid() - { - String testname = "TildeInPathValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Tilde~InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Tilde~InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Tilde~InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Tilde~InPath/TildeInPathInvalid.wsdl - */ - public void testTildeInPathInvalid() - { - String testname = "TildeInPathInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Tilde~InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Tilde~InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Tilde~InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/TildeInFilename/Tilde~InFilenameValid.wsdl - */ - public void testTildeInFilenameValid() - { - String testname = "Tilde~InFilenameValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "TildeInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "TildeInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "TildeInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/TildeInFilename/Tilde~InFilenameInvalid.wsdl - */ - public void testTildeInFilenameInvalid() - { - String testname = "Tilde~InFilenameInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "TildeInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "TildeInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "TildeInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Underscore_InPath/UnderscoreInPathValid.wsdl - */ - public void testUnderscoreInPathValid() - { - String testname = "UnderscoreInPathValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Underscore_InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Underscore_InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Underscore_InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/Underscore_InPath/UnderscoreInPathInvalid.wsdl - */ - public void testUnderscoreInPathInvalid() - { - String testname = "UnderscoreInPathInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "Underscore_InPath/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "Underscore_InPath/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "Underscore_InPath/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/UnderscoreInFilename/Underscore_InFilenameValid.wsdl - */ - public void testUnderscoreInFilenameValid() - { - String testname = "Underscore_InFilenameValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "UnderscoreInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "UnderscoreInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "UnderscoreInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /Paths/UnderscoreInFilename/Underscore_InFilenameInvalid.wsdl - */ - public void testUnderscoreInFilenameInvalid() - { - String testname = "Underscore_InFilenameInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + PATHS_DIR + "UnderscoreInFilename/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + PATHS_DIR + "UnderscoreInFilename/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + PATHS_DIR + "UnderscoreInFilename/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/WSDLTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/WSDLTest.java deleted file mode 100644 index e94e3418b..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/WSDLTest.java +++ /dev/null @@ -1,615 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.tests.internal; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * WSDL validation tests for the WSDL validator. - */ -public class WSDLTest extends BaseTestCase -{ - private String WSDL_DIR = "WSDL/"; - - /** - * Create a tests suite from this test class. - * - * @return A test suite containing this test class. - */ - public static Test suite() - { - return new TestSuite(WSDLTest.class); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception - { - super.setUp(); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception - { - // Delete the simple project for ImportedSchemaWithSchemaImport test - super.tearDown(); - } - - /** - * IMPORT TESTS - */ - - /** - * Test /WSDL/Import/ImportSchemaWithWSDLImport.wsdl - */ - public void testImportSchemaWithWSDLImport() - { - String testname = "ImportSchemaWithWSDLImport"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportSchemaWithWSDLImportInvalidNS.wsdl - */ - public void testImportSchemaWithWSDLImportInvalidNS() - { - String testname = "ImportSchemaWithWSDLImportInvalidNS"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportWSDLWithWSDL.wsdl - */ - public void testImportWSDLWithWSDL() - { - String testname = "ImportWSDLWithWSDL"; - String testfile = PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportWSDLWithWSDLInvalidNS.wsdl - */ - public void testImportWSDLWithWSDLInvalidNS() - { - String testname = "ImportWSDLWithWSDLInvalidNS"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportWSDLWithWSDLInvalidFilename.wsdl - */ - public void testImportWSDLWithWSDLInvalidFilename() - { - String testname = "ImportWSDLWithWSDLInvalidFilename"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/WSDLImportingTypes.wsdl - */ - public void testWSDLImportingTypes() - { - String testname = "WSDLImportingTypes"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportNonExistantFile.wsdl - */ - public void testImportNonExistantFile() - { - String testname = "ImportNonExistantFile"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/WSDLNamespaceAAA.wsdl - */ - public void testWSDLNamespaceAAA() - { - String testname = "WSDLNamespaceAAA"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportingWSDLWithImportedSchema.wsdl - */ - public void testImportingWSDLWithImportedSchema() - { - String testname = "ImportingWSDLWithImportedSchema"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/WSDLImportingSchemaInmportingSchema.wsdl - */ - public void testWSDLImportingSchemaInmportingSchema() - { - String testname = "WSDLImportingSchemaImportingSchema"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportXMLInvalidWSDL/ImportXMLInvalidWSDL.wsdl - */ - public void testImportXMLInvalidWSDL() - { - String testname = "ImportXMLInvalidWSDL"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/ImportXMLInvalidWSDL/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/ImportXMLInvalidWSDL/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/ImportXMLInvalidWSDL/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/AlphabeticalOrderOfImports/ImportOneAndTwo.wsdl - */ - public void testImportOneAndTwo() - { - String testname = "ImportOneAndTwo"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/AlphabeticalOrderOfImports/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/AlphabeticalOrderOfImports/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/AlphabeticalOrderOfImports/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/AlphabeticalOrderOfImports/one.wsdl - */ - public void testImportOneAndTwo_One() - { - String testname = "one"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/AlphabeticalOrderOfImports/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/AlphabeticalOrderOfImports/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/AlphabeticalOrderOfImports/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/AlphabeticalOrderOfImports/two.wsdl - */ - public void testImportOneAndTwo_Two() - { - String testname = "two"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/AlphabeticalOrderOfImports/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/AlphabeticalOrderOfImports/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/AlphabeticalOrderOfImports/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportEmptyLocation/ImportEmptyLocation.wsdl - */ - public void testImportEmptyLocation() - { - String testname = "ImportEmptyLocation"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/ImportEmptyLocation/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/ImportEmptyLocation/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/ImportEmptyLocation/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportEmptyNamespace/ImportEmptyNamespace.wsdl - */ - public void testImportEmptyNamespace() - { - String testname = "ImportEmptyNamespace"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/ImportEmptyNamespace/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/ImportEmptyNamespace/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/ImportEmptyNamespace/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportEmptyNamespaceAndLocation/ImportEmptyNamespaceAndLocation.wsdl - */ - public void testImportEmptyNamespaceAndLocation() - { - String testname = "ImportEmptyNamespaceAndLocation"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/ImportEmptyNamespaceAndLocation/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/ImportEmptyNamespaceAndLocation/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/ImportEmptyNamespaceAndLocation/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportNoLocationAttribute/ImportNoLocationAttribute.wsdl - */ - public void testImportNoLocationAttribute() - { - String testname = "ImportNoLocationAttribute"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/ImportNoLocationAttribute/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/ImportNoLocationAttribute/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/ImportNoLocationAttribute/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/SimpleImport/test-1.0.wsdl - */ - public void testSimpleImport() - { - String testname = "test-1.0"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/SimpleImport/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/SimpleImport/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/SimpleImport/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Import/ImportWithIncorrectSlash/ImportWithIncorrectSlash.wsdl - */ - public void testImportWithIncorrectSlash() - { - String testname = "ImportWithIncorrectSlash"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Import/ImportWithIncorrectSlash/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Import/ImportWithIncorrectSlash/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Import/ImportWithIncorrectSlash/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * CYCLIC TESTS - */ - - /** - * Test /WSDL/Cyclic/PorttypeRefMessage1.wsdl - */ - public void testPorttypeRefMessage1() - { - String testname = "PorttypeRefMessage1"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Cyclic/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Cyclic/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Cyclic/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/Cyclic/PorttypeRefMessage2.wsdl - */ - public void testPorttypeRefMessage2() - { - String testname = "PorttypeRefMessage2"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "Cyclic/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "Cyclic/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "Cyclic/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/SelfContained/ReferenceInlineTypes.wsdl - */ - public void testReferenceInlineTypes() - { - String testname = "ReferenceInlineTypes"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/SelfContained/Empty.wsdl - */ - public void testEmpty() - { - String testname = "Empty"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/SelfContained/SOAPBodyEncodedNoNamespace.wsdl - */ - public void testSOAPBodyEncodedNoNamespace() - { - String testname = "SOAPBodyEncodedNoNamespace"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/SelfContained/SOAPBodyEncodedWithNamespace.wsdl - */ - public void testSOAPBodyEncodedWithNamespace() - { - String testname = "SOAPBodyEncodedWithNamespace"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "SelfContained/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/SelfContained/NoDefaultNamespace/NoDefaultNamespace.wsdl - */ - public void testNoDefaultNamespace() - { - String testname = "NoDefaultNamespace"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "SelfContained/NoDefaultNamespace/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "SelfContained/NoDefaultNamespace/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "SelfContained/NoDefaultNamespace/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/BindingElement/InvalidStyle/BindingInvalidStyle.wsdl - */ - public void testBindingInvalidStyle() - { - String testname = "BindingInvalidStyle"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "BindingElement/InvalidStyle/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "BindingElement/InvalidStyle/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "BindingElement/InvalidStyle/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/BindingElement/InvalidUse/BindingInvalidUse.wsdl - */ - public void testBindingInvalidUse() - { - String testname = "BindingInvalidUse"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "BindingElement/InvalidUse/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "BindingElement/InvalidUse/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "BindingElement/InvalidUse/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/MessageElement/InvalidElement/MessageInvalidElement.wsdl - */ - public void testMessageInvalidElement() - { - String testname = "MessageInvalidElement"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "MessageElement/InvalidElement/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "MessageElement/InvalidElement/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "MessageElement/InvalidElement/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/MessageElement/InvalidType/MessageInvalidType.wsdl - */ - public void testMessageInvalidType() - { - String testname = "MessageInvalidType"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "MessageElement/InvalidType/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "MessageElement/InvalidType/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "MessageElement/InvalidType/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/PortTypeElement/InvalidInput/PortTypeInvalidInput.wsdl - */ - public void testPortTypeInvalidInput() - { - String testname = "PortTypeInvalidInput"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "PortTypeElement/InvalidInput/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "PortTypeElement/InvalidInput/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "PortTypeElement/InvalidInput/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/PortTypeElement/InvalidOutput/PortTypeInvalidOutput.wsdl - */ - public void testPortTypeInvalidOutput() - { - String testname = "PortTypeInvalidOutput"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "PortTypeElement/InvalidOutput/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "PortTypeElement/InvalidOutput/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "PortTypeElement/InvalidOutput/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/ServiceElement/InvalidBinding/ServiceInvalidBinding.wsdl - */ - public void testServiceInvalidBinding() - { - String testname = "ServiceInvalidBinding"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "ServiceElement/InvalidBinding/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "ServiceElement/InvalidBinding/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "ServiceElement/InvalidBinding/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/ServiceElement/NoAddress/ServiceNoAddress.wsdl - */ - public void testServiceNoAddress() - { - String testname = "ServiceNoAddress"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "ServiceElement/NoAddress/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "ServiceElement/NoAddress/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "ServiceElement/NoAddress/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/CaseInsensitiveOperationNames/CaseInsensitiveOperationNames.wsdl - */ - public void testCaseInsensitiveOperationNames() - { - String testname = "CaseInsensitiveOperationNames"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "CaseInsensitiveOperationNames/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "CaseInsensitiveOperationNames/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "CaseInsensitiveOperationNames/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/NamespaceDoesntResolve/NamespaceDoesntResolve.wsdl - */ - public void testNamespaceDoesntResolve() - { - String testname = "NamespaceDoesntResolve"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "NamespaceDoesntResolve/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "NamespaceDoesntResolve/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "NamespaceDoesntResolve/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/NamespaceResolvesHTML/NamespaceResolvesHTML.wsdl - */ - public void testNamespaceResolvesHTML() - { - String testname = "NamespaceResolvesHTML"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "NamespaceResolvesHTML/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "NamespaceResolvesHTML/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "NamespaceResolvesHTML/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/SelfImport/SimpleFile/SelfImport.wsdl - */ - public void testSimplefileSelfImport() - { - String testname = "SelfImport"; - String fileprefix = FILE_PROTOCOL; - // Need to ensure the URL of the test file is as expected. - if(PLUGIN_ABSOLUTE_PATH.startsWith("/")) - { - fileprefix = fileprefix.substring(0, fileprefix.length()-1); - } - String testfile = fileprefix + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "SelfImport/SimpleFile/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "SelfImport/SimpleFile/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "SelfImport/SimpleFile/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/SelfImport/ImportFileWithSelfImport/ImportFileWithSelfImport.wsdl - */ - public void testImportFileWithSelfImport() - { - String testname = "ImportFileWithSelfImport"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "SelfImport/ImportFileWithSelfImport/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "SelfImport/ImportFileWithSelfImport/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "SelfImport/ImportFileWithSelfImport/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/SelfImport/SimpleFileInvalid/SelfImport.wsdl - */ - public void testSimpleFileInvalidSelfImport() - { - String testname = "SelfImport"; - String fileprefix = FILE_PROTOCOL; - // Need to ensure the URL of the test file is as expected. - if(PLUGIN_ABSOLUTE_PATH.startsWith("/")) - { - fileprefix = fileprefix.substring(0, fileprefix.length()-1); - } - String testfile = fileprefix + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "SelfImport/SimpleFileInvalid/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "SelfImport/SimpleFileInvalid/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "SelfImport/SimpleFileInvalid/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /WSDL/InvalidSchemaWithPartReferences/InvalidSchemaWithPartReferences.wsdl - */ - public void testInvalidSchemaWithPartReferences() - { - String testname = "InvalidSchemaWithPartReferences"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + WSDL_DIR + "InvalidSchemaWithPartReferences/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + WSDL_DIR + "InvalidSchemaWithPartReferences/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + WSDL_DIR + "InvalidSchemaWithPartReferences/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } -} diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/WSDLValidatorTestsPlugin.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/WSDLValidatorTestsPlugin.java deleted file mode 100644 index 251eaede5..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/WSDLValidatorTestsPlugin.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.tests.internal; - -import java.io.IOException; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; - -/** - * The main plugin class to be used in the desktop. - */ -public class WSDLValidatorTestsPlugin extends AbstractUIPlugin -{ - //The shared instance. - private static WSDLValidatorTestsPlugin plugin; - private static Bundle pluginBundle = null; - - /** - * The constructor. - */ - public WSDLValidatorTestsPlugin() - { - super(); - plugin = this; - } - - /** - * This method is called upon plug-in activation - */ - public void start(BundleContext context) throws Exception - { - super.start(context); - pluginBundle = context.getBundle(); - } - - /** - * This method is called when the plug-in is stopped - */ - public void stop(BundleContext context) throws Exception - { - super.stop(context); - } - - /** - * Returns the shared instance. - */ - public static WSDLValidatorTestsPlugin getDefault() - { - return plugin; - } - - /** - * Get the install URL of this plugin. - * - * @return the install url of this plugin - */ - public static String getInstallURL() - { - try - { - return FileLocator.resolve(pluginBundle.getEntry("/")).getFile(); - } - catch (IOException e) - { - return null; - } - } -}
\ No newline at end of file diff --git a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/XSDTest.java b/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/XSDTest.java deleted file mode 100644 index 54c8d58bb..000000000 --- a/tests/org.eclipse.wst.wsdl.validation.tests/src/org/eclipse/wst/wsdl/validation/tests/internal/XSDTest.java +++ /dev/null @@ -1,222 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.wsdl.validation.tests.internal; - -import junit.framework.Test; -import junit.framework.TestSuite; - -/** - * XSD validation tests for the WSDL validator. - */ -public class XSDTest extends BaseTestCase -{ - private String XSD_DIR = "XSD/"; - - /** - * Create a tests suite from this test class. - * - * @return A test suite containing this test class. - */ - public static Test suite() - { - return new TestSuite(XSDTest.class); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception - { - super.setUp(); - } - - /** - * Test /XSD/Entities/normalizeEntitiesValid.wsdl - */ - public void testNormalizeEntitiesValid() - { - String testname = "normalizeEntitiesValid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "Entities/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "Entities/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "Entities/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/Entities/normalizeEntitiesInvalid.wsdl - */ - public void testNormalizeEntitiesInvalid() - { - String testname = "normalizeEntitiesInvalid"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "Entities/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "Entities/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "Entities/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/ReferToAnotherInlineType/ReferToAnotherInlineType.wsdl - */ - public void testReferToAnotherInlineType() - { - String testname = "ReferToAnotherInlineType"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "ReferToAnotherInlineType/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "ReferToAnotherInlineType/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "ReferToAnotherInlineType/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/ReferToAnotherInlineType/ReferToAnotherInlineTypeNoImport.wsdl - */ - public void testReferToAnotherInlineTypeNoImport() - { - String testname = "ReferToAnotherInlineTypeNoImport"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "ReferToAnotherInlineType/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "ReferToAnotherInlineType/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "ReferToAnotherInlineType/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/InlineSchemaGeneratedImports/NoImportForUnprefixedAttribute.wsdl - */ - public void testNoImportForUnprefixedAttribute() - { - String testname = "NoImportForUnprefixedAttribute"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "InlineSchemaGeneratedImports/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "InlineSchemaGeneratedImports/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "InlineSchemaGeneratedImports/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/OneErrorForInlineXSDRefInvalidInlineXSD/OneErrorForInlineXSDRefInvalidInlineXSD.wsdl - */ - public void testOneErrorForInlineXSDRefInvalidInlineXSD() - { - String testname = "OneErrorForInlineXSDRefInvalidInlineXSD"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "OneErrorForInlineXSDRefInvalidInlineXSD/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "OneErrorForInlineXSDRefInvalidInlineXSD/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "OneErrorForInlineXSDRefInvalidInlineXSD/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/SchemaDocElemWithSourceAndSubElem/SchemaDocElemWithSourceAndSubElem.wsdl - */ - public void testSchemaDocElemWithSourceAndSubElem() - { - String testname = "SchemaDocElemWithSourceAndSubElem"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "SchemaDocElemWithSourceAndSubElem/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "SchemaDocElemWithSourceAndSubElem/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "SchemaDocElemWithSourceAndSubElem/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/RestrictionPatternWithColon/RestrictionPatternWithColon.wsdl - */ - public void testRestrictionPatternWithColon() - { - String testname = "RestrictionPatternWithColon"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "RestrictionPatternWithColon/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "RestrictionPatternWithColon/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "RestrictionPatternWithColon/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/ImportInlineSchemaWithInclude/ImportInlineSchemaWithInclude.wsdl - */ - public void testImportInlineSchemaWithInclude() - { - String testname = "ImportInlineSchemaWithInclude"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "ImportInlineSchemaWithInclude/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "ImportInlineSchemaWithInclude/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "ImportInlineSchemaWithInclude/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/ValueColon/ValueColon.wsdl - */ - public void testValueColon() - { - String testname = "ValueColon"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "ValueColon/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "ValueColon/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "ValueColon/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/ImportNoNSSchema/ImportNoNSSchema.wsdl - */ - public void testImportNoNSSchema() - { - String testname = "ImportNoNSSchema"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "ImportNoNSSchema/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "ImportNoNSSchema/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "ImportNoNSSchema/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/ImportNoNSSchemAndSecondSchemaWithNS/ImportNoNSSchemaAndSecondSchemaWithNS.wsdl - */ - public void testImportNoNSSchemaAndSecondSchemaWithNS() - { - String testname = "ImportNoNSSchemaAndSecondSchemaWithNS"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "ImportNoNSSchemaAndSecondSchemaWithNS/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "ImportNoNSSchemaAndSecondSchemaWithNS/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "ImportNoNSSchemaAndSecondSchemaWithNS/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/NoNSElementReference/NoNSElementReference.wsdl - */ - public void testNoNSElementReference() - { - String testname = "NoNSElementReference"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "NoNSElementReference/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "NoNSElementReference/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "NoNSElementReference/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } - - /** - * Test /XSD/InlineSchemaNoNamespace/InlineSchemaNoNamespace.wsdl - */ - public void testInlineSchemaNoNamespace() - { - String testname = "InlineSchemaNoNamespace"; - String testfile = FILE_PROTOCOL + PLUGIN_ABSOLUTE_PATH + SAMPLES_DIR + XSD_DIR + "InlineSchemaNoNamespace/" + testname + ".wsdl"; - String loglocation = PLUGIN_ABSOLUTE_PATH + GENERATED_RESULTS_DIR + XSD_DIR + "InlineSchemaNoNamespace/" + testname + ".wsdl-log"; - String idealloglocation = PLUGIN_ABSOLUTE_PATH + IDEAL_RESULTS_DIR + XSD_DIR + "InlineSchemaNoNamespace/" + testname + ".wsdl-log"; - - runTest(testfile, loglocation, idealloglocation); - } -} |