Author: dazarov
Date: 2010-04-14 10:40:01 -0400 (Wed, 14 Apr 2010)
New Revision: 21474
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20XProjectNamesTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNamesTest.java
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamCreateTestProjectTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2809
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2010-04-14
14:39:41 UTC (rev 21473)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/SeamUiAllTests.java 2010-04-14
14:40:01 UTC (rev 21474)
@@ -25,9 +25,11 @@
import org.jboss.tools.seam.ui.test.wizard.OpenSeamComponentDialogTest;
import org.jboss.tools.seam.ui.test.wizard.PackageNamesTest;
import org.jboss.tools.seam.ui.test.wizard.Seam20XCreateTestProjectTest;
+import org.jboss.tools.seam.ui.test.wizard.Seam20XProjectNamesTest;
import org.jboss.tools.seam.ui.test.wizard.SeamActionNewWizardTest;
import org.jboss.tools.seam.ui.test.wizard.SeamCreateTestProjectTest;
import org.jboss.tools.seam.ui.test.wizard.SeamFormNewWizardTest;
+import org.jboss.tools.seam.ui.test.wizard.SeamProjectNamesTest;
import org.jboss.tools.seam.ui.test.wizard.SeamProjectNewWizardTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
@@ -57,6 +59,8 @@
suite.addTestSuite(JBide3989Test.class);
suite.addTestSuite(SeamCreateTestProjectTest.class);
suite.addTestSuite(Seam20XCreateTestProjectTest.class);
+ suite.addTestSuite(SeamProjectNamesTest.class);
+ suite.addTestSuite(Seam20XProjectNamesTest.class);
return suite;
}
}
\ No newline at end of file
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20XProjectNamesTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20XProjectNamesTest.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20XProjectNamesTest.java 2010-04-14
14:40:01 UTC (rev 21474)
@@ -0,0 +1,53 @@
+package org.jboss.tools.seam.ui.test.wizard;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.CoreException;
+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.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.jboss.tools.seam.core.test.project.facet.AbstractSeamFacetTest;
+
+public class Seam20XProjectNamesTest extends SeamProjectNamesTest {
+
+ public Seam20XProjectNamesTest(String name) {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ assertSeamHomeAvailable();
+ File folder = getSeamHomeFolder();
+ SeamRuntimeManager.getInstance().addRuntime(SEAM_2_0_0, folder.getAbsolutePath(),
SeamVersion.SEAM_2_0, true);
+ }
+
+ @Override
+ protected IProjectFacetVersion getSeamFacetVersion() {
+ IProjectFacet seamFacet = ProjectFacetsManager.getProjectFacet("jst.seam");
+ return seamFacet.getVersion("2.0");
+ }
+
+ @Override
+ protected String getSystemPropertyName() {
+ // TODO Auto-generated method stub
+ return AbstractSeamFacetTest.SEAM_2_0_HOME;
+ }
+
+ public void testSeamWarProjectWithTestProject() throws CoreException{
+ checkProjectNamesCreation("seam12_war_t", "ear_seam12_war_t",
"ejb_seam12_war_t", "test_seam12_war_t", SEAM_2_0_0, WAR, true);
+ }
+
+ public void testSeamWarProjectWithoutTestProject() throws CoreException{
+ checkProjectNamesCreation("seam12_war", "ear_seam12_war",
"ejb_seam12_war", "test_seam12_war", SEAM_2_0_0, WAR, false);
+ }
+
+ public void testSeamEarProjectWithTestProject() throws CoreException{
+ checkProjectNamesCreation("seam12_ear_t", "ear_seam12_ear_t",
"ejb_seam12_ear_t", "test_seam12_ear_t", SEAM_2_0_0, EAR, true);
+ }
+
+ public void testSeamEarProjectWithoutTestProject() throws CoreException{
+ checkProjectNamesCreation("seam12_ear", "ear_seam12_ear",
"ejb_seam12_ear", "test_seam12_ear", SEAM_2_0_0, EAR, false);
+ }
+}
Property changes on:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam20XProjectNamesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamCreateTestProjectTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamCreateTestProjectTest.java 2010-04-14
14:39:41 UTC (rev 21473)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamCreateTestProjectTest.java 2010-04-14
14:40:01 UTC (rev 21474)
@@ -10,17 +10,10 @@
******************************************************************************/
package org.jboss.tools.seam.ui.test.wizard;
-import java.io.File;
-
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-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.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
-import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.core.test.project.facet.AbstractSeamFacetTest;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNamesTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNamesTest.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNamesTest.java 2010-04-14
14:40:01 UTC (rev 21474)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.seam.ui.test.wizard;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.jboss.tools.seam.core.test.project.facet.AbstractSeamFacetTest;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+
+/**
+ * @author daniel
+ *
+ */
+public class SeamProjectNamesTest extends AbstractSeamFacetTest {
+ public static final String WAR = "war";
+ public static final String EAR = "ear";
+
+ public SeamProjectNamesTest(String name) {
+ super(name);
+ }
+
+ protected void checkProjectNamesCreation(String warProjectName, String earProjectName,
String ejbProjectName, String testProjectName, String seamVersion, String deployType,
boolean createTestProject) throws CoreException{
+ IDataModel model = createSeamDataModel(deployType);
+
+ // set property to create test project
+ model.setProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING, new
Boolean(createTestProject));
+
+ model.setStringProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, seamVersion);
+
+ model.setStringProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT,
earProjectName);
+ model.setStringProperty(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
ejbProjectName);
+ model.setStringProperty(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
testProjectName);
+
+ final IFacetedProject fproj = createSeamProject(warProjectName, model);
+
+ final IProject proj = fproj.getProject();
+
+ assertNotNull(proj);
+ assertTrue(proj.exists());
+ if(createTestProject){
+ assertTrue(proj.getWorkspace().getRoot().getProject(testProjectName).exists());
+ //IProject testProject = proj.getWorkspace().getRoot().getProject(proj.getName() +
"-test");
+ }else{
+ assertFalse(proj.getWorkspace().getRoot().getProject(testProjectName).exists());
+ }
+
+ if(WAR.equals(deployType)){
+ assertFalse(proj.getWorkspace().getRoot().getProject(earProjectName).exists());
+ assertFalse(proj.getWorkspace().getRoot().getProject(ejbProjectName).exists());
+ }else if(EAR.equals(deployType)){
+ assertTrue(proj.getWorkspace().getRoot().getProject(earProjectName).exists());
+ assertTrue(proj.getWorkspace().getRoot().getProject(ejbProjectName).exists());
+ }
+ }
+
+ public void testSeamWarProjectWithTestProject() throws CoreException{
+ checkProjectNamesCreation("seam12_war_t", "ear_seam12_war_t",
"ejb_seam12_war_t", "test_seam12_war_t", SEAM_1_2_0, WAR, true);
+ }
+
+ public void testSeamWarProjectWithoutTestProject() throws CoreException{
+ checkProjectNamesCreation("seam12_war", "ear_seam12_war",
"ejb_seam12_war", "test_seam12_war", SEAM_1_2_0, WAR, false);
+ }
+
+ public void testSeamEarProjectWithTestProject() throws CoreException{
+ checkProjectNamesCreation("seam12_ear_t", "ear_seam12_ear_t",
"ejb_seam12_ear_t", "test_seam12_ear_t", SEAM_1_2_0, EAR, true);
+ }
+
+ public void testSeamEarProjectWithoutTestProject() throws CoreException{
+ checkProjectNamesCreation("seam12_ear", "ear_seam12_ear",
"ejb_seam12_ear", "test_seam12_ear", SEAM_1_2_0, EAR, false);
+ }
+}
Property changes on:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamProjectNamesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain