diff options
Diffstat (limited to 'tests/org.eclipse.wst.ws.tests/tests/org')
12 files changed, 0 insertions, 972 deletions
diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/data/LocatorWorkspaceSetup.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/data/LocatorWorkspaceSetup.java deleted file mode 100644 index f455fa9c3..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/data/LocatorWorkspaceSetup.java +++ /dev/null @@ -1,176 +0,0 @@ -package org.eclipse.wst.ws.tests.data; - -import java.io.IOException; - -import junit.framework.Assert; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceVisitor; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.intro.IIntroManager; -import org.eclipse.ui.intro.IIntroPart; -import org.eclipse.wst.ws.tests.plugin.TestsPlugin; - -/** - * @author joan - * Sets up locator test data - uses same data file but renames it for each use - * Workspace structure created looks like this: - * - * root - * --project1 - * |----folder1 - * |-----folder2 - * |------one.wsdl - * |-----two.wsdl - * |----folder3 - * |-----three.wsdl - * |-----four.wsdl - * --project2 - * |----five.wsdl - * |----folder4 - * |----folder5 - * |-----six.wsdl - * --project3 - * |----one.xml - */ - -public class LocatorWorkspaceSetup extends TestCase { - - public static String PROJECT1_NAME = "Project1"; - public static String FOLDER1_NAME = "Folder1"; //contains WSDL file and one folder - public static String FOLDER2_NAME = "Folder2"; //nested in folder 1 and contains WSDL file - public static String FOLDER3_NAME = "Folder3"; //contains two WSDL files - public static String PROJECT2_NAME = "Project2"; //contains WSDL file and two folders - public static String FOLDER4_NAME = "Folder4"; //contains no WSDL - public static String FOLDER5_NAME = "Folder5"; //contains one WSDL file - public static String PROJECT3_NAME = "Project3"; //contains no WSDL files but one XML file - - public static String WSDLFILE_ONE = "one.wsdl"; - public static String WSDLFILE_TWO = "two.wsdl"; - public static String WSDLFILE_THREE = "three.wsdl"; - public static String WSDLFILE_FOUR = "four.wsdl"; - public static String WSDLFILE_FIVE = "five.wsdl"; - public static String WSDLFILE_SIX = "six.wsdl"; - public static String XMLFILE_ONE = "one.XML"; - - public static String ACTUAL_TESTFILEPATH = "data/locator/test.wsdl"; - - private IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - - public static Test suite() - { - return new TestSuite(LocatorWorkspaceSetup.class, "LocatorWorkspaceSetup"); - } - - protected void closeIntro() - { - IIntroManager introManager = PlatformUI.getWorkbench().getIntroManager(); - IIntroPart introPart = introManager.getIntro(); - if (introPart != null) - introManager.closeIntro(introPart); - } - - protected IProject createSimpleProject(String name) throws CoreException - { - IProject simpleProject = root.getProject(name); - simpleProject.create(null); - simpleProject.open(null); - return simpleProject; - } - - protected IFolder createFolder(IContainer parent, String folderName) throws CoreException - { - IFolder folder1 = parent.getFolder(new Path(folderName)); - folder1.create(false, true, null); - return folder1; - } - - - protected void copyFile(IContainer project, String source, String dest) throws IOException, CoreException - { - - IFile file = project.getFile(new Path(dest)); - file.create(TestsPlugin.getDefault().getBundle().getEntry(source).openStream(), true, null); - Assert.assertTrue(file.exists()); - } - - protected void joinAutoBuild() throws CoreException - { - boolean interrupted = true; - while (interrupted) - { - try - { - Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null); - interrupted = false; - } - catch (InterruptedException e) - { - interrupted = true; - } - } - } - - public void testSetup() throws Exception - { - try{ - System.out.println("------ locator data setup starting"); - closeIntro(); - - IProject project1 = createSimpleProject(PROJECT1_NAME); - IFolder folder1 = createFolder(project1, FOLDER1_NAME); - copyFile(folder1, ACTUAL_TESTFILEPATH, WSDLFILE_TWO); - IFolder folder2 = createFolder(folder1, FOLDER2_NAME); - copyFile(folder2, ACTUAL_TESTFILEPATH, WSDLFILE_ONE); - IFolder folder3 = createFolder(project1, FOLDER3_NAME); - copyFile(folder3, ACTUAL_TESTFILEPATH, WSDLFILE_THREE); - copyFile(folder3, ACTUAL_TESTFILEPATH, WSDLFILE_FOUR); - - IProject project2 = createSimpleProject(PROJECT2_NAME); - copyFile(project2, ACTUAL_TESTFILEPATH, WSDLFILE_FIVE); - createFolder(project2, FOLDER4_NAME); //folder with no content - IFolder folder5 = createFolder(project2, FOLDER5_NAME); - copyFile(folder5, ACTUAL_TESTFILEPATH, WSDLFILE_SIX); - IProject project3 = createSimpleProject(PROJECT3_NAME); - copyFile(project3, ACTUAL_TESTFILEPATH, XMLFILE_ONE); - } - catch (Exception e) - { - e.printStackTrace(); - } - - //code to check workspace set up - debug - /*DataResourceVisitor visitor = new DataResourceVisitor(); - root.accept(visitor); - visitor.visit(root);*/ - - System.out.println("------ locator data setup complete"); - } - - protected class DataResourceVisitor implements IResourceVisitor - { - public boolean visit(IResource resource) throws CoreException { - if ((resource instanceof IProject) || (resource instanceof IFolder)) - { - System.out.println("visiting " + resource.getName()); - } - else if (resource instanceof IFile) - { - System.out.println("found file " + resource.getName()); - } - return true; - } - } -} diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/plugin/TestsPlugin.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/plugin/TestsPlugin.java deleted file mode 100644 index da56b67d2..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/plugin/TestsPlugin.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.eclipse.wst.ws.tests.plugin; - -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -/** - * The main plugin class to be used in the desktop. - */ -public class TestsPlugin extends Plugin { - //The shared instance. - private static TestsPlugin plugin; - - /** - * The constructor. - */ - public TestsPlugin() { - super(); - plugin = this; - } - - /** - * This method is called upon plug-in activation - */ - public void start(BundleContext context) throws Exception { - super.start(context); - } - - /** - * This method is called when the plug-in is stopped - */ - public void stop(BundleContext context) throws Exception { - super.stop(context); - plugin = null; - } - - /** - * Returns the shared instance. - */ - public static TestsPlugin getDefault() { - return plugin; - } - -} diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/AllWSJUnitTests.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/AllWSJUnitTests.java deleted file mode 100644 index c4baf9f2e..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/AllWSJUnitTests.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.eclipse.wst.ws.tests.unittest; - -import org.eclipse.wst.ws.tests.data.LocatorWorkspaceSetup; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestResult; -import junit.framework.TestSuite; -import junit.textui.TestRunner; - -/** - * This class is to run all the unittest tests. - */ -public class AllWSJUnitTests extends TestCase -{ - /** - * Method parseArgs. - * - * @param args - */ - private void parseArgs(Object args) - { - // typicially args is an array of strings, - // not sure when it wouldn't be. - } - - public static void main(String[] args) - { - new AllWSJUnitTests().runMain(args); - } - - public Object runMain(Object args) - { - Object result = null; - try - { - TestRunner testRunner = null; - - parseArgs(args); - - testRunner = new TestRunner(System.out); - - - Test suite = suite(); - TestResult testResult = testRunner.doRun(suite, false); - printHeader(testResult); - } - catch (Exception e) - { - result = e; - } - - return result; - } - - public static Test suite() - { - TestSuite testSuite = new TestSuite(); - //add unit tests to suite here... - testSuite.addTest( LocatorWorkspaceSetup.suite()); - testSuite.addTest( WebServiceFinderTests.suite()); - return testSuite; - } - - /** - * Prints the header of the report - */ - protected void printHeader(TestResult result) - { - if (result.wasSuccessful()) - { - System.out.println(); - System.out.print("OK"); - System.out.println(" (" + result.runCount() + " tests)"); - - } - else - { - System.out.println(); - System.out.println("FAILURES!!!"); - System.out.println( - "Tests run: " - + result.runCount() - + ", Failures: " - + result.failureCount() - + ", Errors: " - + result.errorCount()); - } - } -} diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/LaunchTest.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/LaunchTest.java deleted file mode 100644 index 3a6efe7b2..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/LaunchTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.eclipse.wst.ws.tests.unittest; - -import org.eclipse.core.runtime.IPlatformRunnable; - -/** - * Minimal app to run as Eclipse "application" - */ -public class LaunchTest implements IPlatformRunnable -{ - /** - * @see org.eclipse.core.runtime.IPlatformRunnable#run(Object) - */ - public Object run(Object args) throws Exception - { - - Object result = new AllWSJUnitTests().runMain(args); - - if (result != null) - { - if (result instanceof Throwable) - { - ((Throwable) result).printStackTrace(); - } - else - { - System.out.println("tests didn't return 'ok'"); - } - return result; - } - else - return IPlatformRunnable.EXIT_OK; - } -} diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/RegistryTests.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/RegistryTests.java deleted file mode 100644 index 015e3f016..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/RegistryTests.java +++ /dev/null @@ -1,275 +0,0 @@ -package org.eclipse.wst.ws.tests.unittest; - -import java.io.File; - -import junit.framework.Assert; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.wst.ws.internal.model.v10.registry.Name; -import org.eclipse.wst.ws.internal.model.v10.registry.Registry; -import org.eclipse.wst.ws.internal.model.v10.registry.RegistryFactory; -import org.eclipse.wst.ws.internal.model.v10.taxonomy.Category; -import org.eclipse.wst.ws.internal.model.v10.taxonomy.Taxonomy; -import org.eclipse.wst.ws.internal.model.v10.taxonomy.TaxonomyFactory; -import org.eclipse.wst.ws.internal.model.v10.uddiregistry.Taxonomies; -import org.eclipse.wst.ws.internal.model.v10.uddiregistry.UDDIRegistry; -import org.eclipse.wst.ws.internal.model.v10.uddiregistry.UDDIRegistryFactory; -import org.eclipse.wst.ws.internal.registry.IRegistryManager; -import org.eclipse.wst.ws.internal.registry.RegistryService; -import org.eclipse.wst.ws.internal.registry.UDDIRegistryService; - -public class RegistryTests extends TestCase -{ - public static Test suite () - { - return new TestSuite(RegistryTests.class); - } - - /** - * Creates a new Taxonomy model and passes it to - * <code>RegistryService.saveTaxonomy()</code> - * where the model is persisted to a platform - * specified temporary filesystem location. - */ - public void test_RegistryService_saveTaxonomy () - { - System.out.println("STARTING test_RegistryService_saveTaxonomy"); - try - { - System.out.println("Creating RegistryService and Taxonomy"); - RegistryService registryService = RegistryService.instance(); - Taxonomy taxonomy = registryService.newTaxonomy(); - - System.out.println("Building a simple Taxonomy model"); - taxonomy.setId("my.taxonomy"); - taxonomy.setName("My Taxonomy"); - EList list = taxonomy.getCategory(); - Category category1 = TaxonomyFactory.eINSTANCE.createCategory(); - category1.setName("My first category"); - category1.setCode("1"); - Category category2 = TaxonomyFactory.eINSTANCE.createCategory(); - category2.setName("My second category"); - category2.setCode("2"); - Category category3 = TaxonomyFactory.eINSTANCE.createCategory(); - category3.setName("My third category"); - category3.setCode("2.1"); - category2.getCategory().add(category3); - list.add(category1); - list.add(category2); - - File file = File.createTempFile("taxonomy.",".xml"); - System.out.println("Saving the Taxonomy model to "+file.getCanonicalPath()); - registryService.saveTaxonomy(file.toURL(),taxonomy); - } - catch (Throwable exc) - { - exc.printStackTrace(); - fail("Unexpected Throwable ["+exc.getMessage()+"]"); - } - finally - { - System.out.println("FINISHED test_RegistryService_saveTaxonomy\n"); - } - } - - /** - * Creates a new UDDI Registry model and passes it to - * <code>RegistryService.saveRegistry()</code> - * where the model is persisted to a platform - * specified temporary filesystem location. - */ - public void test_RegistryService_saveRegistry () - { - System.out.println("STARTING test_RegistryService_saveRegistry"); - try - { - System.out.println("Creating RegistryService, UDDIRegistryService and Registry"); - RegistryService registryService = RegistryService.instance(); - UDDIRegistryService uddiRegistryService = UDDIRegistryService.instance(); - UDDIRegistry uddiRegistry = uddiRegistryService.newUDDIRegistry(); - - System.out.println("Building a simple Registry model"); - uddiRegistry.setId("my.registry"); - uddiRegistry.setVersion("2.0"); - uddiRegistry.setDiscoveryURL("http://some.discovery.url"); - uddiRegistry.setPublicationURL("http://some.publication.url"); - uddiRegistry.setDefaultLogin("hockeyfanatic"); - Name name = RegistryFactory.eINSTANCE.createName(); - name.setValue("My Registry"); - uddiRegistry.getName().add(name); - Taxonomy taxonomyRef = registryService.newTaxonomy(); - taxonomyRef.setRef("my.taxonomy"); - Taxonomies t = uddiRegistry.getTaxonomies(); - if (t == null) - { - t = UDDIRegistryFactory.eINSTANCE.createTaxonomies(); - uddiRegistry.setTaxonomies(t); - } - EList e = t.getTaxonomy(); - e.add(taxonomyRef); - - File file = File.createTempFile("registry.",".xml"); - System.out.println("Saving the Registry model to "+file.getCanonicalPath()); - registryService.saveRegistry(file.toURL(),uddiRegistry); - } - catch (Throwable exc) - { - exc.printStackTrace(); - fail("Unexpected Throwable ["+exc.getMessage()+"]"); - } - finally - { - System.out.println("FINISHED test_RegistryService_saveRegistry\n"); - } - } - - /** - * Creates a new UDDI Registry model and a new Taxonomy - * model, associates the latter with the former, and - * drives <code>IRegistryManager.saveRegistry()</code> - * to save the models and the index document to the - * preferred location of the default registry manager. - */ - public void test_RegistryManager_saveRegistry() - { - System.out.println("STARTING test_RegistryManager_saveRegistry"); - try { - System.out.println("Creating RegistryService and Getting RegistryManager"); - RegistryService registryService = RegistryService.instance(); - IRegistryManager regManager = registryService.getDefaultRegistryManager(); - System.out.println("The location of the default index is " + regManager.getURL()); - - //build the hockey taxonomy - System.out.println("Building the hockey Taxonomy model"); - Taxonomy hockeyTaxonomy = registryService.newTaxonomy(); - hockeyTaxonomy.setId("hockey.taxonomy"); - hockeyTaxonomy.setName("hockey Taxonomy"); - EList list = hockeyTaxonomy.getCategory(); - Category category1 = TaxonomyFactory.eINSTANCE.createCategory(); - Category category4 = TaxonomyFactory.eINSTANCE.createCategory(); - category4.setName("Pro"); - category4.setCode("4"); - Category category5 = TaxonomyFactory.eINSTANCE.createCategory(); - category5.setName("AHL"); - category5.setCode("4.1"); - Category category6 = TaxonomyFactory.eINSTANCE.createCategory(); - category6.setName("NHL"); - category6.setCode("4.2"); - category1.setName("Junior"); - category1.setCode("1"); - Category category2 = TaxonomyFactory.eINSTANCE.createCategory(); - category2.setName("Midget"); - category2.setCode("2"); - Category category3 = TaxonomyFactory.eINSTANCE.createCategory(); - category3.setName("Bantam"); - category3.setCode("3"); - category4.getCategory().add(category5); - category4.getCategory().add(category6); - list.add(category1); - list.add(category2); - list.add(category3); - list.add(category4); - - //save the hockey taxonomy - Taxonomy hockeyTaxonomyRef = regManager.saveTaxonomy(hockeyTaxonomy); - - //make the hockey registry - System.out.println("Building the hockey Registry model"); - UDDIRegistryService uddiRegistryService = UDDIRegistryService.instance(); - UDDIRegistry uddiRegistry = uddiRegistryService.newUDDIRegistry(); - uddiRegistry.setId("hockey.registry"); - uddiRegistry.setVersion("2.0"); - uddiRegistry.setDefaultLogin("hockeyfanatic"); - uddiRegistry.setDiscoveryURL("http://some.discovery.url"); - uddiRegistry.setPublicationURL("http://some.publication.url"); - Name name = RegistryFactory.eINSTANCE.createName(); - name.setValue("Hockey Registry"); - uddiRegistry.getName().add(name); - - // Add the reference to the taxonomy (saved above) to the registry. - uddiRegistryService.addTaxonomy(uddiRegistry,hockeyTaxonomyRef); - - /* - UDDITaxonomyFinder UITFinder = new UDDITaxonomyFinder(); - regManager.addTaxonomyFinder(uddiRegistry.getClass().getName(),UITFinder); - */ - // Save the thing. - System.out.println("Saving the hockey Registry model"); - regManager.saveRegistry(uddiRegistry); - } - catch (Throwable exc) - { - exc.printStackTrace(); - fail("Unexpected Throwable ["+exc.getMessage()+"]"); - } - finally - { - System.out.println("FINISHED test_RegistryManager_saveRegistry\n"); - } - } - - /** - * Loads the registry and taxonomy in the index created in - * test_RegistryManager_saveRegistry, then asserts that the - * content of the model is what we expect. - */ - public void test_RegistryManager_loadRegistry() - { - System.out.println("STARTING test_RegistryManager_loadRegistry"); - try { - // Setup - System.out.println("Creating RegistryService and Getting RegistryManager"); - RegistryService registryService = RegistryService.instance(); - IRegistryManager regManager = registryService.getDefaultRegistryManager(); - - // Get the one registry URI we expect, and load the registry. - String[] registries = regManager.getRegistryURIs(); - assertEquals("Unexpected number of registries "+registries.length,registries.length,1); - String uri = registries[0]; - System.out.println("Loading registry " + uri); - Registry registry = regManager.loadRegistry(uri); - System.out.println("Found registry " + registry.getId()); - assertEquals("Did not find hockey registry","hockey.registry",registry.getId()); - - // It's supposed to be a UDDI registry. Verify it and check its values. - assertTrue("Registry is not a UDDIRegistry",(registry instanceof UDDIRegistry)); - UDDIRegistry uddiRegistry = (UDDIRegistry)registry; - assertEquals(uddiRegistry.getVersion(),"2.0"); - assertEquals(uddiRegistry.getDefaultLogin(),"hockeyfanatic"); - assertEquals(uddiRegistry.getDiscoveryURL(),"http://some.discovery.url"); - assertEquals(uddiRegistry.getPublicationURL(),"http://some.publication.url"); - - // Load the taxonomies used the UDDI registry. - UDDIRegistryService uddiRegistryService = UDDIRegistryService.instance(); - Taxonomy[] taxonomies = regManager.loadTaxonomies(uddiRegistryService.getTaxonomyURIs(uddiRegistry)); - assertEquals("Unexpected number of taxonomies "+taxonomies.length,taxonomies.length,1); - Taxonomy taxonomy = taxonomies[0]; - System.out.println("Found taxonomy " + taxonomy.getId()); - Assert.assertEquals("Did not find hockey taxonomy","hockey.taxonomy",taxonomy.getId()); - - // Dump out the values (no assertions here). - EList cList = taxonomy.getCategory(); - for(int i = 0;i<cList.size();i++){ - Category category = (Category)cList.get(i); - System.out.println("Found category " + category.getName()); - EList c2List = category.getCategory(); - for(int j = 0;j<c2List.size();j++){ - Category iCategory = (Category)c2List.get(j); - System.out.println("Found subcategory " + iCategory.getName()); - } - } - } - catch(Throwable t) - { - t.printStackTrace(); - fail("Unexpected Throwable ["+t.getMessage()+"]"); - } - finally - { - System.out.println("FINISHED test_RegistryManager_loadRegistry\n"); - } - } -} diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/ResourceUtilsTests.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/ResourceUtilsTests.java deleted file mode 100644 index 084d082cb..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/ResourceUtilsTests.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.eclipse.wst.ws.tests.unittest; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * @author sengpl - * - */ -public class ResourceUtilsTests extends TestCase implements WSJUnitConstants{ - - - public static Test suite(){ - return new TestSuite(ResourceUtilsTests.class); - } - - - -} diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/WSJUnitConstants.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/WSJUnitConstants.java deleted file mode 100644 index fce5ff980..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/WSJUnitConstants.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.eclipse.wst.ws.tests.unittest; - - -public interface WSJUnitConstants { - - public final String SERVER_INSTALL_PATH = System.getProperty("org.eclipse.jst.server.tomcat.50"); - public final String RUNTIMETYPEID_TC50 = "org.eclipse.jst.server.tomcat.runtime.50"; - - public final String WS_RUNTIMEID_AXIS = "org.eclipse.jst.ws.runtime.axis11"; - - public final String SERVERTYPEID_TC50 = "org.eclipse.jst.server.tomcat.50"; - - public final String webProjectName = "WP"; - public final String webProject2Name = "WP2"; - public final String webComponentName = "webComponent"; - public final String webComponent2Name = "webComp2"; - public final String webComp3Name = "webComp3"; - public final String webComp4Name = "webComp4"; - - - public final String ejbProjectName = "EJBProject"; - public final String ejbComponentName = "ejbComponent"; - - public final String appClientProjectName = "AppClientProject"; - public final String appClientCompName = "appClientComponent"; - - public final String earCompName = "EARComponent"; - -} diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/WebServiceFinderTests.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/WebServiceFinderTests.java deleted file mode 100644 index c01f19766..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/unittest/WebServiceFinderTests.java +++ /dev/null @@ -1,52 +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 - * yyyymmdd bug Email and other contact information - * -------- -------- ----------------------------------------------------------- - * 20060317 127456 cbrealey@ca.ibm.com - Chris Brealey - *******************************************************************************/ - -package org.eclipse.wst.ws.tests.unittest; - -import java.util.Iterator; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import org.eclipse.wst.ws.internal.wsfinder.WebServiceFinder; -import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; - -/** - * @author joan - * - */ - -public class WebServiceFinderTests extends TestCase implements WSJUnitConstants { - - public static Test suite(){ - return new TestSuite(WebServiceFinderTests.class); - } - - public void testWSFinder(){ - System.out.println("creating web service finder"); - WebServiceFinder wsf = WebServiceFinder.instance(); - - System.out.println("attempting to locate all web services in workspace"); - Iterator wsIterator = wsf.getWebServices(null); - while (wsIterator.hasNext()) { - WebServiceInfo wsInfo = (WebServiceInfo) wsIterator.next(); - System.out.println("webService URL: " + wsInfo.getWsdlURL()); - } - - System.out.println("finished finding all webservices"); - - } - -} diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/AccumulateStatusHandler.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/AccumulateStatusHandler.java deleted file mode 100644 index 8f524fb4b..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/AccumulateStatusHandler.java +++ /dev/null @@ -1,99 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.ws.tests.util; - -import java.util.Vector; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.wst.command.internal.env.core.common.StatusUtils; -import org.eclipse.wst.common.environment.Choice; -import org.eclipse.wst.common.environment.StatusException; -import org.eclipse.wst.common.environment.IStatusHandler; - -public class AccumulateStatusHandler implements IStatusHandler { - Vector statusList_; - - public AccumulateStatusHandler() - { - resetStatus(); - } - - /** - * Resets the status so that it starts out empty again. - * - */ - public void resetStatus() - { - statusList_ = new Vector(); - } - - public IStatus getStatus() - { - IStatus worstStatus = Status.OK_STATUS; - - // Find the worst error status code - for( int index = 0; index < statusList_.size(); index++ ) - { - IStatus status = (IStatus)statusList_.elementAt( index ); - - if( status.getSeverity() > worstStatus.getSeverity() ) - { - worstStatus = status; - } - } - - return StatusUtils.multiStatus( worstStatus.getMessage(), - (Status[])statusList_.toArray( new Status[0] ) ); - } - - /** - * @see org.eclipse.env.common.IStatusHandler#report(org.eclipse.env.common.Status, org.eclipse.env.common.Choice[]) - */ - public Choice report(IStatus status, Choice[] choices) - { - Choice result = null; - - // Always take the first choice if available. - if( choices != null && choices.length > 0 ) - { - result = choices[0]; - } - - statusList_.add( status ); - - return result; - } - - /** - * @see org.eclipse.env.common.IStatusHandler#report(org.eclipse.env.common.Status) - */ - public void report(IStatus status) throws StatusException - { - statusList_.add( status ); - } - - /** - * @see com.ibm.env.common.IStatusHandler#reportError(com.ibm.env.common.Status) - */ - public void reportError(IStatus status) - { - statusList_.add( status ); - } - - /** - * @see com.ibm.env.common.IStatusHandler#reportInfo(com.ibm.env.common.Status) - */ - public void reportInfo(IStatus status) - { - statusList_.add( status ); - } - -} diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/DynamicPopupJUnitWizard.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/DynamicPopupJUnitWizard.java deleted file mode 100644 index 2feea5381..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/DynamicPopupJUnitWizard.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.ws.tests.util; - -import org.eclipse.jface.operation.IRunnableContext; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.wst.command.internal.env.context.PersistentResourceContext; -import org.eclipse.wst.command.internal.env.core.data.DataFlowManager; -import org.eclipse.wst.command.internal.env.core.data.DataMappingRegistryImpl; -import org.eclipse.wst.command.internal.env.core.fragment.CommandFragment; -import org.eclipse.wst.command.internal.env.eclipse.EclipseEnvironment; -import org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager; -import org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard; -import org.eclipse.wst.common.environment.IStatusHandler; - -public class DynamicPopupJUnitWizard extends DynamicPopupWizard { - private IStatusHandler handler_; - public DynamicPopupJUnitWizard(IStatusHandler handler) - { - handler_ = handler; - } - public void runHeadLess(IStructuredSelection selection,IRunnableContext context) { - CommandFragment rootFragment = getRootFragment( selection, null ); - PersistentResourceContext resourceContext = PersistentResourceContext.getInstance(); - EclipseEnvironment environment = new EclipseEnvironment( null, resourceContext, handler_ ); - - DataMappingRegistryImpl dataRegistry_ = new DataMappingRegistryImpl(); - DataFlowManager dataManager = new DataFlowManager( dataRegistry_, environment ); - SimpleCommandEngineManager manager = new SimpleCommandEngineManager(environment, dataManager); - - commandWidgetBinding_.registerDataMappings( dataRegistry_ ); - manager.setRootFragment( rootFragment ); - manager.runForwardToNextStop( context ); - } -}
\ No newline at end of file diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/JUnitUtils.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/JUnitUtils.java deleted file mode 100644 index e5dbe7b03..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/JUnitUtils.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.ws.tests.util; - -import java.util.Enumeration; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.wst.command.internal.env.common.FileResourceUtils; -import org.eclipse.wst.command.internal.env.common.WaitForAutoBuildCommand; -import org.eclipse.wst.command.internal.env.core.context.TransientResourceContext; -import org.eclipse.wst.common.environment.IEnvironment; -import org.eclipse.wst.ws.tests.plugin.TestsPlugin; - - -public class JUnitUtils { - - // Begin: General Eclipse Utilities - public static void syncBuildProject(IProject project,IEnvironment env, IProgressMonitor monitor ) throws Exception - { - project.build(IncrementalProjectBuilder.FULL_BUILD,null); - WaitForAutoBuildCommand cmd = new WaitForAutoBuildCommand(); - cmd.setEnvironment( env ); - cmd.execute( monitor, null ); - } - - private static void copyTestFiles(String pathString,int rootSegmentLength,IFolder destFolder,IEnvironment env, IProgressMonitor monitor ) throws Exception - { - Enumeration e = TestsPlugin.getDefault().getBundle().getEntryPaths(pathString); - while (e.hasMoreElements()) - { - String filePath = (String)e.nextElement(); - if (filePath.endsWith("/")) - copyTestFiles(filePath,rootSegmentLength,destFolder,env, monitor ); - else - { - IPath fileIPath = new Path(filePath); - FileResourceUtils.copyFile(new TransientResourceContext(), - TestsPlugin.getDefault(), - fileIPath.removeLastSegments(fileIPath.segmentCount()-rootSegmentLength), // /data/<subdir> - (new Path(filePath)).removeFirstSegments(rootSegmentLength), // files after /data/<subdir> - destFolder.getFullPath(), - monitor, - env.getStatusHandler()); - } - } - } - - public static void copyTestData(String dataSubdirectory,IFolder destFolder,IEnvironment env, IProgressMonitor monitor ) throws Exception - { - String pathString = "/data/"+dataSubdirectory; - copyTestFiles(pathString,new Path(pathString).segmentCount(),destFolder,env, monitor ); - - } - -}
\ No newline at end of file diff --git a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/ScenarioConstants.java b/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/ScenarioConstants.java deleted file mode 100644 index 3a894b631..000000000 --- a/tests/org.eclipse.wst.ws.tests/tests/org/eclipse/wst/ws/tests/util/ScenarioConstants.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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.ws.tests.util; - -public class ScenarioConstants { - // Bottom up Java or EJB to Web Service wizard ID. - public static final String WIZARDID_BOTTOM_UP = "org.eclipse.jst.ws.creation.ui.wizard.serverwizard.java"; - - // Top down WSDL to Skeleton Web Service wizard ID. - public static final String WIZARDID_TOP_DOWN = "org.eclipse.jst.ws.creation.ui.wizard.serverwizard.skeleton"; - - // Web Service client wizard ID. - public static final String WIZARDID_CLIENT = "org.eclipse.jst.ws.internal.consumption.ui.wizard.client.clientwizard"; - - // Object class for: - // 1) Java source (bottom-up) - // 2) WSDL or WSIL (top-down or client). - public static final String OBJECT_CLASS_ID_IFILE = "org.eclipse.core.resources.IFile"; - - // Object class for Java compilation units (i.e. Java classes selected in the Java perspective). - public static final String OBJECT_CLASS_ID_COMPILATIONUNIT = "org.eclipse.jdt.internal.core.CompilationUnit"; - - // Object class for a service selected in the J2EE perspective (top-down or client). - public static final String OBJECT_CLASS_ID_SERVICEIMPL = "org.eclipse.wst.wsdl.Service"; - - // Object class for a WSDLResourceImpl (top-down or client). - public static final String OBJECT_CLASS_ID_WSDLSERVICEIMPL = "org.eclipse.wst.wsdl.internal.util.WSDLResourceImpl"; - - // Object class for a ServiceRef (top-down or client). - public static final String OBJECT_CLASS_ID_SERVICEREF = "org.eclipse.jst.j2ee.webservice.wsclient.ServiceRef"; - - // Object class for a ServiceImplBean (bottom-up). - public static final String OBJECT_CLASS_ID_SERVICEIMPLBEAN = "org.eclipse.jst.j2ee.webservice.wsdd.ServiceImplBean"; - - // Object class for a BeanLink (bottom-up). - public static final String OBJECT_CLASS_ID_BEANLINK = "org.eclipse.jst.j2ee.webservice.wsdd.BeanLink"; -}
\ No newline at end of file |