Author: dpospisi(a)redhat.com
Date: 2010-12-14 11:54:27 -0500 (Tue, 14 Dec 2010)
New Revision: 27458
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/misc/
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/misc/GotoComponent.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/misc/ReverseEngineering.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/validate/
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/validate/ComponentsValidator.java
Removed:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamRuntimes.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateServerRuntimes.java
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/.classpath
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/META-INF/MANIFEST.MF
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/resources/jbossEAPRuntime.properties
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/SeamAllBotTests.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/TestControl.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateActions.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateConversations.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateEntities.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateForms.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/DeleteSeamProjects.java
Log:
Updated Seam bot tests.
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/.classpath
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/.classpath 2010-12-14 16:43:23 UTC
(rev 27457)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/.classpath 2010-12-14 16:54:27 UTC
(rev 27458)
@@ -1,8 +1,8 @@
-<?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="src" path="resources"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="resources"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/META-INF/MANIFEST.MF 2010-12-14
16:43:23 UTC (rev 27457)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/META-INF/MANIFEST.MF 2010-12-14
16:54:27 UTC (rev 27458)
@@ -11,10 +11,10 @@
org.eclipse.swtbot.eclipse.finder;bundle-version="2.0.0",
org.eclipse.swtbot.swt.finder;bundle-version="2.0.0",
org.apache.log4j;bundle-version="1.2.13",
- org.junit4;bundle-version="4.5.0",
+ org.junit4;bundle-version="4.8.1",
org.eclipse.datatools.connectivity;bundle-version="1.1.2",
org.jboss.tools.ui.bot.ext;bundle-version="1.0.0"
Eclipse-RegisterBuddy: org.apache.log4j
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: JBoss by Red Hat
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/resources/jbossEAPRuntime.properties
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/resources/jbossEAPRuntime.properties 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/resources/jbossEAPRuntime.properties 2010-12-14
16:54:27 UTC (rev 27458)
@@ -1,5 +1,6 @@
runtimeGroup=JBoss Enterprise Middleware
-runtimeItem=JBoss Enterprise Application Platform 4.3
+runtimeItem=JBoss Enterprise Application Platform 5.0
runtimeName=jboss-eap Runtime
runtimePath=${jbosstools.test.jboss.home}
-serverName=jboss-eap
\ No newline at end of file
+serverName=jboss-eap
+javaHome=${jbosstools.test.java.home}
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/SeamAllBotTests.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/SeamAllBotTests.java 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/SeamAllBotTests.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -1,33 +1,51 @@
package org.jboss.tools.seam.ui.bot.test;
-import org.jboss.tools.seam.ui.bot.test.create.CreateSeamRuntimes;
-import org.jboss.tools.seam.ui.bot.test.create.CreateSeamProjects;
-import org.jboss.tools.seam.ui.bot.test.create.CreateForms;
import org.jboss.tools.seam.ui.bot.test.create.CreateActions;
import org.jboss.tools.seam.ui.bot.test.create.CreateConversations;
import org.jboss.tools.seam.ui.bot.test.create.CreateEntities;
-import org.jboss.tools.seam.ui.bot.test.create.CreateServerRuntimes;
+import org.jboss.tools.seam.ui.bot.test.create.CreateSeamProjects;
+import org.jboss.tools.seam.ui.bot.test.create.CreateForms;
+import org.jboss.tools.seam.ui.bot.test.create.DeleteSeamProjects;
+import org.jboss.tools.seam.ui.bot.test.misc.GotoComponent;
+import org.jboss.tools.seam.ui.bot.test.misc.ReverseEngineering;
+import org.jboss.tools.seam.ui.bot.test.validate.ComponentsValidator;
+import org.jboss.tools.seam.ui.bot.test.validate.ELExprValidator;
+import org.junit.experimental.categories.Categories.ExcludeCategory;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
-
-
/**
*
* This is a swtbot testcase for an eclipse application.
*
*/
+
+(a)RunWith(RequirementAwareSuite.class)
+(a)ExcludeCategory(WARTests.class)
+(a)Suite.SuiteClasses({
+ //CreateServerRuntimes.class,
+ //CreateSeamRuntimes.class,
+ CreateSeamProjects.class,
+ //ReverseEngineering.class,
+ //ComponentsValidator.class,
+ //ELExprValidator.class,
+ CreateForms.class,
+ CreateActions.class,
+ CreateConversations.class,
+ CreateEntities.class,
+ GotoComponent.class,
+ DeleteSeamProjects.class
+ })
public class SeamAllBotTests {
- public static Test suite(){
- TestSuite suite = new TestSuite("Seam tests");
- suite.addTestSuite(CreateServerRuntimes.class);
- suite.addTestSuite(CreateSeamRuntimes.class);
- suite.addTestSuite(CreateSeamProjects.class);
- suite.addTestSuite(CreateForms.class);
- suite.addTestSuite(CreateActions.class);
- suite.addTestSuite(CreateConversations.class);
- suite.addTestSuite(CreateEntities.class);
- return suite;
- }
+
+ /*
+ @Parameters
+ public static List<Properties[]> data() {
+ return TestControl.getParameters();
+
+ }
+ */
+
}
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/TestControl.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/TestControl.java 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/TestControl.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -3,7 +3,9 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.util.List;
import java.util.Properties;
+import java.util.Vector;
import org.eclipse.datatools.connectivity.ConnectionProfileException;
import org.eclipse.swtbot.swt.finder.SWTBot;
@@ -29,14 +31,16 @@
protected static Properties seam2fpSettings;
protected static Properties seam22Settings;
+ protected static List<Properties[]> parameters = new
Vector<Properties[]>();
+
+ protected SWTUtilExt util = new SWTUtilExt(bot);
+
private static final String PROJECT_PROPERTIES =
"projectProperties.properties";
private static final String EAP_RUNTIME = "jbossEAPRuntime.properties";
private static final String SEAM_SET_12 = "seam12Settings.properties";
private static final String SEAM_SET_2FP = "seam2fpSettings.properties";
private static final String SEAM_SET_22 = "seam22Settings.properties";
- protected static final String VALIDATION = "Validation";
- protected static final String DEPLOY_SOURCE = "Deploying datasource to
server";
- protected static final String REG_IN_SERVER = "Register in server";
+
public static String JBOSS_EAP_HOME;
public static String SEAM_12_SETTINGS_HOME;
@@ -106,6 +110,11 @@
SEAM_22_SETTINGS_HOME = seam22Settings.getProperty("seamRuntimePath");
SEAM_2FP_SETTINGS_HOME = seam2fpSettings.getProperty("seamRuntimePath");
createConnectionProfile(seam22Settings.getProperty("seamRuntimePath"),"DefaultDS");
+
+ //parameters.add(new Properties[] {seam12Settings});
+ parameters.add(new Properties[] {seam22Settings});
+ //parameters.add(new Properties[] {seam2fpSettings});
+
}
/*Pre-launch operations here:*/
@@ -134,45 +143,7 @@
public static String TYPE_WAR = "WAR";
public static String TYPE_EAR = "EAR";
-/**Creates any Server Runtime + Server. */
- protected void createServerRuntime(Properties serverType){
-
- if
(!SWTJBTExt.isServerRuntimeDefined(bot,serverType.getProperty("runtimeName"))){
-
bot.menu("File").menu("New").menu("Other...").click();
- bot.shell(IDELabel.Shell.NEW).activate();
- SWTBotTree tree = bot.tree();
- delay();
- tree.expandNode("Server").select("Server");
- bot.button("Next >").click();
- SWTBotTree tree2 = bot.tree();
-
tree2.expandNode(serverType.getProperty("runtimeGroup")).select(serverType.getProperty("runtimeItem"));
- bot.textWithLabel("Server
name:").setText(serverType.getProperty("serverName"));
- bot.button("Next >").click();
-
bot.textWithLabel("Name").setText(serverType.getProperty("runtimeName"));
- bot.textWithLabel("Home
Directory").setText(serverType.getProperty("runtimePath"));
- bot.button("Finish").click();
- }
-
- }
-/** Creates any Seam runtime. */
- protected void createSeamRuntime(Properties runtimeSet, String homeFolder){
- bot.menu("Window").menu("Preferences").click();
- bot.shell(IDELabel.Shell.PREFERENCES).activate();
- SWTBotTree tree = bot.tree();
- delay();
- tree.expandNode("JBoss Tools")
- .expandNode("Web")
- .expandNode("Seam")
- .select();
-
- bot.button("Add").click();
- bot.textWithLabel("Home Folder:").setText(homeFolder);
- bot.textWithLabel("Name:").setText(runtimeSet.getProperty("seamRuntimeName"));
- bot.button("Finish").click();
- bot.button("OK").click();
- }
-
/**Creates any Seam project. */
protected void createSeamProject(Properties runtimeSet, Properties serverType,
String type ){
@@ -191,20 +162,6 @@
bot.button("Finish").click();
}
-/**Creates any Seam Action, Form etc. */
- protected void createSeamUnit(String unitType,
- Properties runtimeSet, String type){
- bot.menu("File").menu("New").menu("Seam "
+unitType).click();
- SWTBotShell shell = bot.activeShell();
- bot.textWithLabel("Seam
Project:").setText(runtimeSet.getProperty("testProjectName")+ type);
- if ("Entity".equals(unitType)) {
- bot.textWithLabel("Seam entity class
name:").setText("seam"+unitType);
- } else {
- bot.textWithLabel("Seam component
name:").setText("seam"+unitType);
- }
- bot.button("Finish").click();
- bot.waitUntil(Conditions.shellCloses(shell),15000);
- }
/**Deletes any Seam project. */
protected void deleteSeamProject(Properties runtimeSet, String type){
@@ -233,6 +190,18 @@
}
}
+ public static List<Properties[]> getParameters() {
+ return parameters;
+ }
+
+ public static Properties getJbossEAPRuntime() {
+ return jbossEAPRuntime;
+ }
+
+ public static Properties getProjectProperties() {
+ return projectProperties;
+ }
+
/**
* Creates connection profile in case it's not defined yet
* @param pathToSeamRuntime
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateActions.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateActions.java 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateActions.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -1,33 +1,44 @@
package org.jboss.tools.seam.ui.bot.test.create;
+import java.util.Properties;
+
+import org.jboss.tools.seam.ui.bot.test.AbstractSeamTestBase;
+import org.jboss.tools.seam.ui.bot.test.EARTests;
import org.jboss.tools.seam.ui.bot.test.TestControl;
+import org.jboss.tools.seam.ui.bot.test.WARTests;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
-public class CreateActions extends TestControl{
+public class CreateActions extends AbstractSeamTestBase {
private static String TEST_TYPE = "Action";
- public void testCreateActionFor12war(){
- createSeamUnit(TEST_TYPE, seam12Settings, TYPE_WAR);
- }
+ public CreateActions() {
+ }
- public void testCreateActionFor12ear(){
- createSeamUnit(TEST_TYPE, seam12Settings, TYPE_EAR);
+ @Test
+ @Category(WARTests.class)
+ public void testCreateActionForWar(){
+ createSeamUnit(TEST_TYPE, TestControl.TYPE_WAR);
}
- public void testCreateActionFor2fpwar(){
- createSeamUnit(TEST_TYPE, seam2fpSettings, TYPE_WAR);
+ @Test
+ @Category(WARTests.class)
+ public void checkCreateActionForWar(){
+ checkSeamUnit(TEST_TYPE, TestControl.TYPE_WAR);
}
- public void testCreateActionFor2fpear(){
- createSeamUnit(TEST_TYPE, seam2fpSettings, TYPE_EAR);
+ @Test
+ @Category(EARTests.class)
+ public void testCreateActionForEar(){
+ createSeamUnit(TEST_TYPE, TestControl.TYPE_EAR);
}
-
- public void testCreateActionFor22war(){
- createSeamUnit(TEST_TYPE, seam22Settings, TYPE_WAR);
- }
- public void testCreateActionFor22ear(){
- createSeamUnit(TEST_TYPE, seam22Settings, TYPE_EAR);
+ @Test
+ @Category(EARTests.class)
+ public void checkCreateActionForEar(){
+ checkSeamUnit(TEST_TYPE, TestControl.TYPE_EAR);
}
+
}
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateConversations.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateConversations.java 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateConversations.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -1,33 +1,31 @@
package org.jboss.tools.seam.ui.bot.test.create;
+import java.util.Properties;
+
+import org.jboss.tools.seam.ui.bot.test.AbstractSeamTestBase;
+import org.jboss.tools.seam.ui.bot.test.EARTests;
import org.jboss.tools.seam.ui.bot.test.TestControl;
+import org.jboss.tools.seam.ui.bot.test.WARTests;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
-public class CreateConversations extends TestControl{
-
+public class CreateConversations extends AbstractSeamTestBase {
+
private static String TEST_TYPE = "Conversation";
-
- public void testCreateConversationFor12war(){
- createSeamUnit(TEST_TYPE, seam12Settings, TYPE_WAR);
+
+ public CreateConversations() {
}
-
- public void testCreateConversationFor12ear(){
- createSeamUnit(TEST_TYPE, seam12Settings, TYPE_EAR);
- }
- public void testCreateConversationFor2fpwar(){
- createSeamUnit(TEST_TYPE, seam2fpSettings, TYPE_WAR);
+ @Test
+ @Category(WARTests.class)
+ public void testCreateConversationFor12war() {
+ createSeamUnit(TEST_TYPE, TestControl.TYPE_WAR);
}
-
- public void testCreateConversationFor2fpear(){
- createSeamUnit(TEST_TYPE, seam2fpSettings, TYPE_EAR);
- }
-
- public void testCreateConversationFor22war(){
- createSeamUnit(TEST_TYPE, seam22Settings, TYPE_WAR);
- }
- public void testCreateConversationFor22ear(){
- createSeamUnit(TEST_TYPE, seam22Settings, TYPE_EAR);
+ @Test
+ @Category(EARTests.class)
+ public void testCreateConversationFor12ear() {
+ createSeamUnit(TEST_TYPE, TestControl.TYPE_EAR);
}
+
}
-
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateEntities.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateEntities.java 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateEntities.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -1,34 +1,33 @@
package org.jboss.tools.seam.ui.bot.test.create;
+import java.util.Properties;
+
+import org.jboss.tools.seam.ui.bot.test.AbstractSeamTestBase;
+import org.jboss.tools.seam.ui.bot.test.EARTests;
import org.jboss.tools.seam.ui.bot.test.TestControl;
+import org.jboss.tools.seam.ui.bot.test.WARTests;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
-public class CreateEntities extends TestControl{
+public class CreateEntities extends AbstractSeamTestBase {
private static String TEST_TYPE = "Entity";
+ public CreateEntities() {
+ }
+
+ @Test
+ @Category(WARTests.class)
public void testCreateEntityFor12war(){
- createSeamUnit(TEST_TYPE, seam12Settings, TYPE_WAR);
+ createSeamUnit(TEST_TYPE, TestControl.TYPE_WAR);
}
+ @Test
+ @Category(EARTests.class)
public void testCreateEntityFor12ear(){
- createSeamUnit(TEST_TYPE, seam12Settings, TYPE_EAR);
+ createSeamUnit(TEST_TYPE, TestControl.TYPE_EAR);
}
- public void testCreateEntityFor2fpwar(){
- createSeamUnit(TEST_TYPE, seam2fpSettings, TYPE_WAR);
- }
- public void testCreateEntityFor2fpear(){
- createSeamUnit(TEST_TYPE, seam2fpSettings, TYPE_EAR);
- }
-
- public void testCreateEntityFor22war(){
- createSeamUnit(TEST_TYPE, seam22Settings, TYPE_WAR);
- }
-
- public void testCreateEntityFor22ear(){
- createSeamUnit(TEST_TYPE, seam22Settings, TYPE_EAR);
- }
-
}
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateForms.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateForms.java 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateForms.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -1,33 +1,44 @@
package org.jboss.tools.seam.ui.bot.test.create;
+import java.util.Properties;
+
+import org.jboss.tools.seam.ui.bot.test.AbstractSeamTestBase;
+import org.jboss.tools.seam.ui.bot.test.EARTests;
import org.jboss.tools.seam.ui.bot.test.TestControl;
+import org.jboss.tools.seam.ui.bot.test.WARTests;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
-public class CreateForms extends TestControl{
+public class CreateForms extends AbstractSeamTestBase {
private static String TEST_TYPE = "Form";
- public void testCreateFormFor12war(){
- createSeamUnit(TEST_TYPE, seam12Settings, TYPE_WAR);
- }
+ public CreateForms() {
+ }
- public void testCreateFormFor12ear(){
- createSeamUnit(TEST_TYPE, seam12Settings, TYPE_EAR);
+ @Test
+ @Category(WARTests.class)
+ public void testCreateFormForWar(){
+ createSeamUnit(TEST_TYPE, TestControl.TYPE_WAR);
}
-
- public void testCreateFormFor2fpwar(){
- createSeamUnit(TEST_TYPE, seam2fpSettings, TYPE_WAR);
- }
- public void testCreateFormFor2fpear(){
- createSeamUnit(TEST_TYPE, seam2fpSettings, TYPE_EAR);
+ @Test
+ @Category(WARTests.class)
+ public void checkCreateFormForWar(){
+ checkSeamUnit(TEST_TYPE, TestControl.TYPE_WAR);
}
- public void testCreateFormFor22war(){
- createSeamUnit(TEST_TYPE, seam22Settings, TYPE_WAR);
+ @Test
+ @Category(EARTests.class)
+ public void testCreateFormForEar(){
+ createSeamUnit(TEST_TYPE, TestControl.TYPE_EAR);
}
- public void testCreateFormFor22ear(){
- createSeamUnit(TEST_TYPE, seam22Settings, TYPE_EAR);
+ @Test
+ @Category(EARTests.class)
+ public void checkCreateFormForEar(){
+ checkSeamUnit(TEST_TYPE, TestControl.TYPE_EAR);
}
+
}
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamProjects.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -1,71 +1,116 @@
package org.jboss.tools.seam.ui.bot.test.create;
+import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellCloses;
+
+import java.util.Properties;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotBrowser;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.seam.ui.bot.test.AbstractSeamTestBase;
+import org.jboss.tools.seam.ui.bot.test.EARTests;
import org.jboss.tools.seam.ui.bot.test.TestControl;
+import org.jboss.tools.seam.ui.bot.test.WARTests;
+import org.jboss.tools.ui.bot.ext.SWTBotExt;
import org.jboss.tools.ui.bot.ext.SWTJBTExt;
+import org.jboss.tools.ui.bot.ext.SWTOpenExt;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.ext.config.Annotations.DB;
+import org.jboss.tools.ui.bot.ext.config.TestConfigurator;
+import org.jboss.tools.ui.bot.ext.config.Annotations.SWTBotTestRequires;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Seam;
+import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem;
+import org.jboss.tools.ui.bot.ext.parts.SWTBotBrowserExt;
+import org.jboss.tools.ui.bot.ext.view.ProblemsView;
+import org.jboss.tools.ui.bot.test.SWTJBTBot;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
-public class CreateSeamProjects extends TestControl{
+
+//@SWTBotTestRequires(server=@Server(state=ServerState.NotRunning),perspective="Seam",seam=(a)Seam())
+@SWTBotTestRequires(server=@Server,perspective="Seam",seam=@Seam(),db=@DB)
+public class CreateSeamProjects extends AbstractSeamTestBase {
- private SWTJBTExt swtJbtExt = new SWTJBTExt(bot);
+ protected static final String VALIDATION = "Validation";
+ protected static final String DEPLOY_SOURCE = "Deploying datasource to
server";
+ protected static final String REG_IN_SERVER = "Register in server";
+ protected static final String CONN_PROFILE = "hsqldb18_internal";
- public void testCreateSeamProject12war(){
- createSeamProject(seam12Settings, jbossEAPRuntime, TYPE_WAR);
- waitForBlockingJobsAcomplished(240000, BUILDING_WS, VALIDATION +
- " " + seam12Settings.getProperty("testProjectName")
- +TYPE_WAR, DEPLOY_SOURCE, REG_IN_SERVER);
- //TODO: This is eclipse bug already fixed in newer versions of Elipse so this should be
removed
- // when JBDS will use never version of Eclipse
- Throwable exception = getException();
- if (exception != null
- && exception instanceof NullPointerException
- && exception.getStackTrace().length > 0
- &&
exception.getStackTrace()[0].getClassName().equals("org.eclipse.wst.server.core.internal.Server")
- && exception.getStackTrace()[0].getLineNumber() == 783){
- // Reset returned exception
- setException(null);
- }
- swtJbtExt.removeSeamProjectFromServers(seam12Settings.getProperty("testProjectName"));
+
+ public CreateSeamProjects() {
}
+
+ private SWTJBTExt swtJbtExt = new SWTJBTExt(bot);
- public void testCreateSeamProject12ear(){
- createSeamProject(seam12Settings, jbossEAPRuntime, TYPE_EAR);
- waitForBlockingJobsAcomplished(240000, BUILDING_WS, VALIDATION +
- " " + seam12Settings.getProperty("testProjectName")
- +TYPE_EAR, DEPLOY_SOURCE, REG_IN_SERVER);
- swtJbtExt.removeSeamProjectFromServers(seam12Settings.getProperty("testProjectName"));
+ @Test
+ @Category(WARTests.class)
+ public void testCreateSeamProjectWar(){
+ createSeamProject(TestControl.TYPE_WAR);
+ util.waitForNonIgnoredJobs();
}
+
+ @Test
+ @Category(WARTests.class)
+ public void testCheckSeamProjectWar(){
+ checkSeamProject(TestControl.TYPE_WAR);
+ }
- public void testCreateSeamProject2fpwar(){
- createSeamProject(seam2fpSettings, jbossEAPRuntime, TYPE_WAR);
- waitForBlockingJobsAcomplished(240000, BUILDING_WS, VALIDATION +
- " " + seam2fpSettings.getProperty("testProjectName")
- +TYPE_WAR, DEPLOY_SOURCE, REG_IN_SERVER);
- swtJbtExt.removeSeamProjectFromServers(seam2fpSettings.getProperty("testProjectName"));
+ @Test
+ @Category(EARTests.class)
+ public void testCreateSeamProjectEar(){
+ createSeamProject(TestControl.TYPE_EAR);
+ util.waitForNonIgnoredJobs();
}
+
+ @Test
+ @Category(EARTests.class)
+ public void testCheckSeamProjectEar(){
+ checkSeamProject(TestControl.TYPE_EAR);
+ }
+
- public void testCreateSeamProject2fpear(){
- createSeamProject(seam2fpSettings, jbossEAPRuntime, TYPE_EAR);
- waitForBlockingJobsAcomplished(240000, BUILDING_WS, VALIDATION +
- " " + seam2fpSettings.getProperty("testProjectName")
- +TYPE_EAR, DEPLOY_SOURCE, REG_IN_SERVER);
- swtJbtExt.removeSeamProjectFromServers(seam2fpSettings.getProperty("testProjectName"));
+ protected void createSeamProject(String type) {
+ SWTJBTBot bot = new SWTJBTBot();
+ bot.menu("File").menu("New").menu("Seam Web
Project").click();
+ bot.textWithLabel("Project
name:").setText(AbstractSeamTestBase.testProjectName + type);
+ bot.comboBoxInGroup("Target
runtime").setSelection(SWTTestExt.configuredState.getServer().name);
+ bot.comboBoxInGroup("Target
Server").setSelection(SWTTestExt.configuredState.getServer().name);
+ bot.comboBoxInGroup("Configuration").setSelection(
+ AbstractSeamTestBase.seamConfigPrefix +
+ SWTTestExt.configuredState.getSeam().version);
+ bot.button("Next >").click();
+ bot.button("Next >").click();
+ bot.button("Next >").click();
+ bot.button("Next >").click();
+ bot.comboBoxWithLabel("Seam
Runtime:").setSelection(SWTTestExt.configuredState.getSeam().name);
+ bot.radio(type).click();
+ bot.comboBoxWithLabel("Connection profile:").setSelection(CONN_PROFILE);
+
+ SWTBotShell seamPrjShell = bot.activeShell();
+ bot.button("Finish").click();
+ bot.waitUntil(shellCloses(seamPrjShell), 480000);
+ log.info("Seam shell closed.");
+ bot.shells()[0].activate();
+
}
- public void testCreateSeamProject22war(){
- createSeamProject(seam22Settings, jbossEAPRuntime, TYPE_WAR);
- waitForBlockingJobsAcomplished(240000, BUILDING_WS, VALIDATION +
- " " + seam22Settings.getProperty("testProjectName")
- +TYPE_WAR, DEPLOY_SOURCE, REG_IN_SERVER);
- swtJbtExt.removeSeamProjectFromServers(seam22Settings.getProperty("testProjectName"));
+ protected void checkSeamProject(String type) {
+
+ problems.show();
+ SWTBotTreeItem[] errors = ProblemsView.getFilteredErrorsTreeItems(bot, null, null,
null, null);
+ assertNull("Errors in problem view.", errors);
+
+ open.viewOpen(ActionItem.View.GeneralInternalWebBrowser.LABEL);
+
+ bot.sleep(20000);
+ SWTBotBrowserExt bBrowser = bot.browserExt();
+ bBrowser.goURL("http://localhost:8080/" +
AbstractSeamTestBase.testProjectName + type + "/home.seam");
+ util.waitForBrowserLoadsPage(bBrowser);
+ assertContains("Welcome to Seam", bBrowser.getText());
}
-
- public void testCreateSeamProject22ear(){
- createSeamProject(seam22Settings, jbossEAPRuntime, TYPE_EAR);
- waitForBlockingJobsAcomplished(240000, BUILDING_WS, VALIDATION +
- " " + seam22Settings.getProperty("testProjectName")
- +TYPE_EAR, DEPLOY_SOURCE, REG_IN_SERVER);
- swtJbtExt.removeSeamProjectFromServers(seam22Settings.getProperty("testProjectName"));
- new SWTUtilExt(bot).waitForAll(60 * 1000L);
- }
-
+
}
\ No newline at end of file
Deleted:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamRuntimes.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamRuntimes.java 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateSeamRuntimes.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -1,18 +0,0 @@
-package org.jboss.tools.seam.ui.bot.test.create;
-
-import org.jboss.tools.seam.ui.bot.test.TestControl;
-
-public class CreateSeamRuntimes extends TestControl{
-
- public void testCreateSeamRuntime12(){
- createSeamRuntime(seam12Settings, SEAM_12_SETTINGS_HOME);
- }
-
- public void testCreateSeamRuntime2fp(){
- createSeamRuntime(seam2fpSettings, SEAM_2FP_SETTINGS_HOME);
- }
-
- public void testCreateSeamRuntime22(){
- createSeamRuntime(seam22Settings, SEAM_22_SETTINGS_HOME);
- }
-}
Deleted:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateServerRuntimes.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateServerRuntimes.java 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/CreateServerRuntimes.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -1,10 +0,0 @@
-package org.jboss.tools.seam.ui.bot.test.create;
-
-import org.jboss.tools.seam.ui.bot.test.TestControl;
-
-public class CreateServerRuntimes extends TestControl{
-
- public void testCreateEAPServerRuntime(){
- createServerRuntime(jbossEAPRuntime);
- }
-}
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/DeleteSeamProjects.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/DeleteSeamProjects.java 2010-12-14
16:43:23 UTC (rev 27457)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/create/DeleteSeamProjects.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -1,32 +1,43 @@
package org.jboss.tools.seam.ui.bot.test.create;
+import java.util.Properties;
+
+import org.jboss.tools.seam.ui.bot.test.AbstractSeamTestBase;
+import org.jboss.tools.seam.ui.bot.test.EARTests;
import org.jboss.tools.seam.ui.bot.test.TestControl;
+import org.jboss.tools.seam.ui.bot.test.WARTests;
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
+import org.jboss.tools.ui.bot.ext.SWTUtilExt;
+import org.jboss.tools.ui.bot.test.SWTJBTBot;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
-public class DeleteSeamProjects extends TestControl{
+public class DeleteSeamProjects extends AbstractSeamTestBase {
+
+ protected static final String VALIDATION = "Validation";
+ protected static final String DEPLOY_SOURCE = "Deploying datasource to
server";
+ protected static final String REG_IN_SERVER = "Register in server";
-/*
- public void testDeleteSeamProject12war(){
- deleteSeamProject(seam12Settings, TYPE_WAR);
+ public DeleteSeamProjects() {
}
+
+ private SWTJBTExt swtJbtExt = new SWTJBTExt(bot);
- public void testDeleteSeamProject12ear(){
- deleteSeamProject(seam12Settings, TYPE_EAR);
+ @Test
+ @Category(WARTests.class)
+ public void testDeleteSeamProjectWar(){
+ swtJbtExt.deleteProject(testProjectName + TestControl.TYPE_WAR);
+ swtJbtExt.deleteProject(testProjectName + TestControl.TYPE_WAR + "-test");
}
- public void testDeleteSeamProject2fpwar(){
- deleteSeamProject(seam2fpSettings, TYPE_WAR);
+ @Test
+ @Category(EARTests.class)
+ public void testDeleteSeamProjectEar(){
+ swtJbtExt.deleteProject(testProjectName + TestControl.TYPE_EAR);
+ swtJbtExt.deleteProject(testProjectName + TestControl.TYPE_EAR + "-ear");
+ swtJbtExt.deleteProject(testProjectName + TestControl.TYPE_EAR + "-ejb");
+ swtJbtExt.deleteProject(testProjectName + TestControl.TYPE_EAR + "-test");
}
-
- public void testDeleteSeamProject2fpear(){
- deleteSeamProject(seam2fpSettings, TYPE_EAR);
- }
-
- public void testDeleteSeamProject21war(){
- deleteSeamProject(seam21Settings, TYPE_WAR);
- }
-
- public void testDeleteSeamProject21ear(){
- deleteSeamProject(seam21Settings, TYPE_EAR);
- }*/
-}
+
+}
\ No newline at end of file
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/misc/GotoComponent.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/misc/GotoComponent.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/misc/GotoComponent.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -0,0 +1,45 @@
+package org.jboss.tools.seam.ui.bot.test.misc;
+
+import static org.junit.Assert.assertTrue;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTabItem;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem;
+import org.eclipse.ui.part.EditorActionBarContributor;
+import org.jboss.tools.seam.ui.bot.test.AbstractSeamTestBase;
+import org.jboss.tools.seam.ui.bot.test.EARTests;
+import org.jboss.tools.seam.ui.bot.test.TestControl;
+import org.jboss.tools.seam.ui.bot.test.WARTests;
+import org.jboss.tools.ui.bot.test.SWTJBTBot;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+
+public class GotoComponent {
+
+ @Test
+ @Category(WARTests.class)
+ public void testGotoComponentWar() {
+ testGotoComponent(TestControl.TYPE_WAR);
+ }
+
+ @Test
+ @Category(EARTests.class)
+ public void testGotoComponentEar() {
+ testGotoComponent(TestControl.TYPE_EAR);
+ }
+
+ private void testGotoComponent(String type) {
+ SWTJBTBot bot = new SWTJBTBot();
+ bot.menu("Navigate").menu("Open Seam Component").click();
+ bot.text().setText("authenticator");
+ SWTBotTableItem tabItem = bot.table().getTableItem("authenticator - " +
AbstractSeamTestBase.testProjectName + type +
+ ((type == TestControl.TYPE_EAR) ? "-ejb" : ""));
+ tabItem.select();
+ bot.button("OK").click();
+
+ SWTBotEditor editor = bot.activeEditor();
+ assertTrue("Authenticator component not activated.",
editor.getTitle().equals("Authenticator.java"));
+ editor.close();
+ }
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/misc/ReverseEngineering.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/misc/ReverseEngineering.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/misc/ReverseEngineering.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -0,0 +1,80 @@
+package org.jboss.tools.seam.ui.bot.test.misc;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.seam.ui.bot.test.AbstractSeamTestBase;
+import org.jboss.tools.seam.ui.bot.test.EARTests;
+import org.jboss.tools.seam.ui.bot.test.TestControl;
+import org.jboss.tools.seam.ui.bot.test.WARTests;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
+import org.jboss.tools.ui.bot.test.SWTJBTBot;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+public class ReverseEngineering extends AbstractSeamTestBase {
+
+ private static final String[] ENTITIES = new String[] {
+ "Customers", "Employees", "Offices",
"Orderdetails", "Orders", "Payments",
"Productlines", "Products"
+ };
+
+ @Test
+ @Category(WARTests.class)
+ public void testRevEngFromDBWar() {
+ testRevEngFromDB(TestControl.TYPE_WAR);
+ }
+
+ @Test
+ @Category(EARTests.class)
+ public void testRevEngFromDBEar() {
+ testRevEngFromDB(TestControl.TYPE_EAR);
+ }
+
+ private void testRevEngFromDB(String type) {
+
+ // launch reveng
+
+ SWTJBTBot bot = new SWTJBTBot();
+ bot.menu("New").menu("Seam Generate Entities").click();
+ bot.text().setText(AbstractSeamTestBase.testProjectName + type);
+ bot.radio("Reverse engineer from database").click();
+ bot.button("Next >").click();
+ bot.button("Refresh").click();
+
+ SWTBotTree schemaTree = bot.tree();
+ schemaTree.select("<Default caalog>", "PUBLIC");
+
+ bot.button("Include...").click();
+ bot.button("Finish").click();
+
+ // wait for reveng to complete
+ SWTTestExt.util.waitForNonIgnoredJobs(60000);
+
+ // check that the entities are present
+ projectExplorer.show();
+ String[] path;
+ if (type == TestControl.TYPE_EAR)
+ path = new String[] {testProjectName + type + "-ejb",
+ "ejbModule", "org.domain.seamprjear.entity"};
+ else
+ path = new String[] {testProjectName + type,
+ "src", "main", "org", "domain",
"seamprjwar", "session"};
+
+ for (String entity: ENTITIES) {
+ projectExplorer.selectTreeItem(entity + ".java", path);
+ }
+
+ // check that associated web pages are present
+ path = new String[] {testProjectName + type , "Web Resources : WebContent"};
+ for (String entity: ENTITIES) {
+ projectExplorer.selectTreeItem(entity + ".page.xml", path);
+ projectExplorer.selectTreeItem(entity + ".xhtml", path);
+ projectExplorer.selectTreeItem(entity + "Edit.page.xml", path);
+ projectExplorer.selectTreeItem(entity + "Edit.xhtml", path);
+ projectExplorer.selectTreeItem(entity + "List.page.xml", path);
+ projectExplorer.selectTreeItem(entity + "List.xhtml", path);
+ }
+
+ }
+
+
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/validate/ComponentsValidator.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/validate/ComponentsValidator.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/validate/ComponentsValidator.java 2010-12-14
16:54:27 UTC (rev 27458)
@@ -0,0 +1,96 @@
+package org.jboss.tools.seam.ui.bot.test.validate;
+
+import java.util.Properties;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotView;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.seam.ui.bot.test.AbstractSeamTestBase;
+import org.jboss.tools.seam.ui.bot.test.EARTests;
+import org.jboss.tools.seam.ui.bot.test.TestControl;
+import org.jboss.tools.seam.ui.bot.test.WARTests;
+import org.jboss.tools.ui.bot.ext.SWTTestExt;
+import org.jboss.tools.ui.bot.ext.view.ProblemsView;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+public class ComponentsValidator extends AbstractSeamTestBase {
+
+ public static String NL = System.getProperty("line.separator");
+
+ public ComponentsValidator() {
+ }
+
+ @Test
+ @Category(WARTests.class)
+ public void testAddComponentPropertyWar() {
+ testAddComponentProperty(TestControl.TYPE_WAR);
+
+ }
+
+ @Test
+ @Category(EARTests.class)
+ public void testAddComponentPropertyEar() {
+ testAddComponentProperty(TestControl.TYPE_EAR);
+ }
+
+ private void testAddComponentProperty(String type) {
+ // open components.xml
+ SWTBotEclipseEditor cEditor = projectExplorer.openFile(testProjectName + type,
+ "Web Resources : WebContent", "WEB-INF",
"components.xml").toTextEditor();
+
+
+ // add non-existing property
+ int idx = 0;
+ for(String line : cEditor.getLines()) {
+ if (line.contains("</components")) {
+ cEditor.insertText(idx, 0, "<component
name=\"authenticator\">" + NL);
+ cEditor.insertText(idx + 1, 0, "<property
name=\"foo\">TEST</property>" + NL);
+ cEditor.insertText(idx + 2, 0, "</component>" + NL);
+ }
+ idx++;
+ }
+ cEditor.save();
+ SWTTestExt.util.waitForNonIgnoredJobs(60000);
+
+ // check that Seam Problem exists
+ SWTBotView pBotView = problems.show();
+ SWTBotTreeItem[] sProblems = problems.getFilteredErrorsTreeItems(bot, "does not
have a setter or a field",
+ "/" + testProjectName, "components.xml", "Seam
Problem");
+ assertTrue("No Seam problem found.", ( (sProblems != null) &&
(sProblems.length > 0) ));
+ assertTrue("More than one Seam problem found.", sProblems.length <= 1);
+
+ // add property
+
+ SWTBotEclipseEditor aEditor;
+ if (type == TestControl.TYPE_EAR)
+ aEditor = projectExplorer.openFile(testProjectName + type + "-ejb",
+ "ejbModule", "org.domain.seamprjear.session",
"Authenticator.java").toTextEditor();
+ else
+ aEditor = projectExplorer.openFile(testProjectName + type,
+ "src", "hot", "org", "domain",
"seamprjwar", "session",
"Authenticator.java").toTextEditor();
+
+ idx = 0;
+ for(String line : aEditor.getLines()) {
+ if (line.contains("public boolean authenticate()")) {
+ aEditor.insertText(idx, 0, "public String foo; \n");
+ break;
+ }
+ idx++;
+ }
+ aEditor.save();
+ SWTTestExt.util.waitForNonIgnoredJobs(60000);
+
+ // check that Seam Problem disappeared
+ problems.show();
+ sProblems = problems.getFilteredErrorsTreeItems(bot, "does not have a setter or a
field",
+ "/" + testProjectName, "components.xml", "Seam
Problem");
+ assertTrue("Seam problem still exists.", sProblems == null);
+
+ cEditor.close();
+ aEditor.close();
+
+ }
+
+}
Property changes on:
trunk/seam/tests/org.jboss.tools.seam.ui.bot.test/src/org/jboss/tools/seam/ui/bot/test/validate/ComponentsValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain