diff options
Diffstat (limited to 'tests/org.eclipse.jst.ws.tests.performance/src/org/eclipse/jst/ws/tests/axis/tomcat/v50/perfmsr')
3 files changed, 0 insertions, 449 deletions
diff --git a/tests/org.eclipse.jst.ws.tests.performance/src/org/eclipse/jst/ws/tests/axis/tomcat/v50/perfmsr/PerfmsrBUJavaAxisTC50.java b/tests/org.eclipse.jst.ws.tests.performance/src/org/eclipse/jst/ws/tests/axis/tomcat/v50/perfmsr/PerfmsrBUJavaAxisTC50.java deleted file mode 100644 index 2e1340c33..000000000 --- a/tests/org.eclipse.jst.ws.tests.performance/src/org/eclipse/jst/ws/tests/axis/tomcat/v50/perfmsr/PerfmsrBUJavaAxisTC50.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.eclipse.jst.ws.tests.axis.tomcat.v50.perfmsr; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.ws.internal.common.J2EEUtils; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.consumption.command.common.CreateModuleCommand; -import org.eclipse.jst.ws.tests.axis.tomcat.v50.WSWizardTomcat50Test; -import org.eclipse.jst.ws.tests.performance.util.PerformanceJUnitUtils; -import org.eclipse.jst.ws.tests.unittest.WSJUnitConstants; -import org.eclipse.jst.ws.tests.util.JUnitUtils; -import org.eclipse.jst.ws.tests.util.ScenarioConstants; -import org.eclipse.test.performance.Performance; -import org.eclipse.test.performance.PerformanceMeter; - -/** - * Bottom up performance scenario with Axis and Tomcat v5.0 - */ -public final class PerfmsrBUJavaAxisTC50 extends WSWizardTomcat50Test { - // Constants - private final String WS_RUNTIMEID_AXIS = WSJUnitConstants.WS_RUNTIMEID_AXIS; - private final String PROJECT_NAME = WSJUnitConstants.BU_PROJECT_NAME; - - private IFile sourceFile_; - - /** - * Sets up the input data; - * - create project(s), - * - copy resources to workspace - */ - protected void installInputData() throws Exception - { - - IProject webProject = ProjectUtilities.getProject(PROJECT_NAME); - IPath destPath = ResourceUtils.getJavaSourceLocation(webProject); - IFolder folder = (IFolder)ResourceUtils.findResource(destPath); - JUnitUtils.copyTestData("BUJava/src",folder,env_, null); - sourceFile_ = folder.getFile(new Path("foo/Echo.java")); - // Ensure that Echo.class is built in: - // <Web Project>/WebContent/WEB-INF/classes/foo/Echo.class - JUnitUtils.syncBuildProject(webProject,env_, null); - //assertTrue(JUnitUtils.getClassesFolderForWebProject(WEB_PROJECT_NAME).getFile(new Path("foo/Echo.class")).exists()); - - - } - - protected void createProjects() throws Exception{ - IProject webProject = ProjectUtilities.getProject(PROJECT_NAME); - if (webProject==null || !webProject.exists()){ - createWebModule(PROJECT_NAME, PROJECT_NAME,J2EEVersionConstants.J2EE_1_4_ID); - } - } - - private void createWebModule(String projectNm, String componentName, int j2eeVersion){ - - CreateModuleCommand cmc = new CreateModuleCommand(); - cmc.setJ2eeLevel(new Integer(j2eeVersion).toString()); - cmc.setModuleName(componentName); - cmc.setModuleType(CreateModuleCommand.WEB); - cmc.setProjectName(projectNm); - cmc.setServerFactoryId(SERVERTYPEID_TC50); - cmc.setServerInstanceId(server_.getId()); - cmc.execute(null, null ); - - System.out.println("Done creating Web Project, "+projectNm); - - } - - - /** - * Set the persistent server runtime context preferences - */ - protected void initJ2EEWSRuntimeServerDefaults() throws Exception - { - // Set default preferences for Axis and Tomcat 5.0 - JUnitUtils.setWSRuntimeServer(WS_RUNTIMEID_AXIS, SERVERTYPEID_TC50); - } - - /** - * Set the initial selection - */ - protected void initInitialSelection() throws Exception - { - initialSelection_ = new StructuredSelection(sourceFile_); - } - - /** - * Launches the pop-up command to initiate the scenario - * @throws Exception - */ - public void testBUJavaAxisTC50() throws Exception - { - IStatus status = Status.OK_STATUS; - IProject webProject = ProjectUtilities.getProject(PROJECT_NAME); - JUnitUtils.disableWSIDialog(webProject); - - Performance perf= Performance.getDefault(); - PerformanceMeter performanceMeter= perf.createPerformanceMeter(perf.getDefaultScenarioId(this)); - try { - - performanceMeter.start(); - PerformanceJUnitUtils.launchCreationWizard(ScenarioConstants.WIZARDID_BOTTOM_UP,ScenarioConstants.OBJECT_CLASS_ID_IFILE,initialSelection_); - performanceMeter.stop(); - - performanceMeter.commit(); - perf.assertPerformance(performanceMeter); - } - finally { - if (performanceMeter==null) - performanceMeter.dispose(); - } - - if (status.getSeverity() == Status.OK) - verifyOutput(); - else - throw new Exception(status.getException()); - - } - - /** - * Verify the scenario completed successfully - * @throws Exception - */ - private final void verifyOutput() throws Exception - { - IProject webProject = ProjectUtilities.getProject(PROJECT_NAME); - IFolder webContentFolder = (IFolder)J2EEUtils.getWebContentContainer(webProject); - - IFolder wsdlFolder = webContentFolder.getFolder("wsdl"); - assertTrue(wsdlFolder.exists()); - assertTrue(wsdlFolder.members().length > 0); - assertTrue(webContentFolder.getFolder("wsdl").members().length > 0); - - //TODO Check if wsdd contains new Web service - //TODO Check if Web serivce can be invoked by a client - } - - /** - * Clear workspace if necessary - */ - protected void deleteInputData() throws Exception - { - // Remove the EAR from the server. - IProject webProject = ProjectUtilities.getProject(PROJECT_NAME); - //JUnitUtils.removeModuleFromServer(server_,webProject,env_); - - // Delete the Web project. - webProject.delete(true,true, null); - assertFalse(webProject.exists()); - - } -}
\ No newline at end of file diff --git a/tests/org.eclipse.jst.ws.tests.performance/src/org/eclipse/jst/ws/tests/axis/tomcat/v50/perfmsr/PerfmsrClientAxisTC50.java b/tests/org.eclipse.jst.ws.tests.performance/src/org/eclipse/jst/ws/tests/axis/tomcat/v50/perfmsr/PerfmsrClientAxisTC50.java deleted file mode 100644 index c8fae0745..000000000 --- a/tests/org.eclipse.jst.ws.tests.performance/src/org/eclipse/jst/ws/tests/axis/tomcat/v50/perfmsr/PerfmsrClientAxisTC50.java +++ /dev/null @@ -1,148 +0,0 @@ -package org.eclipse.jst.ws.tests.axis.tomcat.v50.perfmsr; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.ws.internal.common.J2EEUtils; -import org.eclipse.jst.ws.internal.common.ResourceUtils; -import org.eclipse.jst.ws.internal.consumption.command.common.CreateModuleCommand; -import org.eclipse.jst.ws.tests.axis.tomcat.v50.WSWizardTomcat50Test; -import org.eclipse.jst.ws.tests.performance.util.PerformanceJUnitUtils; -import org.eclipse.jst.ws.tests.unittest.WSJUnitConstants; -import org.eclipse.jst.ws.tests.util.JUnitUtils; -import org.eclipse.jst.ws.tests.util.ScenarioConstants; -import org.eclipse.test.performance.Performance; -import org.eclipse.test.performance.PerformanceMeter; - -/** - * Client performance scenario with Axis and Tomcat v5.0 - */ -public class PerfmsrClientAxisTC50 extends WSWizardTomcat50Test { - - private final String WS_RUNTIMEID_AXIS = WSJUnitConstants.WS_RUNTIMEID_AXIS; - - private final String CLIENT_PROJECT_NAME = WSJUnitConstants.CLIENT_PROJECT_NAME; - - private IFile sourceFile_; - - protected void createProjects() throws Exception{ - IProject webProject = ProjectUtilities.getProject(CLIENT_PROJECT_NAME); - if (!webProject.exists()){ - createWebModule(CLIENT_PROJECT_NAME, CLIENT_PROJECT_NAME,J2EEVersionConstants.J2EE_1_4_ID); - } - } - - private void createWebModule(String projectNm, String componentName, int j2eeVersion){ - - CreateModuleCommand cmc = new CreateModuleCommand(); - cmc.setJ2eeLevel(new Integer(j2eeVersion).toString()); - cmc.setModuleName(componentName); - cmc.setModuleType(CreateModuleCommand.WEB); - cmc.setProjectName(projectNm); - cmc.setServerFactoryId(SERVERTYPEID_TC50); - cmc.setServerInstanceId(server_.getId()); - cmc.execute(null, null ); - - } - - /** - * Sets up the input data; - * - create project(s), - * - copy resources to workspace - */ - protected void installInputData() throws Exception { - - IProject webProject = ProjectUtilities.getProject(CLIENT_PROJECT_NAME); - IFolder destFolder = (IFolder)J2EEUtils.getWebContentContainer(webProject); - JUnitUtils.copyTestData("TDJava",destFolder,env_, null); - sourceFile_ = destFolder.getFile(new Path("Echo.wsdl")); - JUnitUtils.syncBuildProject(webProject,env_, null); - - } - - /** - * Set the persistent server runtime context preferences - */ - protected void initJ2EEWSRuntimeServerDefaults() throws Exception { - // Set default preferences for Axis and Tomcat 5.0 - JUnitUtils.setWSRuntimeServer(WS_RUNTIMEID_AXIS, SERVERTYPEID_TC50); - } - - /** - * Set the initial selection - */ - protected void initInitialSelection() throws Exception { - initialSelection_ = new StructuredSelection(sourceFile_); - } - - /** - * Launches the pop-up command to initiate the scenario - * @throws Exception - */ - public void testClientAxisTC50() throws Exception - { - IStatus status = Status.OK_STATUS; - - JUnitUtils.enableProxyGeneration(true); - JUnitUtils.enableOverwrite(true); - Performance perf= Performance.getDefault(); - PerformanceMeter performanceMeter= perf.createPerformanceMeter(perf.getDefaultScenarioId(this)); - try { - - performanceMeter.start(); - PerformanceJUnitUtils.launchCreationWizard(ScenarioConstants.WIZARDID_CLIENT,ScenarioConstants.OBJECT_CLASS_ID_IFILE,initialSelection_); - performanceMeter.stop(); - performanceMeter.commit(); - perf.assertPerformance(performanceMeter); - } - finally { - if (performanceMeter==null) - performanceMeter.dispose(); - } - - if (status.getSeverity() == Status.OK) { - verifyOutput(); - } else { - throw new Exception(status.getException()); - } - - } - - /** - * Verify the scenario completed succesfully - * @throws Exception - */ - private final void verifyOutput() throws Exception { - IProject webProject = ProjectUtilities.getProject(CLIENT_PROJECT_NAME); - - IPath destPath = ResourceUtils.getJavaSourceLocation(webProject); - IFolder srcFolder = (IFolder)ResourceUtils.findResource(destPath); - - //IFolder srcFolder = JUnitUtils.getSourceFolderForWebProject(CLIENT_PROJECT_NAME); - IFolder folder = srcFolder.getFolder("foo"); - assertTrue(folder.exists()); - assertTrue(folder.members().length > 0); - - //TODO Check that the client runs - - } - - /** - * Remove workspace if necessary - */ - protected void deleteInputData() throws Exception { - - // Delete the Web project. - IProject webProject = ProjectUtilities.getProject(CLIENT_PROJECT_NAME); - webProject.delete(true,true, null); - - } - -} diff --git a/tests/org.eclipse.jst.ws.tests.performance/src/org/eclipse/jst/ws/tests/axis/tomcat/v50/perfmsr/PerfmsrTDJavaAxisTC50.java b/tests/org.eclipse.jst.ws.tests.performance/src/org/eclipse/jst/ws/tests/axis/tomcat/v50/perfmsr/PerfmsrTDJavaAxisTC50.java deleted file mode 100644 index 07bf32e4e..000000000 --- a/tests/org.eclipse.jst.ws.tests.performance/src/org/eclipse/jst/ws/tests/axis/tomcat/v50/perfmsr/PerfmsrTDJavaAxisTC50.java +++ /dev/null @@ -1,141 +0,0 @@ -package org.eclipse.jst.ws.tests.axis.tomcat.v50.perfmsr; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.ws.internal.common.J2EEUtils; -import org.eclipse.jst.ws.internal.consumption.command.common.CreateModuleCommand; -import org.eclipse.jst.ws.tests.axis.tomcat.v50.WSWizardTomcat50Test; -import org.eclipse.jst.ws.tests.performance.util.PerformanceJUnitUtils; -import org.eclipse.jst.ws.tests.unittest.WSJUnitConstants; -import org.eclipse.jst.ws.tests.util.JUnitUtils; -import org.eclipse.jst.ws.tests.util.ScenarioConstants; -import org.eclipse.test.performance.Performance; -import org.eclipse.test.performance.PerformanceMeter; - -/** - * Top down performance scenario with Axis and Tomcat v5.0 - */ -public class PerfmsrTDJavaAxisTC50 extends WSWizardTomcat50Test { - - private final String WS_RUNTIMEID_AXIS = WSJUnitConstants.WS_RUNTIMEID_AXIS; - - private final String PROJECT_NAME = WSJUnitConstants.TD_PROJECT_NAME; - - private IFile sourceFile_; - - protected void createProjects() throws Exception{ - IProject webProject = ProjectUtilities.getProject(PROJECT_NAME); - if (!webProject.exists()){ - createWebModule(PROJECT_NAME, PROJECT_NAME,J2EEVersionConstants.J2EE_1_4_ID); - } - } - - private void createWebModule(String projectNm, String componentName, int j2eeVersion){ - - CreateModuleCommand cmc = new CreateModuleCommand(); - cmc.setJ2eeLevel(new Integer(j2eeVersion).toString()); - cmc.setModuleName(componentName); - cmc.setModuleType(CreateModuleCommand.WEB); - cmc.setProjectName(projectNm); - cmc.setServerFactoryId(SERVERTYPEID_TC50); - cmc.setServerInstanceId(server_.getId()); - cmc.execute(null, null ); - - System.out.println("Done creating Web Project, "+projectNm); - - } - - /** - * Sets up the input data; - * - create project(s), - * - copy resources to workspace - */ - protected void installInputData() throws Exception { - - IProject webProject = ProjectUtilities.getProject(PROJECT_NAME); - IFolder destFolder = (IFolder)J2EEUtils.getWebContentContainer(webProject); - JUnitUtils.copyTestData("TDJava",destFolder,env_, null); - sourceFile_ = destFolder.getFile(new Path("Echo.wsdl")); - JUnitUtils.syncBuildProject(webProject,env_, null); - } - - /** - * Set the persistent server runtime context preferences - */ - protected void initJ2EEWSRuntimeServerDefaults() throws Exception { - // Set default preferences for Axis and Tomcat v5.0 server - JUnitUtils.setWSRuntimeServer(WS_RUNTIMEID_AXIS, SERVERTYPEID_TC50); - } - - /** - * Set the initial selection - */ - protected void initInitialSelection() throws Exception { - initialSelection_ = new StructuredSelection(sourceFile_); - - } - - /** - * Launches the pop-up command to initiate the scenario - * @throws Exception - */ - public void testTDJavaAxisTC50() throws Exception { - - IStatus status = Status.OK_STATUS; - Performance perf= Performance.getDefault(); - PerformanceMeter performanceMeter= perf.createPerformanceMeter(perf.getDefaultScenarioId(this)); - try { - - performanceMeter.start(); - PerformanceJUnitUtils.launchCreationWizard(ScenarioConstants.WIZARDID_TOP_DOWN,ScenarioConstants.OBJECT_CLASS_ID_IFILE,initialSelection_); - performanceMeter.stop(); - performanceMeter.commit(); - perf.assertPerformance(performanceMeter); - } - finally { - if (performanceMeter==null) - performanceMeter.dispose(); - } - if (status.getSeverity() == Status.OK) - verifyOutput(); - else - throw new Exception(status.getException()); - - } - - /** - * Verify the scenario completed successfully - * @throws Exception - */ - private final void verifyOutput() throws Exception - { - IProject webProject = ProjectUtilities.getProject(PROJECT_NAME); - IFolder webContentFolder = (IFolder)J2EEUtils.getWebContentContainer(webProject); - - - IFolder wsdlFolder = webContentFolder.getFolder("wsdl"); - assertTrue(wsdlFolder.exists()); - assertTrue(wsdlFolder.members().length > 0); - - //TODO Verify that wsdd contains this Web service - //TODO Verify that the service can be invoked by a client - } - - /** - * Clear workspace if required - */ - protected void deleteInputData() throws Exception { - // Delete the Web project. - IProject webProject = ProjectUtilities.getProject(PROJECT_NAME); - webProject.delete(true,true,null); - - } - -} |