Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkchong2009-04-08 17:25:42 -0400
committerkchong2009-04-08 17:25:42 -0400
commit864177b58f4b7ba18dbd2310eb4d97114a92ffea (patch)
tree1e40feea4c31f7e245d02552161ec686f9460490
parenteeb685cf524dda11f0d221652fd025d4415a74e0 (diff)
downloadwebtools.webservices-864177b58f4b7ba18dbd2310eb4d97114a92ffea.tar.gz
webtools.webservices-864177b58f4b7ba18dbd2310eb4d97114a92ffea.tar.xz
webtools.webservices-864177b58f4b7ba18dbd2310eb4d97114a92ffea.zip
[263873] Axis2 JUnit tests should be in different plugin than Axis tests
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/.classpath7
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/.project28
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/META-INF/MANIFEST.MF32
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/about.html34
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/build.properties17
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/plugin.properties14
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/performance/Activator.java64
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/performance/AllPerformanceTests.java53
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/WSWizardTomcat55Test.java59
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrBUJavaAxis2TC55.java169
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrClientAxis2TC55.java160
-rw-r--r--axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrTDJavaAxis2TC55.java155
12 files changed, 792 insertions, 0 deletions
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/.classpath b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/.classpath
new file mode 100644
index 000000000..64c5e31b7
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/.project b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/.project
new file mode 100644
index 000000000..25d5af581
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jst.ws.axis2.tests.performance</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/META-INF/MANIFEST.MF b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..5fc1731eb
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/META-INF/MANIFEST.MF
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.jst.ws.axis2.tests.performance
+Bundle-Version: 1.0.0
+Bundle-Activator: org.eclipse.jst.ws.axis2.tests.performance.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.jst.ws,
+ org.eclipse.jst.j2ee.core,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.ui,
+ org.eclipse.wst.server.core,
+ org.junit;bundle-version="[3.8.0,4.0.0)",
+ org.eclipse.jst.ws.tests,
+ org.eclipse.jem.util,
+ org.eclipse.test.performance,
+ org.eclipse.wst.command.env.ui,
+ org.eclipse.wst.command.env.core,
+ org.eclipse.wst.common.environment,
+ org.eclipse.wst.common.modulecore,
+ org.eclipse.emf.ecore,
+ org.eclipse.jst.ws.consumption,
+ org.eclipse.wst.common.frameworks,
+ org.eclipse.wst.command.env,
+ org.eclipse.jst.ws.axis2.core,
+ org.eclipse.jst.ws.tests.performance
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.jst.ws.axis2.tests.tomcat.v55.perfmsr,
+ org.eclipse.jst.ws.axis2.tests.performance
+Bundle-Localization: plugin
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/about.html b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/about.html
new file mode 100644
index 000000000..2199df3f0
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/about.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>June, 2008</P>
+
+<H3>License</H3>
+
+<P>The Eclipse Foundation makes available all content in this plug-in
+("Content"). Unless otherwise indicated below, the Content is provided to you
+under the terms and conditions of the Eclipse Public License Version 1.0
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from the Eclipse Foundation, the
+Content is being redistributed by another party ("Redistributor") and different
+terms and conditions may apply to your use of any object code in the Content.
+Check the Redistributorís license that was provided with the Content. If no such
+license exists, contact the Redistributor. Unless otherwise indicated below, the
+terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at
+<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
+
+</BODY>
+</HTML>
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/build.properties b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/build.properties
new file mode 100644
index 000000000..32b5b870c
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/build.properties
@@ -0,0 +1,17 @@
+###############################################################################
+# Copyright (c) 2009 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
+###############################################################################
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ bin/,\
+ plugin.properties
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/plugin.properties b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/plugin.properties
new file mode 100644
index 000000000..60c01a103
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/plugin.properties
@@ -0,0 +1,14 @@
+###############################################################################
+# Copyright (c) 2009 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
+###############################################################################
+
+#Properties file for org.eclipse.jst.ws.axis2.tests.performance
+Bundle-Vendor = Eclipse.org
+Bundle-Name = Axis2 Performance Tests \ No newline at end of file
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/performance/Activator.java b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/performance/Activator.java
new file mode 100644
index 000000000..f73dc3b18
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/performance/Activator.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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
+ * -------- -------- -----------------------------------------------------------
+ * 20090402 263873 mahutch@ca.ibm.com - Mark Hutchinson, Move Axis2 peformance tests to new plugin
+ *******************************************************************************/
+
+package org.eclipse.jst.ws.axis2.tests.performance;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.jst.ws.axis2.tests.performance";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/performance/AllPerformanceTests.java b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/performance/AllPerformanceTests.java
new file mode 100644
index 000000000..edc11c1d6
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/performance/AllPerformanceTests.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2009 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
+ * -------- -------- -----------------------------------------------------------
+ * 20070502 185208 sengpl@ca.ibm.com - Seng Phung-Lu
+ * 20080313 126774 sengpl@ca.ibm.com - Seng Phung-Lu
+ * 20090402 263873 mahutch@ca.ibm.com - Mark Hutchinson, Move Axis2 peformance tests to new plugin
+ *******************************************************************************/
+package org.eclipse.jst.ws.axis2.tests.performance;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.jst.ws.axis2.tests.tomcat.v55.perfmsr.PerfmsrBUJavaAxis2TC55;
+import org.eclipse.jst.ws.axis2.tests.tomcat.v55.perfmsr.PerfmsrClientAxis2TC55;
+import org.eclipse.jst.ws.axis2.tests.tomcat.v55.perfmsr.PerfmsrTDJavaAxis2TC55;
+import org.eclipse.jst.ws.tests.axis.tomcat.v50.perfmsr.PerfmsrBUJavaAxisTC50;
+import org.eclipse.jst.ws.tests.axis.tomcat.v50.perfmsr.PerfmsrClientAxisTC50;
+import org.eclipse.jst.ws.tests.axis.tomcat.v50.perfmsr.PerfmsrTDJavaAxisTC50;
+
+public class AllPerformanceTests {
+
+ public static Test suite() {
+
+ TestSuite suite = new TestSuite("Test for org.eclipse.jst.ws.axis2.tests.performance");
+ //$JUnit-BEGIN$
+
+
+ // Check for Tomcat 5.5 server
+ String s = System.getProperty("org.eclipse.jst.server.tomcat.55");
+ if (s==null){
+ s = System.getProperty("tomcat55Dir");
+ }
+
+ if (s != null && s.length() > 0) {
+ suite.addTestSuite(PerfmsrBUJavaAxis2TC55.class);
+ suite.addTestSuite(PerfmsrTDJavaAxis2TC55.class);
+ suite.addTestSuite(PerfmsrClientAxis2TC55.class);
+ } else {
+ System.err.println("Warning: Tomcat 5.5 not found - performance tests skipped");
+ }
+
+ //$JUnit-END$
+ return suite;
+ }
+}
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/WSWizardTomcat55Test.java b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/WSWizardTomcat55Test.java
new file mode 100644
index 000000000..8715c3983
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/WSWizardTomcat55Test.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 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
+ * -------- -------- -----------------------------------------------------------
+ * 20070705 195553 sengpl@ca.ibm.com - Seng Phung-Lu
+ * 20090402 263873 mahutch@ca.ibm.com - Mark Hutchinson, Move Axis2 peformance tests to new plugin
+ *******************************************************************************/
+
+package org.eclipse.jst.ws.axis2.tests.tomcat.v55;
+
+import org.eclipse.jst.ws.axis2.core.context.Axis2EmitterContext;
+import org.eclipse.jst.ws.axis2.core.plugin.WebServiceAxis2CorePlugin;
+import org.eclipse.jst.ws.tests.WSWizardTest;
+import org.eclipse.jst.ws.tests.util.JUnitUtils;
+
+public abstract class WSWizardTomcat55Test extends WSWizardTest {
+
+ protected final String SERVER_INSTALL_PATH = System.getProperty("org.eclipse.jst.server.tomcat.55");
+ protected final String RUNTIME_INSTALL_PATH = System.getProperty("org.eclipse.jst.runtime.axis2");
+ protected final String RUNTIMETYPEID_TC55 = "org.eclipse.jst.server.tomcat.runtime.55";
+ protected final String SERVERTYPEID_TC55 = "org.eclipse.jst.server.tomcat.55";
+
+
+ /* (non-Javadoc)
+ * @see com.ibm.etools.webservice.was.tests.WSWizardTest#installServerRuntime()
+ */
+ protected void installServerRuntime() throws Exception {
+
+ // create server runtime
+ serverRuntime_ = JUnitUtils.createServerRuntime(RUNTIMETYPEID_TC55, SERVER_INSTALL_PATH);
+
+ // set install locations
+ Axis2EmitterContext context = WebServiceAxis2CorePlugin.getDefault().getAxisEmitterContext();
+ if (context.getAxis2RuntimeLocation()==null || context.getAxis2RuntimeLocation().equals("")){
+ String runtimePath = RUNTIME_INSTALL_PATH;
+ if (runtimePath!=null) {
+ context.setAxis2RuntimeLocation(runtimePath);
+ }
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see com.ibm.etools.webservice.was.tests.WSWizardTest#installServer()
+ */
+ protected void installServer() throws Exception {
+
+ server_ = JUnitUtils.createServer("Apache Tomcat v55", SERVERTYPEID_TC55, serverRuntime_, env_, null );
+ }
+
+}
+
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrBUJavaAxis2TC55.java b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrBUJavaAxis2TC55.java
new file mode 100644
index 000000000..2e5b200d2
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrBUJavaAxis2TC55.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 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
+ * -------- -------- -----------------------------------------------------------
+ * 20070705 195553 sengpl@ca.ibm.com - Seng Phung-Lu
+ * 20080313 126774 sengpl@ca.ibm.com - Seng Phung-Lu
+ * 20090402 263873 mahutch@ca.ibm.com - Mark Hutchinson, Move Axis2 peformance tests to new plugin
+ *******************************************************************************/
+package org.eclipse.jst.ws.axis2.tests.tomcat.v55.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.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jst.ws.axis2.tests.tomcat.v55.WSWizardTomcat55Test;
+import org.eclipse.jst.ws.internal.common.J2EEUtils;
+import org.eclipse.jst.ws.internal.common.ResourceUtils;
+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;
+import org.eclipse.wst.command.internal.env.eclipse.AccumulateStatusHandler;
+
+/**
+ * Bottom up performance scenario with Axis2 and Tomcat v5.5
+ */
+public final class PerfmsrBUJavaAxis2TC55 extends WSWizardTomcat55Test {
+ // Constants
+ private final String WS_RUNTIMEID_AXIS = WSJUnitConstants.WS_RUNTIMEID_AXIS2;
+ private final String PROJECT_NAME = "BUAxis2Web";
+
+ 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.disableValidation(webProject);
+ 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()){
+ JUnitUtils.createWebModule(PROJECT_NAME, PROJECT_NAME, server_.getId(), SERVERTYPEID_TC55, "14", env_, new NullProgressMonitor());
+ }
+ }
+
+ /**
+ * Set the persistent server runtime context preferences
+ */
+ protected void initJ2EEWSRuntimeServerDefaults() throws Exception
+ {
+ // Set default preferences for Axis2 and Tomcat 5.5
+ JUnitUtils.setWSRuntimeServer(WS_RUNTIMEID_AXIS, SERVERTYPEID_TC55);
+ JUnitUtils.setServiceScenarioDefault();
+ }
+
+ /**
+ * 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 testBUJavaAxis2TC55() throws Exception
+ {
+ IStatus[] status;
+ IProject webProject = ProjectUtilities.getProject(PROJECT_NAME);
+ JUnitUtils.disableWSIDialog(webProject);
+ JUnitUtils.enableOverwrite(true);
+ JUnitUtils.setRuntimePreference(WS_AXIS2_RUNTIME);
+
+
+ Performance perf= Performance.getDefault();
+ PerformanceMeter performanceMeter= perf.createPerformanceMeter(perf.getDefaultScenarioId(this));
+ try {
+
+ performanceMeter.start();
+ status = 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();
+ }
+
+ verifyOutput(status);
+
+ }
+
+ /**
+ * Verify the scenario completed successfully
+ * @throws Exception
+ */
+ private final void verifyOutput(IStatus[] status) throws Exception
+ {
+ IProject webProject = ProjectUtilities.getProject(PROJECT_NAME);
+ IFolder webContentFolder = (IFolder)J2EEUtils.getWebContentContainer(webProject);
+
+ IFolder webInfFolder = webContentFolder.getFolder("WEB-INF");
+ IFolder servicesFolder = webInfFolder.getFolder("services");
+ assertTrue(servicesFolder.exists());
+ IFolder wsFolder = servicesFolder.getFolder("Echo");
+ assertTrue(wsFolder.exists());
+ assertTrue(wsFolder.members().length > 0);
+
+ AccumulateStatusHandler statusHandler = new AccumulateStatusHandler(status);
+ IStatus[] s = statusHandler.getErrorReports();
+ //show errors
+ if (s.length > 0){
+ for (int i=0;i<s.length;i++){
+ System.out.println("BUJava Error message for report #"+i+": "+s[i].getMessage());
+ }
+ }
+ assertTrue(s.length == 0);
+ }
+
+ /**
+ * 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());
+
+ }
+}
diff --git a/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrClientAxis2TC55.java b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrClientAxis2TC55.java
new file mode 100644
index 000000000..449b48be5
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrClientAxis2TC55.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 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
+ * -------- -------- -----------------------------------------------------------
+ * 20070705 195553 sengpl@ca.ibm.com - Seng Phung-Lu
+ * 20080313 126774 sengpl@ca.ibm.com - Seng Phung-Lu
+ * 20090402 263873 mahutch@ca.ibm.com - Mark Hutchinson, Move Axis2 peformance tests to new plugin
+ *******************************************************************************/
+package org.eclipse.jst.ws.axis2.tests.tomcat.v55.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.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jst.ws.axis2.tests.tomcat.v55.WSWizardTomcat55Test;
+import org.eclipse.jst.ws.internal.common.J2EEUtils;
+import org.eclipse.jst.ws.internal.common.ResourceUtils;
+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;
+import org.eclipse.wst.command.internal.env.eclipse.AccumulateStatusHandler;
+
+/**
+ * Client performance scenario with Axis2 and Tomcat v5.5
+ */
+public class PerfmsrClientAxis2TC55 extends WSWizardTomcat55Test {
+
+ private final String WS_RUNTIMEID_AXIS = WSJUnitConstants.WS_RUNTIMEID_AXIS2;
+
+ private final String CLIENT_PROJECT_NAME = "ClientAxis2Web";
+
+ private IFile sourceFile_;
+
+ protected void createProjects() throws Exception{
+ IProject webProject = ProjectUtilities.getProject(CLIENT_PROJECT_NAME);
+ if (!webProject.exists()){
+ JUnitUtils.createWebModule(CLIENT_PROJECT_NAME, CLIENT_PROJECT_NAME, server_.getId(),SERVERTYPEID_TC55, "14", env_, new NullProgressMonitor());
+ }
+ }
+
+ /**
+ * 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.disableValidation(webProject);
+ 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.5
+ JUnitUtils.setWSRuntimeServer(WS_RUNTIMEID_AXIS, SERVERTYPEID_TC55);
+ JUnitUtils.setClientScenarioDefault();
+ }
+
+ /**
+ * 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 testClientAxis2TC55() throws Exception
+ {
+ IStatus[] status;
+
+ JUnitUtils.enableProxyGeneration(true);
+ JUnitUtils.enableOverwrite(true);
+ JUnitUtils.setRuntimePreference(WS_AXIS2_RUNTIME);
+
+
+ Performance perf= Performance.getDefault();
+ PerformanceMeter performanceMeter= perf.createPerformanceMeter(perf.getDefaultScenarioId(this));
+ try {
+
+ performanceMeter.start();
+ status = PerformanceJUnitUtils.launchCreationWizard(ScenarioConstants.WIZARDID_CLIENT,ScenarioConstants.OBJECT_CLASS_ID_IFILE,initialSelection_);
+ performanceMeter.stop();
+ performanceMeter.commit();
+ perf.assertPerformance(performanceMeter);
+ }
+ finally {
+ if (performanceMeter==null)
+ performanceMeter.dispose();
+ }
+
+ verifyOutput(status);
+
+
+ }
+
+ /**
+ * Verify the scenario completed succesfully
+ * @throws Exception
+ */
+ private final void verifyOutput(IStatus[] status) 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);
+
+ AccumulateStatusHandler statusHandler = new AccumulateStatusHandler(status);
+ IStatus[] s = statusHandler.getErrorReports();
+ //
+ if (s.length > 0){
+ for (int i=0;i<s.length;i++){
+ System.out.println("Error message for report #"+i+": "+s[i].getMessage());
+ }
+ }
+ assertTrue(s.length == 0);
+
+ }
+
+ /**
+ * 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/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrTDJavaAxis2TC55.java b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrTDJavaAxis2TC55.java
new file mode 100644
index 000000000..3953bbc94
--- /dev/null
+++ b/axis2/tests/org.eclipse.jst.ws.axis2.tests.performance/src/org/eclipse/jst/ws/axis2/tests/tomcat/v55/perfmsr/PerfmsrTDJavaAxis2TC55.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2009 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
+ * -------- -------- -----------------------------------------------------------
+ * 20070705 195553 sengpl@ca.ibm.com - Seng Phung-Lu
+ * 20080313 126774 sengpl@ca.ibm.com - Seng Phung-Lu
+ * 20090402 263873 mahutch@ca.ibm.com - Mark Hutchinson, Move Axis2 peformance tests to new plugin
+ *******************************************************************************/
+package org.eclipse.jst.ws.axis2.tests.tomcat.v55.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.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jst.ws.axis2.tests.tomcat.v55.WSWizardTomcat55Test;
+import org.eclipse.jst.ws.internal.common.J2EEUtils;
+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;
+import org.eclipse.wst.command.internal.env.eclipse.AccumulateStatusHandler;
+
+/**
+ * Top down performance scenario with Axis2 and Tomcat v5.5
+ */
+public class PerfmsrTDJavaAxis2TC55 extends WSWizardTomcat55Test {
+
+ private final String WS_RUNTIMEID_AXIS = WSJUnitConstants.WS_RUNTIMEID_AXIS2;
+
+ private final String PROJECT_NAME = "TDAxis2Web";
+
+ private IFile sourceFile_;
+
+ protected void createProjects() throws Exception{
+ IProject webProject = ProjectUtilities.getProject(PROJECT_NAME);
+ if (!webProject.exists()){
+ JUnitUtils.createWebModule(PROJECT_NAME, PROJECT_NAME, server_.getId(), SERVERTYPEID_TC55, "14", env_, new NullProgressMonitor());
+ }
+ }
+
+ /**
+ * 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.disableValidation(webProject);
+ 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.5 server
+ JUnitUtils.setWSRuntimeServer(WS_RUNTIMEID_AXIS, SERVERTYPEID_TC55);
+ JUnitUtils.setServiceScenarioDefault();
+ }
+
+ /**
+ * 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 testTDJavaAxis2TC55() throws Exception {
+
+ IStatus[] status;
+ JUnitUtils.enableOverwrite(true);
+ JUnitUtils.setRuntimePreference(WS_AXIS2_RUNTIME);
+
+
+ Performance perf= Performance.getDefault();
+ PerformanceMeter performanceMeter= perf.createPerformanceMeter(perf.getDefaultScenarioId(this));
+ try {
+
+ performanceMeter.start();
+ status = 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();
+ }
+
+ verifyOutput(status);
+
+
+ }
+
+ /**
+ * Verify the scenario completed successfully
+ * @throws Exception
+ */
+ private final void verifyOutput(IStatus[] status) throws Exception
+ {
+ IProject webProject = ProjectUtilities.getProject(PROJECT_NAME);
+ IFolder webContentFolder = (IFolder)J2EEUtils.getWebContentContainer(webProject);
+
+ IFolder webInfFolder = webContentFolder.getFolder("WEB-INF");
+ IFolder servicesFolder = webInfFolder.getFolder("services");
+ assertTrue(servicesFolder.exists());
+ IFolder wsFolder = servicesFolder.getFolder("EchoService");
+ assertTrue(wsFolder.exists());
+ assertTrue(wsFolder.members().length > 0);
+
+ AccumulateStatusHandler statusHandler = new AccumulateStatusHandler(status);
+ IStatus[] s = statusHandler.getErrorReports();
+ //
+ if (s.length > 0){
+ for (int i=0;i<s.length;i++){
+ System.out.println("TDJava Error message for report #"+i+": "+s[i].getMessage());
+ }
+ }
+ assertTrue(s.length == 0);
+ }
+
+ /**
+ * Clear workspace if required
+ */
+ protected void deleteInputData() throws Exception {
+ // Delete the Web project.
+ IProject webProject = ProjectUtilities.getProject(PROJECT_NAME);
+ webProject.delete(true,true,null);
+
+ }
+
+}

Back to the top