[331381] Move JUnits that depend on Java SE 1.6 to new plugin that requires Java SE 1.6
diff --git a/tests/org.eclipse.jst.j2ee.tests/build.properties b/tests/org.eclipse.jst.j2ee.tests/build.properties index d0b1dd2..d7fb32c 100644 --- a/tests/org.eclipse.jst.j2ee.tests/build.properties +++ b/tests/org.eclipse.jst.j2ee.tests/build.properties
@@ -20,9 +20,11 @@ testHOLD.xml,\ about.html,\ DefectTestData/,\ - META-INF/ + META-INF/,\ + bvt.properties src.includes = build.properties,\ testHOLD.xml,\ plugin.xml,\ TestData/,\ - DefectTestData/ + DefectTestData/,\ + bvt.properties
diff --git a/tests/org.eclipse.jst.j2ee.tests/bvt.properties b/tests/org.eclipse.jst.j2ee.tests/bvt.properties index 2857d59..762b351 100644 --- a/tests/org.eclipse.jst.j2ee.tests/bvt.properties +++ b/tests/org.eclipse.jst.j2ee.tests/bvt.properties
@@ -14,10 +14,10 @@ # To run individual buckets, comment out org.eclipse.jst.j2ee.tests.bvt.ALL and # uncomment the corresponding properties. -org.eclipse.jst.j2ee.tests.bvt.ALL = true -#org.eclipse.jst.j2ee.tests.bvt.EnterpriseBVT = true -#org.eclipse.jst.j2ee.tests.bvt.EJBBVT = true -#org.eclipse.jst.j2ee.tests.bvt.WebBVT = true -#org.eclipse.jst.j2ee.tests.bvt.CoreInfrastructureBVT = true -#org.eclipse.jst.j2ee.tests.bvt.ModelProviderBVT = true -#org.eclipse.jst.j2ee.tests.bvt.ExtendedModelProviderBVT = true +#org.eclipse.jst.j2ee.tests.bvt.ALL = true +org.eclipse.jst.j2ee.tests.bvt.EnterpriseBVT = true +org.eclipse.jst.j2ee.tests.bvt.EJBBVT = true +org.eclipse.jst.j2ee.tests.bvt.WebBVT = true +org.eclipse.jst.j2ee.tests.bvt.CoreInfrastructureBVT = true +org.eclipse.jst.j2ee.tests.bvt.ModelProviderBVT = true +org.eclipse.jst.j2ee.tests.bvt.ExtendedModelProviderBVT = true
diff --git a/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/appclient/operations/AppClientImportOperationBaseTest.java b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/appclient/operations/AppClientImportOperationBaseTest.java new file mode 100644 index 0000000..e960b22 --- /dev/null +++ b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/appclient/operations/AppClientImportOperationBaseTest.java
@@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (c) 2010 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.wtp.j2ee.headless.tests.appclient.operations; + +import org.eclipse.jst.j2ee.applicationclient.internal.creation.AppClientComponentImportDataModelProvider; +import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties; +import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; +import org.eclipse.wst.common.frameworks.datamodel.IDataModel; +import org.eclipse.wtp.j2ee.headless.tests.j2ee.operations.ModuleImportOperationTest; + +public abstract class AppClientImportOperationBaseTest extends ModuleImportOperationTest{ + + + + public AppClientImportOperationBaseTest() { + super("AppClientImportOperationBaseTests"); + } + + public AppClientImportOperationBaseTest(String name) { + super(name); + } + + @Override + protected String getModuleExtension() { + return ".jar"; + } + + @Override + protected IDataModel getImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose) { + return getAppClientImportDataModel(filePath, projectName, creationModel, closeArchiveOnDispose); + } + + public static IDataModel getAppClientImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose) { + IDataModel importModel = DataModelFactory.createDataModel(new AppClientComponentImportDataModelProvider()); + + importModel.setProperty(IJ2EEComponentImportDataModelProperties.FILE_NAME, filePath); + importModel.setProperty(IJ2EEComponentImportDataModelProperties.PROJECT_NAME, projectName); + importModel.setProperty(IJ2EEComponentImportDataModelProperties.CLOSE_ARCHIVE_ON_DISPOSE, closeArchiveOnDispose); + + if(creationModel != null) { + importModel.setProperty(IJ2EEComponentImportDataModelProperties.NESTED_MODEL_J2EE_COMPONENT_CREATION, creationModel); + } + + return importModel; + } + + @Override + protected IDataModel getExportDataModel(String projectName, String destination, boolean exportSource, boolean runBuild, boolean overwriteExisting) { + return AppClientExportOperationTest.getAppClientExportDataModel(projectName, destination, exportSource, runBuild, overwriteExisting); + } + + +}
diff --git a/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/appclient/operations/AppClientImportOperationTest.java b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/appclient/operations/AppClientImportOperationTest.java index 82ef5d9..23c0e59 100644 --- a/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/appclient/operations/AppClientImportOperationTest.java +++ b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/appclient/operations/AppClientImportOperationTest.java
@@ -8,12 +8,7 @@ import junit.framework.Test; -import org.eclipse.jst.j2ee.applicationclient.internal.creation.AppClientComponentImportDataModelProvider; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; import org.eclipse.wst.common.tests.SimpleTestSuite; -import org.eclipse.wtp.j2ee.headless.tests.j2ee.operations.ModuleImportOperationTest; /** * @author Administrator @@ -22,9 +17,7 @@ * To change the template for this generated type comment go to Window - Preferences - Java - Code * Generation - Code and Comments */ -public class AppClientImportOperationTest extends ModuleImportOperationTest { - - +public class AppClientImportOperationTest extends AppClientImportOperationBaseTest { public AppClientImportOperationTest() { super("AppClientImportOperationTests"); @@ -50,16 +43,6 @@ runImportTests_All("AC14_Defaults"); } - public void testACImport50_Defaults() throws Exception { - runImportTests_All("AC50_Defaults"); - } - - //TODO -- annotations to scan? - //EE6TODO -// public void testACImport60_Defaults() throws Exception { -// runImportTests_All("AC60_Defaults"); -// } - public void testACImport12_NoDefaultClass() throws Exception{ runImportTests_All("AC12_NoDefaultClass"); } @@ -71,17 +54,7 @@ public void testACImport14_NoDefaultClass() throws Exception { runImportTests_All("AC14_NoDefaultClass"); } - - public void testACImport50_NoDefaultClass() throws Exception { - runImportTests_All("AC50_NoDefaultClass"); - } - - //TODO -- annotations to scan? - //EE6TODO -// public void testACImport60_NoDefaultClass() throws Exception { -// runImportTests_All("AC60_NoDefaultClass"); -// } - + public void testACImport12_AddToEAR() throws Exception { runImportTests_All("AC12_AddToEAR"); } @@ -93,17 +66,7 @@ public void testACImport14_AddToEAR() throws Exception { runImportTests_All("AC14_AddToEAR"); } - - public void testACImport50_AddToEAR() throws Exception { - runImportTests_All("AC50_AddToEAR"); - } - - //TODO -- annotations to scan? - //EE6TODO -// public void testACImport60_AddToEAR() throws Exception { -// runImportTests_All("AC60_AddToEAR"); -// } - + public void testACImport12_InterestingName() throws Exception{ runImportTests_All("AC12_InterestingName"); } @@ -116,16 +79,6 @@ runImportTests_All("AC14_InterestingName"); } - public void testACImport50_InterestingName() throws Exception{ - runImportTests_All("AC50_InterestingName"); - } - - //TODO -- annotations to scan? - //EE6TODO -// public void testACImport60_InterestingName() throws Exception{ -// runImportTests_All("AC60_InterestingName"); -// } - public void testACImport12_AddToEAR_InterestingName() throws Exception{ runImportTests_All("AC12_AddToEAR_InterestingName"); } @@ -137,74 +90,20 @@ public void testACImport14_AddToEAR_InterestingName() throws Exception{ runImportTests_All("AC14_AddToEAR_InterestingName"); } - - public void testACImport50_AddToEAR_InterestingName() throws Exception{ - runImportTests_All("AC50_AddToEAR_InterestingName"); - } - - //TODO -- annotations to scan? - //EE6TODO -// public void testACImport60_AddToEAR_InterestingName() throws Exception{ -// runImportTests_All("AC60_AddToEAR_InterestingName"); -// } - + public void testACImport50_WithDD() throws Exception { runImportTests_All("AC50_WithDD"); } - public void testACImport60_WithDD() throws Exception { - runImportTests_All("AC60_WithDD"); - } - public void testACImport50_NoDefaultClass_WithDD() throws Exception { runImportTests_All("AC50_NoDefaultClass_WithDD"); } - public void testACImport60_NoDefaultClass_WithDD() throws Exception { - runImportTests_All("AC60_NoDefaultClass_WithDD"); - } - public void testACImport50_AddToEAR_WithDD() throws Exception { runImportTests_All("AC50_AddToEAR_WithDD"); } - public void testACImport60_AddToEAR_WithDD() throws Exception { - runImportTests_All("AC60_AddToEAR_WithDD"); - } - public void testACImport50_AddToEAR_InterestingName_WithDD() throws Exception { runImportTests_All("AC50_AddToEAR_InterestingName_WithDD"); } - - public void testACImport60_AddToEAR_InterestingName_WithDD() throws Exception { - runImportTests_All("AC60_AddToEAR_InterestingName_WithDD"); - } - @Override - protected String getModuleExtension() { - return ".jar"; - } - - @Override - protected IDataModel getImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose) { - return getAppClientImportDataModel(filePath, projectName, creationModel, closeArchiveOnDispose); - } - - public static IDataModel getAppClientImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose) { - IDataModel importModel = DataModelFactory.createDataModel(new AppClientComponentImportDataModelProvider()); - - importModel.setProperty(IJ2EEComponentImportDataModelProperties.FILE_NAME, filePath); - importModel.setProperty(IJ2EEComponentImportDataModelProperties.PROJECT_NAME, projectName); - importModel.setProperty(IJ2EEComponentImportDataModelProperties.CLOSE_ARCHIVE_ON_DISPOSE, closeArchiveOnDispose); - - if(creationModel != null) { - importModel.setProperty(IJ2EEComponentImportDataModelProperties.NESTED_MODEL_J2EE_COMPONENT_CREATION, creationModel); - } - - return importModel; - } - - @Override - protected IDataModel getExportDataModel(String projectName, String destination, boolean exportSource, boolean runBuild, boolean overwriteExisting) { - return AppClientExportOperationTest.getAppClientExportDataModel(projectName, destination, exportSource, runBuild, overwriteExisting); - } }
diff --git a/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/ejb/operations/EJBImportOperationBaseTest.java b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/ejb/operations/EJBImportOperationBaseTest.java new file mode 100644 index 0000000..9c75126 --- /dev/null +++ b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/ejb/operations/EJBImportOperationBaseTest.java
@@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2010 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.wtp.j2ee.headless.tests.ejb.operations; + +import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties; +import org.eclipse.jst.j2ee.internal.ejb.project.operations.EJBComponentImportDataModelProvider; +import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; +import org.eclipse.wst.common.frameworks.datamodel.IDataModel; +import org.eclipse.wtp.j2ee.headless.tests.j2ee.operations.ModuleImportOperationTest; + +public class EJBImportOperationBaseTest extends ModuleImportOperationTest{ + + public EJBImportOperationBaseTest() { + super("EJBImportOperationBaseTest"); + } + + public EJBImportOperationBaseTest(String name) { + super(name); + } + + @Override + protected String getModuleExtension() { + return ".jar"; + } + + @Override + protected IDataModel getImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose) { + return getEJBImportDataModel(filePath, projectName, creationModel, closeArchiveOnDispose); + } + + public static IDataModel getEJBImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose) { + IDataModel importModel = DataModelFactory.createDataModel(new EJBComponentImportDataModelProvider()); + + importModel.setProperty(IJ2EEComponentImportDataModelProperties.FILE_NAME, filePath); + importModel.setProperty(IJ2EEComponentImportDataModelProperties.PROJECT_NAME, projectName); + importModel.setProperty(IJ2EEComponentImportDataModelProperties.CLOSE_ARCHIVE_ON_DISPOSE, closeArchiveOnDispose); + + if(creationModel != null) { + importModel.setProperty(IJ2EEComponentImportDataModelProperties.NESTED_MODEL_J2EE_COMPONENT_CREATION, creationModel); + } + + return importModel; + } + + @Override + protected IDataModel getExportDataModel(String projectName, String destination, boolean exportSource, boolean runBuild, boolean overwriteExisting) { + return EJBExportOperationTest.getEJBExportDataModel(projectName, destination, exportSource, runBuild, overwriteExisting); + } + +}
diff --git a/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/ejb/operations/EJBImportOperationTest.java b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/ejb/operations/EJBImportOperationTest.java index 9fc46dc..3fc6759 100644 --- a/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/ejb/operations/EJBImportOperationTest.java +++ b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/ejb/operations/EJBImportOperationTest.java
@@ -18,12 +18,7 @@ import junit.framework.Test; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.ejb.project.operations.EJBComponentImportDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; import org.eclipse.wst.common.tests.SimpleTestSuite; -import org.eclipse.wtp.j2ee.headless.tests.j2ee.operations.ModuleImportOperationTest; /** * @author Ian Tewksbury (ictewksb@us.ibm.com) @@ -31,7 +26,7 @@ * To change the template for this generated type comment go to Window - Preferences - Java - Code * Generation - Code and Comments */ -public class EJBImportOperationTest extends ModuleImportOperationTest { +public class EJBImportOperationTest extends EJBImportOperationBaseTest { public EJBImportOperationTest() { super("EJBImportOperationTests"); } @@ -44,11 +39,6 @@ return new SimpleTestSuite(EJBImportOperationTest.class); } - @Override - protected String getModuleExtension() { - return ".jar"; - } - public void testEJBImport11_Defaults() throws Exception { runImportTests_All("EJB11_Defaults"); } @@ -61,15 +51,6 @@ runImportTests_All("EJB21_Defaults"); } - public void testEJBImport30_Defaults() throws Exception { - runImportTests_All("EJB30_Defaults"); - } - //TODO -- annotations to scan? - //EE6TODO -// public void testEJBImport31_Defaults() throws Exception { -// runImportTests_All("EJB31_Defaults"); -// } - public void testEJBImport11_AddToEAR_Defaults() throws Exception { runImportTests_All("EJB11_AddToEAR_Defaults"); } @@ -81,15 +62,7 @@ public void testEJBImport21_AddToEAR_Defaults() throws Exception { runImportTests_All("EJB21_AddToEAR_Defaults"); } - - public void testEJBImport30_AddToEAR_Defaults() throws Exception { - runImportTests_All("EJB30_AddToEAR_Defaults"); - } - - public void testEJBImport31_AddToEAR_Defaults() throws Exception { - runImportTests_All("EJB30_AddToEAR_Defaults"); - } - + public void testEJBImport11_AddToEAR_NoClient() throws Exception { runImportTests_All("EJB11_AddToEAR_NoClient"); } @@ -102,16 +75,6 @@ runImportTests_All("EJB21_AddToEAR_NoClient"); } - public void testEJBImport30_AddToEAR_NoClient() throws Exception { - runImportTests_All("EJB30_AddToEAR_NoClient"); - } - - //TODO -- annotations to scan? - //EE6TODO -// public void testEJBImport31_AddToEAR_NoClient() throws Exception { -// runImportTests_All("EJB31_AddToEAR_NoClient"); -// } - public void testEJBImport11_AddToEAR_DiffClientName() throws Exception { runImportTests_All("EJB11_AddToEAR_DiffClientName"); } @@ -124,16 +87,6 @@ runImportTests_All("EJB21_AddToEAR_DiffClientName"); } - public void testEJBImport30_AddToEAR_DifClientName() throws Exception { - runImportTests_All("EJB30_AddToEAR_DiffClientName"); - } - - //TODO -- annotations to scan? - //EE6TODO -// public void testEJBImport31_AddToEAR_DifClientName() throws Exception { -// runImportTests_All("EJB31_AddToEAR_DiffClientName"); -// } - public void testEJBImport11_AddToEAR_DiffClientSourceFolder() throws Exception { runImportTests_All("EJB11_AddToEAR_DiffClientSourceFolder"); } @@ -146,16 +99,6 @@ runImportTests_All("EJB21_AddToEAR_DiffClientSourceFolder"); } - public void testEJBImport30_AddToEAR_DiffClientSourceFolder() throws Exception { - runImportTests_All("EJB30_AddToEAR_DiffClientSourceFolder"); - } - - //TODO -- annotations to scan? - //EE6TODO -// public void testEJBImport31_AddToEAR_DiffClientSourceFolder() throws Exception { -// runImportTests_All("EJB31_AddToEAR_DiffClientSourceFolder"); -// } - public void testEJBImport11_AddToEAR_DiffClientName_DiffClientSourceFolder() throws Exception { runImportTests_All("EJB11_AddToEAR_DiffClientName_DiffClientSourceFolder"); } @@ -168,85 +111,27 @@ runImportTests_All("EJB21_AddToEAR_DiffClientName_DiffClientSourceFolder"); } - public void testEJBImport30_AddToEAR_DiffClientName_DiffClientSourceFolder() throws Exception { - runImportTests_All("EJB30_AddToEAR_DiffClientName_DiffClientSourceFolder"); - } - - //TODO -- annotations to scan? - //EE6TODO -// public void testEJBImport31_AddToEAR_DiffClientName_DiffClientSourceFolder() throws Exception { -// runImportTests_All("EJB31_AddToEAR_DiffClientName_DiffClientSourceFolder"); -// } - public void testEJBImport30_Defaults_WithDD() throws Exception { runImportTests_All("EJB30_Defaults_WithDD"); } - public void testEJBImport31_Defaults_WithDD() throws Exception { - runImportTests_All("EJB31_Defaults_WithDD"); - } - public void testEJBImport30_AddToEAR_Defaults_WithDD() throws Exception { runImportTests_All("EJB30_AddToEAR_Defaults_WithDD"); } - - public void testEJBImport31_AddToEAR_Defaults_WithDD() throws Exception { - runImportTests_All("EJB31_AddToEAR_Defaults_WithDD"); - } - + public void testEJBImport30_AddToEAR_NoClient_WithDD() throws Exception { runImportTests_All("EJB30_AddToEAR_NoClient_WithDD"); } - public void testEJBImport31_AddToEAR_NoClient_WithDD() throws Exception { - runImportTests_All("EJB31_AddToEAR_NoClient_WithDD"); - } - public void testEJBImport30_AddToEAR_DiffClientName_WithDD() throws Exception { runImportTests_All("EJB30_AddToEAR_DiffClientName_WithDD"); } - public void testEJBImport31_AddToEAR_DiffClientName_WithDD() throws Exception { - runImportTests_All("EJB31_AddToEAR_DiffClientName_WithDD"); - } - public void testEJBImport30_AddToEAR_DiffClientSourceFolder_WithDD() throws Exception { runImportTests_All("EJB30_AddToEAR_DiffClientSourceFolder_WithDD"); } - - public void testEJBImport31_AddToEAR_DiffClientSourceFolder_WithDD() throws Exception { - runImportTests_All("EJB31_AddToEAR_DiffClientSourceFolder_WithDD"); - } - + public void testEJBImport30_AddToEAR_DiffClientName_DiffClientSourceFolder_WithDD() throws Exception { runImportTests_All("EJB30_AddToEAR_DiffClientName_DiffClientSourceFolder_WithDD"); - } - - public void testEJBImport31_AddToEAR_DiffClientName_DiffClientSourceFolder_WithDD() throws Exception { - runImportTests_All("EJB31_AddToEAR_DiffClientName_DiffClientSourceFolder_WithDD"); - } - - @Override - protected IDataModel getImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose) { - return getEJBImportDataModel(filePath, projectName, creationModel, closeArchiveOnDispose); - } - - public static IDataModel getEJBImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose) { - IDataModel importModel = DataModelFactory.createDataModel(new EJBComponentImportDataModelProvider()); - - importModel.setProperty(IJ2EEComponentImportDataModelProperties.FILE_NAME, filePath); - importModel.setProperty(IJ2EEComponentImportDataModelProperties.PROJECT_NAME, projectName); - importModel.setProperty(IJ2EEComponentImportDataModelProperties.CLOSE_ARCHIVE_ON_DISPOSE, closeArchiveOnDispose); - - if(creationModel != null) { - importModel.setProperty(IJ2EEComponentImportDataModelProperties.NESTED_MODEL_J2EE_COMPONENT_CREATION, creationModel); - } - - return importModel; - } - - @Override - protected IDataModel getExportDataModel(String projectName, String destination, boolean exportSource, boolean runBuild, boolean overwriteExisting) { - return EJBExportOperationTest.getEJBExportDataModel(projectName, destination, exportSource, runBuild, overwriteExisting); - } + } }
diff --git a/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/web/operations/WebImportOperationBaseTest.java b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/web/operations/WebImportOperationBaseTest.java new file mode 100644 index 0000000..10ef7cb --- /dev/null +++ b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/web/operations/WebImportOperationBaseTest.java
@@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2010 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.wtp.j2ee.headless.tests.web.operations; + +import java.util.List; + +import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties; +import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentImportDataModelProvider; +import org.eclipse.jst.j2ee.web.datamodel.properties.IWebComponentImportDataModelProperties; +import org.eclipse.jst.jee.archive.IArchive; +import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; +import org.eclipse.wst.common.frameworks.datamodel.IDataModel; +import org.eclipse.wtp.j2ee.headless.tests.j2ee.operations.ModuleImportOperationTest; + +public class WebImportOperationBaseTest extends ModuleImportOperationTest{ + + public WebImportOperationBaseTest() { + super("WebImportOperationBaseTest"); + } + + public WebImportOperationBaseTest(String name) { + super(name); + } + + @Override + protected String getModuleExtension() { + return ".war"; + } + + @Override + protected IDataModel getImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose) { + return getWebImportDataModel(filePath, projectName, creationModel, closeArchiveOnDispose, null, null); + } + + public static IDataModel getWebImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose, List<IArchive> webLibArchivesToExpand, String contextRoot) { + IDataModel importModel = DataModelFactory.createDataModel(new WebComponentImportDataModelProvider()); + + importModel.setProperty(IJ2EEComponentImportDataModelProperties.FILE_NAME, filePath); + importModel.setProperty(IJ2EEComponentImportDataModelProperties.PROJECT_NAME, projectName); + importModel.setProperty(IJ2EEComponentImportDataModelProperties.CLOSE_ARCHIVE_ON_DISPOSE, closeArchiveOnDispose); + + + if(creationModel != null) { + importModel.setProperty(IJ2EEComponentImportDataModelProperties.NESTED_MODEL_J2EE_COMPONENT_CREATION, creationModel); + } + + if(webLibArchivesToExpand != null) { + importModel.setProperty(IWebComponentImportDataModelProperties.WEB_LIB_ARCHIVES_SELECTED, webLibArchivesToExpand); + } + + if(contextRoot != null) { + importModel.setProperty(IWebComponentImportDataModelProperties.CONTEXT_ROOT, contextRoot); + } + + return importModel; + } + + @Override + protected IDataModel getExportDataModel(String projectName, String destination, boolean exportSource, boolean runBuild, boolean overwriteExisting) { + return WebExportOperationTest.getWebExportDataModel(projectName, destination, exportSource, runBuild, overwriteExisting, false); + } +}
diff --git a/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/web/operations/WebImportOperationTest.java b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/web/operations/WebImportOperationTest.java index 50d0894..053eb37 100644 --- a/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/web/operations/WebImportOperationTest.java +++ b/tests/org.eclipse.jst.j2ee.tests/j2ee-tests/org/eclipse/wtp/j2ee/headless/tests/web/operations/WebImportOperationTest.java
@@ -6,18 +6,9 @@ */ package org.eclipse.wtp.j2ee.headless.tests.web.operations; -import java.util.List; - import junit.framework.Test; -import org.eclipse.jst.j2ee.datamodel.properties.IJ2EEComponentImportDataModelProperties; -import org.eclipse.jst.j2ee.internal.web.archive.operations.WebComponentImportDataModelProvider; -import org.eclipse.jst.j2ee.web.datamodel.properties.IWebComponentImportDataModelProperties; -import org.eclipse.jst.jee.archive.IArchive; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; import org.eclipse.wst.common.tests.SimpleTestSuite; -import org.eclipse.wtp.j2ee.headless.tests.j2ee.operations.ModuleImportOperationTest; /** * @author Ian Tewksbury (ictewksb@us.ibm.com) @@ -25,7 +16,7 @@ * To change the template for this generated type comment go to Window - Preferences - Java - Code * Generation - Code and Comments */ -public class WebImportOperationTest extends ModuleImportOperationTest { +public class WebImportOperationTest extends WebImportOperationBaseTest { public WebImportOperationTest() { super("WebImportOperationTests"); @@ -51,10 +42,6 @@ runImportTests_All("Web24_Defaults"); } - public void testWebImport25_Defaults() throws Exception { - runImportTests_All("Web25_Defaults"); - } - public void testWebImport22_DiffContentDir() throws Exception { runImportTests_All("Web22_DiffContentDir"); } @@ -67,11 +54,6 @@ runImportTests_All("Web24_DiffContentDir"); } - public void testWebImport25_DiffContentDir() throws Exception { - runImportTests_All("Web25_DiffContentDir"); - } - - public void testWebImport22_DiffSrcDir() throws Exception { runImportTests_All("Web22_DiffSrcDir"); } @@ -84,11 +66,6 @@ runImportTests_All("Web24_DiffSrcDir"); } - public void testWebImport25_DiffSrcDir() throws Exception { - runImportTests_All("Web25_DiffSrcDir"); - } - - public void testWebImport22_DiffContentDir_DiffSrcDir() throws Exception { runImportTests_All("Web22_DiffContentDir_DiffSrcDir"); } @@ -101,11 +78,6 @@ runImportTests_All("Web24_DiffContentDir_DiffSrcDir"); } - public void testWebImport25_DiffContentDir_DiffSrcDir() throws Exception { - runImportTests_All("Web25_DiffContentDir_DiffSrcDir"); - } - - public void testWebImport22_Defaults_WithEAR() throws Exception { runImportTests_All("Web22_Defaults_WithEAR"); } @@ -118,11 +90,6 @@ runImportTests_All("Web24_Defaults_WithEAR"); } - public void testWebImport25_Defaults_WithEAR() throws Exception { - runImportTests_All("Web25_Defaults_WithEAR"); - } - - public void testWebImport22_DiffContextRoot_WithEAR() throws Exception { runImportTests_All("Web22_DiffContextRoot_WithEAR"); } @@ -135,11 +102,6 @@ runImportTests_All("Web24_DiffContextRoot_WithEAR"); } - public void testWebImport25_DiffContextRoot_WithEAR() throws Exception { - runImportTests_All("Web25_DiffContextRoot_WithEAR"); - } - - public void testWebImport22_DiffContentDir_WithEAR() throws Exception { runImportTests_All("Web22_DiffContentDir_WithEAR"); } @@ -151,12 +113,7 @@ public void testWebImport24_DiffContentDir_WithEAR() throws Exception { runImportTests_All("Web24_DiffContentDir_WithEAR"); } - - public void testWebImport25_DiffContentDir_WithEAR() throws Exception { - runImportTests_All("Web25_DiffContentDir_WithEAR"); - } - - + public void testWebImport22_DiffSrcDir_WithEAR() throws Exception { runImportTests_All("Web22_DiffSrcDir_WithEAR"); } @@ -169,11 +126,6 @@ runImportTests_All("Web24_DiffSrcDir_WithEAR"); } - public void testWebImport25_DiffSrcDir_WithEAR() throws Exception { - runImportTests_All("Web25_DiffSrcDir_WithEAR"); - } - - public void testWebImport22_DiffContextRoot_DiffContentDir_WithEAR() throws Exception { runImportTests_All("Web22_DiffContextRoot_DiffContentDir_WithEAR"); } @@ -186,11 +138,6 @@ runImportTests_All("Web24_DiffContextRoot_DiffContentDir_WithEAR"); } - public void testWebImport25_DiffContextRoot_DiffContentDir_WithEAR() throws Exception { - runImportTests_All("Web25_DiffContextRoot_DiffContentDir_WithEAR"); - } - - public void testWebImport22_DiffContextRoot_DiffSrcDir_WithEAR() throws Exception { runImportTests_All("Web22_DiffContextRoot_DiffSrcDir_WithEAR"); } @@ -203,11 +150,6 @@ runImportTests_All("Web24_DiffContextRoot_DiffSrcDir_WithEAR"); } - public void testWebImport25_DiffContextRoot_DiffSrcDir_WithEAR() throws Exception { - runImportTests_All("Web25_DiffContextRoot_DiffSrcDir_WithEAR"); - } - - public void testWebImport22_DiffContentDir_DiffSrcDir_WithEAR() throws Exception { runImportTests_All("Web22_DiffContentDir_DiffSrcDir_WithEAR"); } @@ -220,11 +162,6 @@ runImportTests_All("Web24_DiffContentDir_DiffSrcDir_WithEAR"); } - public void testWebImport25_DiffContentDir_DiffSrcDir_WithEAR() throws Exception { - runImportTests_All("Web25_DiffContentDir_DiffSrcDir_WithEAR"); - } - - public void testWebImport22_DiffContextRoot_DiffContentDir_DiffSrcDir_WithEAR() throws Exception { runImportTests_All("Web22_DiffContextRoot_DiffContentDir_DiffSrcDir_WithEAR"); } @@ -236,13 +173,7 @@ public void testWebImport24_DiffContextRoot_DiffContentDir_DiffSrcDir_WithEAR() throws Exception { runImportTests_All("Web24_DiffContextRoot_DiffContentDir_DiffSrcDir_WithEAR"); } - - public void testWebImport25_DiffContextRoot_DiffContentDir_DiffSrcDir_WithEAR() throws Exception { - runImportTests_All("Web25_DiffContextRoot_DiffContentDir_DiffSrcDir_WithEAR"); - } - - - + public void testWebImport25_Defaults_WithDD() throws Exception { runImportTests_All("Web25_Defaults_WithDD"); } @@ -305,44 +236,5 @@ public void testWebImport25_DiffContextRoot_DiffContentDir_DiffSrcDir_WithEAR_WithDD() throws Exception { runImportTests_All("Web25_DiffContextRoot_DiffContentDir_DiffSrcDir_WithEAR_WithDD"); - } - - - @Override - protected String getModuleExtension() { - return ".war"; - } - - @Override - protected IDataModel getImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose) { - return getWebImportDataModel(filePath, projectName, creationModel, closeArchiveOnDispose, null, null); - } - - public static IDataModel getWebImportDataModel(String filePath, String projectName, IDataModel creationModel, boolean closeArchiveOnDispose, List<IArchive> webLibArchivesToExpand, String contextRoot) { - IDataModel importModel = DataModelFactory.createDataModel(new WebComponentImportDataModelProvider()); - - importModel.setProperty(IJ2EEComponentImportDataModelProperties.FILE_NAME, filePath); - importModel.setProperty(IJ2EEComponentImportDataModelProperties.PROJECT_NAME, projectName); - importModel.setProperty(IJ2EEComponentImportDataModelProperties.CLOSE_ARCHIVE_ON_DISPOSE, closeArchiveOnDispose); - - - if(creationModel != null) { - importModel.setProperty(IJ2EEComponentImportDataModelProperties.NESTED_MODEL_J2EE_COMPONENT_CREATION, creationModel); - } - - if(webLibArchivesToExpand != null) { - importModel.setProperty(IWebComponentImportDataModelProperties.WEB_LIB_ARCHIVES_SELECTED, webLibArchivesToExpand); - } - - if(contextRoot != null) { - importModel.setProperty(IWebComponentImportDataModelProperties.CONTEXT_ROOT, contextRoot); - } - - return importModel; - } - - @Override - protected IDataModel getExportDataModel(String projectName, String destination, boolean exportSource, boolean runBuild, boolean overwriteExisting) { - return WebExportOperationTest.getWebExportDataModel(projectName, destination, exportSource, runBuild, overwriteExisting, false); - } + } }
diff --git a/tests/org.eclipse.jst.j2ee.tests/testHOLD.xml b/tests/org.eclipse.jst.j2ee.tests/testHOLD.xml index c7d6413..33fe416 100644 --- a/tests/org.eclipse.jst.j2ee.tests/testHOLD.xml +++ b/tests/org.eclipse.jst.j2ee.tests/testHOLD.xml
@@ -33,6 +33,7 @@ <property name="classname" value="org.eclipse.jst.j2ee.tests.bvt.AutomatedBVT" /> <property name="extraVMargs" value="${extraVMargs}" /> </ant> + <antcall target="cleanup"/> </target> <target name="EnterpriseBVTSuite" if="org.eclipse.jst.j2ee.tests.bvt.EnterpriseBVT" unless="org.eclipse.jst.j2ee.tests.bvt.ALL"> @@ -42,6 +43,7 @@ <property name="classname" value="org.eclipse.jst.j2ee.tests.bvt.EnterpriseBVT" /> <property name="extraVMargs" value="${extraVMargs}" /> </ant> + <antcall target="cleanup"/> </target> <target name="WebBVTSuite" if="org.eclipse.jst.j2ee.tests.bvt.WebBVT" unless="org.eclipse.jst.j2ee.tests.bvt.ALL"> @@ -51,6 +53,7 @@ <property name="classname" value="org.eclipse.jst.j2ee.tests.bvt.WebBVT" /> <property name="extraVMargs" value="${extraVMargs}" /> </ant> + <antcall target="cleanup"/> </target> <target name="EJBBVTSuite" if="org.eclipse.jst.j2ee.tests.bvt.EJBBVT" unless="org.eclipse.jst.j2ee.tests.bvt.ALL"> @@ -60,6 +63,7 @@ <property name="classname" value="org.eclipse.jst.j2ee.tests.bvt.EJBBVT" /> <property name="extraVMargs" value="${extraVMargs}" /> </ant> + <antcall target="cleanup"/> </target> <target name="CoreBVTSuite" if="org.eclipse.jst.j2ee.tests.bvt.CoreInfrastructureBVT" unless="org.eclipse.jst.j2ee.tests.bvt.ALL"> @@ -69,6 +73,7 @@ <property name="classname" value="org.eclipse.jst.j2ee.tests.bvt.CoreInfrastructureBVT" /> <property name="extraVMargs" value="${extraVMargs}" /> </ant> + <antcall target="cleanup"/> </target> <target name="ModelProviderBVTSuite" if="org.eclipse.jst.j2ee.tests.bvt.ModelProviderBVT" unless="org.eclipse.jst.j2ee.tests.bvt.ALL"> @@ -78,6 +83,7 @@ <property name="classname" value="org.eclipse.jst.j2ee.tests.bvt.ModelProviderBVT" /> <property name="extraVMargs" value="${extraVMargs}" /> </ant> + <antcall target="cleanup"/> </target> <target name="ExtendedModelProviderBVTSuite" if="org.eclipse.jst.j2ee.tests.bvt.ExtendedModelProviderBVT" unless="org.eclipse.jst.j2ee.tests.bvt.ALL"> @@ -87,6 +93,7 @@ <property name="classname" value="org.eclipse.jst.j2ee.tests.bvt.ExtendedModelProviderBVT" /> <property name="extraVMargs" value="${extraVMargs}" /> </ant> + <antcall target="cleanup"/> </target> <!-- This target defines the tests that need to be run. -->