Author: dgolovin
Date: 2009-02-25 04:42:29 -0500 (Wed, 25 Feb 2009)
New Revision: 13790
Added:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/reporting/
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizardTest.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/global/ReportProblemActionDelegate.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizard.java
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime2/VerifyWizard.java
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam20XFacetTestSuite201GA.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12XOperationsTestSuite121EAP.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20XOperationsTestSuite201GA.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2850 make seam tests 6 times faster to minimize
impact of test execution time during execution the same test suits with different
configurations
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/global/ReportProblemActionDelegate.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/global/ReportProblemActionDelegate.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/global/ReportProblemActionDelegate.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -36,9 +36,9 @@
ReportProblemWizard wizard = new ReportProblemWizard();
Properties p = new Properties();
- p.setProperty("help", "ReportProblemWizard");
+ p.setProperty(ReportProblemWizard.Property.HELP, "ReportProblemWizard");
wizard.setObject(p);
- wizard.execute();
+ wizard.execute();
}
public void selectionChanged(IAction action, ISelection selection) {}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizard.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizard.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -19,6 +19,16 @@
import org.jboss.tools.common.model.ui.ModelUIPlugin;
public class AbstractQueryWizard implements SpecialWizard {
+
+ public static class Property {
+ public static final String HELP = "help";
+ public static final String MODAL = "modal";
+ public static final String TITLE = "title";
+ public static final String SUBTITLE = "subtitle";
+ public static final String MESSAGE = "message";
+ public static final String BLOCKING = "blocking";
+ }
+
private AbstractQueryWizardView view = null;
public void dispose() {
@@ -42,16 +52,18 @@
if(key == null) {
//put debuggin here
} else {
- String title = p.getProperty("title");
+ String title = p.getProperty(Property.TITLE);
if(title == null) title = WizardKeys.getHeader(key);
if(title == null) title = WizardKeys.getHeader("Properties"); // NON-NLS-1
if(title == null) title = "Title is not found for key \"" + key +
"\"";
view.setWindowTitle(title);
- String subtitle = p.getProperty("subtitle");
+
+ String subtitle = p.getProperty(Property.SUBTITLE);
if(subtitle == null) subtitle = WizardKeys.getTitle(key);
if(subtitle == null) subtitle = "Subtitle is not found for key \"" +
key + "\"";
view.setTitle(subtitle);
- String message = p.getProperty("message");
+
+ String message = p.getProperty(Property.MESSAGE);
if(message == null) message = WizardKeys.getString(key + ".Message");
if(message != null) view.setMessage(message);
}
@@ -90,15 +102,15 @@
public int execute() {
Shell shell =
ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
IQueryDialog dialog = createDialog(shell);
- dialog.setView(view);
- dialog.getDialog().create();
- view.setDialog(dialog.getDialog());
dialog.getDialog().open();
return view.code();
}
- protected IQueryDialog createDialog(Shell shell) {
- return new AbstractQueryDialog(shell);
+ public IQueryDialog createDialog(Shell shell) {
+ IQueryDialog dialog = new AbstractQueryDialog(shell);
+ dialog.setView(view);
+ dialog.getDialog().create();
+ view.setDialog(dialog.getDialog());
+ return dialog;
}
-
}
Modified:
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime2/VerifyWizard.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime2/VerifyWizard.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/common/plugins/org.jboss.tools.common.verification.ui/src/org/jboss/tools/common/verification/ui/vrules/wizard/runtime2/VerifyWizard.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -20,7 +20,7 @@
setView(new VerifyWizardView());
}
- protected IQueryDialog createDialog(Shell shell) {
+ public IQueryDialog createDialog(Shell shell) {
return new VerifyDialog(shell);
}
Added:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizardTest.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizardTest.java
(rev 0)
+++
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizardTest.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.model.ui.reporting;
+
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.ui.wizards.query.IQueryDialog;
+
+import junit.framework.TestCase;
+
+/**
+ * @author eskimo
+ *
+ */
+public class ReportProblemWizardTest extends TestCase {
+ public void testReportProblemWizard() {
+ Shell shell =
ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
+ IQueryDialog reportWiz = new ReportProblemWizard().createDialog(shell);
+ reportWiz.getDialog().setBlockOnOpen(false);
+ reportWiz.getDialog().open();
+ reportWiz.getDialog().close();
+ }
+}
Property changes on:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/reporting/ReportProblemWizardTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java
===================================================================
---
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/common/tests/org.jboss.tools.common.model.ui.test/src/org/jboss/tools/common/model/ui/test/ModelUiAllTests.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -10,14 +10,14 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.test;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
import org.jboss.tools.common.core.jdt.test.FavoritesClassControllerTest;
-import org.jboss.tools.common.model.ui.dialog.MessageAndCheckboxDialog;
import org.jboss.tools.common.model.ui.dialog.test.ErrorDialogTest;
import org.jboss.tools.common.model.ui.dialog.test.MessageAndCheckboxDialogTest;
+import org.jboss.tools.common.model.ui.reporting.ReportProblemWizardTest;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
/**
* @author eskimo
*
@@ -33,6 +33,7 @@
suite.addTestSuite(FavoritesClassControllerTest.class);
suite.addTestSuite(ErrorDialogTest.class);
suite.addTestSuite(MessageAndCheckboxDialogTest.class);
+ suite.addTestSuite(ReportProblemWizardTest.class);
return suite;
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam20XFacetTestSuite201GA.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam20XFacetTestSuite201GA.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam20XFacetTestSuite201GA.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -10,6 +10,10 @@
******************************************************************************/
package org.jboss.tools.seam.core.test.project.facet;
+import org.jboss.tools.test.util.JobUtils;
+
+import junit.extensions.TestSetup;
+import junit.framework.Test;
import junit.framework.TestSuite;
@@ -18,9 +22,32 @@
*
*/
public class Seam20XFacetTestSuite201GA {
- public static TestSuite suite() {
+ public static final Test suite() {
TestSuite suite = new TestSuite("Seam 2.0.X tests");
- suite.addTestSuite(Seam2FacetInstallDelegateTest.class);
+ suite.addTest(new Seam2FacetInstallDelegateTestSetup(new
TestSuite(Seam2FacetInstallDelegateTest.class)));
return suite;
}
+
+ public static class Seam2FacetInstallDelegateTestSetup extends TestSetup {
+
+ Seam2FacetInstallDelegateTest delegate = new
Seam2FacetInstallDelegateTest("Delegate");
+ @Override
+ protected void setUp() throws Exception {
+ delegate.setUp();
+ JobUtils.waitForIdle(50);
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ delegate.tearDown();
+ }
+
+ /**
+ * @param test
+ */
+ public Seam2FacetInstallDelegateTestSetup(Test test) {
+ super(test);
+ }
+
+ }
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -22,6 +22,7 @@
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
@@ -56,7 +57,7 @@
suspendAllValidation = ValidationFramework.getDefault().isSuspended();
ValidationFramework.getDefault().suspendAllValidation(true);
- ws.removeResourceChangeListener( EventManager.getManager() );
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener( EventManager.getManager()
);
// commented to run tests on wtp 3.0.4 build
// ws.removeResourceChangeListener( ValManager.getDefault() );
//EventManager.getManager().shutdown();
@@ -68,20 +69,18 @@
seam2Facet = ProjectFacetsManager.getProjectFacet("jst.seam");
seam2FacetVersion = seam2Facet.getVersion("2.0");
-
File folder = getSeamHomeFolder();
SeamRuntimeManager.getInstance().addRuntime(SEAM_2_0_0, folder.getAbsolutePath(),
SeamVersion.SEAM_2_0, true);
SeamRuntimeManager.getInstance().findRuntimeByName(SEAM_2_0_0);
-
- warProject = createSeamWarProject("warprj");
- earProject = createSeamEarProject("earprj");
+ IProject war =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("warprj");
+ warProject = (war!=null ? ProjectFacetsManager.create(war, false,
+ null): createSeamWarProject("warprj"));
+ IProject ear =
(IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("earprj");
+ earProject = (ear!=null? ProjectFacetsManager.create(ear, false,
+ null):createSeamEarProject("earprj"));
- warProject.getProject().getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE,
null);
-
-
-
- super.setUp();
+ //warProject.getProject().getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE,
null);
}
@Override
@@ -90,7 +89,7 @@
ValidationFramework.getDefault().suspendAllValidation(suspendAllValidation);
XJob.setSuspended(suspendXJobs);
- ws.addResourceChangeListener(EventManager.getManager(),
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(EventManager.getManager(),
IResourceChangeEvent.PRE_CLOSE | IResourceChangeEvent.PRE_DELETE |
IResourceChangeEvent.POST_BUILD | IResourceChangeEvent.PRE_BUILD |
IResourceChangeEvent.POST_CHANGE);
// ws.addResourceChangeListener(ValOperationManager.getDefault(),
@@ -350,7 +349,6 @@
public void testCreateEar() throws CoreException, IOException {
-
}
@Override
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -38,6 +38,7 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.validation.ValidationFramework;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
@@ -71,6 +72,7 @@
private static final IUndoableOperation CREATE_SEAM_ENTITY = new
SeamEntityCreateOperation();
protected final Set<IResource> resourcesToCleanup = new
HashSet<IResource>();
+ private boolean suspendAllValidation = false;
private static final IProjectFacet seamFacet;
@@ -84,14 +86,19 @@
}
protected void setUp() throws Exception {
-
+ suspendAllValidation = ValidationFramework.getDefault().isSuspended();
+ ValidationFramework.getDefault().suspendAllValidation(true);
JobUtils.waitForIdle();
-
-
-
-
}
+
+ @Override
+ protected void tearDown() throws Exception {
+ // TODO Auto-generated method stub
+ super.tearDown();
+ ValidationFramework.getDefault().suspendAllValidation(suspendAllValidation);
+ }
+
abstract protected IProject getProject();
abstract void setUpSeamProjects();
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -15,6 +15,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -55,8 +56,9 @@
SeamRuntimeManager.getInstance().addRuntime(getSeamRTName(), folder.getAbsolutePath(),
getSeamRTVersion(getSeamRTName()), true);
SeamRuntime sr = SeamRuntimeManager.getInstance().findRuntimeByName(getSeamRTName());
assertNotNull("An error occured while getting the SEAM RUN-TIME for: " +
getSeamRTName(), sr);
-
- if (earProject == null && earEjbProject == null && earEarProject ==
null && testProject == null)
+
+ IResource project =
ResourcesPlugin.getWorkspace().getRoot().findMember(SEAM_EAR_PROJECTNAME);
+ if (project== null && earProject == null && earEjbProject == null
&& earEarProject == null && testProject == null)
createSeamEarProject(SEAM_EAR_PROJECTNAME);
try {
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -50,9 +51,11 @@
SeamRuntimeManager.getInstance().addRuntime(getSeamRTName(), folder.getAbsolutePath(),
getSeamRTVersion(getSeamRTName()), true);
SeamRuntime sr = SeamRuntimeManager.getInstance().findRuntimeByName(getSeamRTName());
assertNotNull("An error occured while getting the SEAM RUN-TIME for: " +
getSeamRTName(), sr);
-
- createSeamWarProject(SEAM_WAR_PROJECTNAME);
+ IResource project =
ResourcesPlugin.getWorkspace().getRoot().findMember(SEAM_WAR_PROJECTNAME);
+ if(project==null) {
+ createSeamWarProject(SEAM_WAR_PROJECTNAME);
+ }
try {
JobUtils.waitForIdle();
} catch (Exception e) {
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12XOperationsTestSuite121EAP.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12XOperationsTestSuite121EAP.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12XOperationsTestSuite121EAP.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.seam.ui.test.wizard;
+import junit.extensions.TestSetup;
+import junit.framework.Test;
import junit.framework.TestSuite;
/**
@@ -17,11 +19,55 @@
*
*/
public class Seam12XOperationsTestSuite121EAP {
- public static TestSuite suite() {
+ public static Test suite() {
TestSuite suite = new TestSuite();
suite.setName("Seam 1.2.X Operations Tests");
- suite.addTestSuite(Seam12EARNewOperationTest.class);
- suite.addTestSuite(Seam12WARNewOperationTest.class);
+ suite.addTest(
+ new Seam12EARNewOperationTestSetup(
+ new TestSuite(Seam12EARNewOperationTest.class)));
+ suite.addTest(
+ new Seam12WARNewOperationTestSetup(
+ new TestSuite(Seam12WARNewOperationTest.class)));
return suite;
}
+
+ public static class Seam12EARNewOperationTestSetup extends TestSetup {
+ Seam12EARNewOperationTest delegate = new
Seam12EARNewOperationTest("delegate");
+ /**
+ * @param test
+ */
+ public Seam12EARNewOperationTestSetup(Test test) {
+ super(test);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ delegate.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ delegate.tearDown();
+ }
+ }
+
+ public static class Seam12WARNewOperationTestSetup extends TestSetup {
+ Seam12WARNewOperationTest delegate = new
Seam12WARNewOperationTest("delegate");
+ /**
+ * @param test
+ */
+ public Seam12WARNewOperationTestSetup(Test test) {
+ super(test);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ delegate.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ delegate.tearDown();
+ }
+ }
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20XOperationsTestSuite201GA.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20XOperationsTestSuite201GA.java 2009-02-25
09:04:27 UTC (rev 13789)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20XOperationsTestSuite201GA.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.seam.ui.test.wizard;
+import junit.extensions.TestSetup;
+import junit.framework.Test;
import junit.framework.TestSuite;
/**
@@ -18,12 +20,56 @@
*/
public class Seam20XOperationsTestSuite201GA {
- public static TestSuite suite() {
+ public static final Test suite() {
TestSuite suite = new TestSuite();
suite.setName("Seam 2.0.X Operations Test");
- suite.addTestSuite(Seam20EARNewOperationTest.class);
- suite.addTestSuite(Seam20WARNewOperationTest.class);
+ suite.addTest(
+ new Seam20EARNewOperationTestSetup(
+ new TestSuite(Seam20EARNewOperationTest.class)));
+ suite.addTest(
+ new Seam20WARNewOperationTestSetup(
+ new TestSuite(Seam20WARNewOperationTest.class)));
return suite;
}
+ public static class Seam20EARNewOperationTestSetup extends TestSetup {
+ Seam20EARNewOperationTest delegate = new
Seam20EARNewOperationTest("delegate");
+
+ /**
+ * @param test
+ */
+ public Seam20EARNewOperationTestSetup(Test test) {
+ super(test);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ delegate.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ delegate.tearDown();
+ }
+ }
+
+ public static class Seam20WARNewOperationTestSetup extends TestSetup {
+ Seam20WARNewOperationTest delegate = new
Seam20WARNewOperationTest("delegate");
+ /**
+ * @param test
+ */
+ public Seam20WARNewOperationTestSetup(Test test) {
+ super(test);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ delegate.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ delegate.tearDown();
+ }
+ }
}
Added:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java
===================================================================
---
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java
(rev 0)
+++
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java 2009-02-25
09:42:29 UTC (rev 13790)
@@ -0,0 +1,52 @@
+/**
+ *
+ */
+package org.jboss.tools.tests;
+
+import java.beans.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.beans.Statement;
+import java.util.Properties;
+
+import junit.framework.Test;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+/**
+ * @author eskimo
+ *
+ */
+public class TestSuiteWithParams extends TestSuite {
+
+ Properties parameters = new Properties();
+
+ public TestSuiteWithParams(Class theClass, Properties params) {
+ super(theClass);
+ this.parameters.putAll(params);
+ }
+
+ @Override
+ public void runTest(Test test, TestResult result) {
+
+ for (Object property : parameters.keySet()) {
+ String propertyName = property.toString();
+ try {
+ PropertyDescriptor propertyDescr = new
PropertyDescriptor(propertyName,test.getClass());
+ Statement setPropertyStatement =
+ new Statement(
+ test,propertyDescr.getWriteMethod().getName(),new
Object[]{parameters.get(property)});
+ setPropertyStatement.execute();
+ } catch (IntrospectionException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+ super.runTest(test, result);
+ }
+
+
+}
Property changes on:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/TestSuiteWithParams.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain