Author: jjankovi
Date: 2012-05-08 07:17:39 -0400 (Tue, 08 May 2012)
New Revision: 40846
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/SeamLibrary.java
Removed:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/SeamLibraries.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/CDISeam3AllBotTests.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/Seam3TestBase.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/SolderAnnotationTestBase.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/SolderTestBase.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/DefaultBeansTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/ExactAnnotationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/FullyQualifiedTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/NamedPackagesTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/RequiresAnnotationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/VetoAnnotationTest.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/uiutils/AssignableBeansDialogExt.java
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/LibraryHelper.java
Log:
reformatting seam3 test - better method names, javadoc ...
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/CDISeam3AllBotTests.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/CDISeam3AllBotTests.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/CDISeam3AllBotTests.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -24,25 +24,9 @@
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
-
/**
- * This test suite requires JBoss AS 6 or newer
+ * Suite duration: aprox. 18min
*
- * System properties:
- * -Dswtbot.test.properties.file=$PATH
- * -Dusage_reporting_enabled=$BOOLEAN
- *
- * Format of swtbot.properties file:
- * SERVER=EAP|JBOSS_AS,<server version>,<jre version to run
with>|default,<server home>
- *
- * Sample swtbot.properties file:
- *
- *
SERVER=JBOSS_AS,6.0,default,/home/jjankovi/Dokumenty/Red_Hat_Stuff/Runtimes/jboss-6.0.0.Final
- * JAVA=1.6,/space/java/sdk/jdk1.6.0_22
- *
- *
- * Suite duration: aprox. 3min
- *
* @author Jaroslav Jankovic
*/
@RunWith(RequirementAwareSuite.class)
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/Seam3TestBase.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/Seam3TestBase.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/Seam3TestBase.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -18,7 +18,7 @@
import org.jboss.tools.cdi.seam3.bot.test.Activator;
import org.jboss.tools.cdi.seam3.bot.test.CDISeam3AllBotTests;
import org.jboss.tools.cdi.seam3.bot.test.util.LibraryHelper;
-import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibraries;
+import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibrary;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
@@ -32,6 +32,11 @@
version = "6.0", operator = ">="))
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({ CDISeam3AllBotTests.class })
+/**
+ *
+ * @author jjankovi
+ *
+ */
public class Seam3TestBase extends CDITestBase {
private String projectName = "CDISeam3Project";
@@ -47,15 +52,24 @@
return packageName;
}
+ protected SeamLibrary getSeamLibrary() {
+ return SeamLibrary.UNKNOWN;
+ }
+
@Override
public void prepareWorkspace() {
if (!projectHelper.projectExists(getProjectName())) {
- importSeam3TestProject(getProjectName(), "/resources/projects/" +
- getProjectName(), getProjectName());
+ importSeam3ProjectWithLibrary(getProjectName());
}
}
+ /**
+ *
+ * @param projectName
+ * @param projectLocation
+ * @param dir
+ */
protected void importSeam3TestProject(String projectName,
String projectLocation, String dir) {
ImportHelper.importProject(projectLocation, dir, Activator.PLUGIN_ID);
@@ -66,20 +80,43 @@
configuredState.getServer().name);
}
- protected void addAndCheckLibraryInProject(String projectName,
- SeamLibraries library) {
- addLibraryIntoProject(projectName, library.getName());
- checkLibraryInProject(projectName, library.getName());
+ /**
+ *
+ * @param projectName
+ */
+ protected void importSeam3ProjectWithLibrary(String projectName) {
+ importSeam3ProjectWithLibrary(projectName, getSeamLibrary());
}
+ /**
+ *
+ * @param projectName
+ * @param library
+ */
protected void importSeam3ProjectWithLibrary(String projectName,
- SeamLibraries library) {
+ SeamLibrary library) {
importSeam3TestProject(projectName,
"/resources/projects/" + projectName, projectName);
addAndCheckLibraryInProject(projectName, library);
eclipse.cleanAllProjects();
}
+ /**
+ *
+ * @param projectName
+ * @param library
+ */
+ protected void addAndCheckLibraryInProject(String projectName,
+ SeamLibrary library) {
+ addLibraryIntoProject(projectName, library.getName());
+ checkLibraryInProject(projectName, library.getName());
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param libraryName
+ */
private void addLibraryIntoProject(String projectName, String libraryName) {
try {
libraryHelper.addLibraryIntoProject(projectName, libraryName);
@@ -93,6 +130,11 @@
}
}
+ /**
+ *
+ * @param projectName
+ * @param libraryName
+ */
private void checkLibraryInProject(String projectName, String libraryName) {
assertTrue(libraryHelper.isLibraryInProjectClassPath(projectName, libraryName));
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/SolderAnnotationTestBase.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/SolderAnnotationTestBase.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/SolderAnnotationTestBase.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -15,22 +15,89 @@
import org.jboss.tools.cdi.bot.test.CDIConstants;
import org.jboss.tools.cdi.bot.test.annotations.ProblemsType;
+/**
+ *
+ * @author jjankovi
+ *
+ */
public class SolderAnnotationTestBase extends SolderTestBase {
protected String APPLICATION_CLASS = "Application.java";
- protected void testAnnotationImproperValue(String projectName, boolean noBeanEligible)
{
+ /**
+ *
+ * @param projectName
+ */
+ protected void testNoBeanValidationProblemExists(String projectName) {
+ testBeanValidationProblemExists(projectName, true);
+
+ }
+
+ /**
+ *
+ * @param projectName
+ */
+ protected void testMultipleBeansValidationProblemExists(String projectName) {
+
+ testBeanValidationProblemExists(projectName, false);
+
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param noBeanEligible
+ */
+ private void testBeanValidationProblemExists(String projectName, boolean noBeanEligible)
{
+
SWTBotTreeItem[] validationProblems = quickFixHelper.getProblems(
ProblemsType.WARNINGS, projectName);
assertTrue(validationProblems.length > 0);
assertTrue(validationProblems.length == 1);
assertContains(noBeanEligible?CDIConstants.NO_BEAN_IS_ELIGIBLE:
CDIConstants.MULTIPLE_BEANS, validationProblems[0].getText());
+
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param openOnString
+ * @param openedClass
+ * @param producer
+ * @param producerMethod
+ */
+ protected void testProperInjectBean(String projectName,
+ String openOnString, String openedClass) {
+ testProperInject(projectName, openOnString, openedClass, false, null);
+
}
- protected void testAnnotationProperValue(String projectName, String openOnString, String
openedClass,
+ /**
+ *
+ * @param projectName
+ * @param openOnString
+ * @param openedClass
+ */
+ protected void testProperInjectProducer(String projectName,
+ String openOnString, String openedClass,
+ String producerMethod) {
+
+ testProperInject(projectName, openOnString, openedClass, true, producerMethod);
+
+ }
+
+ /**
+ *
+ * @param projectName
+ * @param openOnString
+ * @param openedClass
+ * @param producer
+ * @param producerMethod
+ */
+ private void testProperInject(String projectName, String openOnString, String
openedClass,
boolean producer, String producerMethod) {
SWTBotTreeItem[] validationProblems = quickFixHelper.getProblems(
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/SolderTestBase.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/SolderTestBase.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/base/SolderTestBase.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -1,14 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 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.cdi.seam3.bot.test.base;
-import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibraries;
-
+import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibrary;
+/**
+ *
+ * @author jjankovi
+ *
+ */
public class SolderTestBase extends Seam3TestBase {
@Override
- public void prepareWorkspace() {
- if (!projectHelper.projectExists(getProjectName())) {
- importSeam3ProjectWithLibrary(getProjectName(), SeamLibraries.SOLDER);
- }
+ protected SeamLibrary getSeamLibrary() {
+ return SeamLibrary.SOLDER;
}
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/DefaultBeansTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/DefaultBeansTest.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/DefaultBeansTest.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -18,6 +18,11 @@
import org.jboss.tools.cdi.seam3.bot.test.uiutils.AssignableBeansDialogExt;
import org.junit.Test;
+/**
+ *
+ * @author jjankovi
+ *
+ */
public class DefaultBeansTest extends SolderAnnotationTestBase {
@Override
@@ -30,16 +35,14 @@
projectExplorer.deleteProject(getProjectName(), true);
}
- private String className = "Application.java";
-
@Test
public void testProperAssign() {
packageExplorer.openFile(getProjectName(), CDIConstants.SRC,
- getPackageName(), className);
+ getPackageName(), APPLICATION_CLASS);
- assertFalse(openOnUtil.openOnByOption("managerImpl", className,
CDIConstants.SHOW_ALL_ASSIGNABLE));
- openOnUtil.openOnByOption("managerImpl", className,
CDIConstants.OPEN_INJECT_BEAN);
+ assertFalse(openOnUtil.openOnByOption("managerImpl", APPLICATION_CLASS,
CDIConstants.SHOW_ALL_ASSIGNABLE));
+ openOnUtil.openOnByOption("managerImpl", APPLICATION_CLASS,
CDIConstants.OPEN_INJECT_BEAN);
String destinationFile = getEd().getTitle();
assertTrue("ERROR: redirected to " + destinationFile,
destinationFile.equals("DefaultOne.java"));
@@ -53,9 +56,9 @@
"Manager", null, null).finish();
packageExplorer.openFile(getProjectName(), CDIConstants.SRC,
- getPackageName(), className);
+ getPackageName(), APPLICATION_CLASS);
- assertTrue(openOnUtil.openOnByOption("managerImpl", className,
CDIConstants.SHOW_ALL_ASSIGNABLE));
+ assertTrue(openOnUtil.openOnByOption("managerImpl", APPLICATION_CLASS,
CDIConstants.SHOW_ALL_ASSIGNABLE));
AssignableBeansDialogExt assignDialog = new
AssignableBeansDialogExt(bot.shell("Assignable Beans"));
@@ -69,7 +72,7 @@
assertTrue(allBeans.size() == 1);
assertTrue(allBeans.get(0).contains("DefaultOne"));
- openOnUtil.openOnByOption("managerImpl", className,
CDIConstants.OPEN_INJECT_BEAN);
+ openOnUtil.openOnByOption("managerImpl", APPLICATION_CLASS,
CDIConstants.OPEN_INJECT_BEAN);
String destinationFile = getEd().getTitle();
assertTrue("ERROR: redirected to " + destinationFile,
destinationFile.equals("DefaultOne.java"));
@@ -83,9 +86,9 @@
"Manager", null, null).finish();
packageExplorer.openFile(getProjectName(), CDIConstants.SRC,
- getPackageName(), className);
+ getPackageName(), APPLICATION_CLASS);
- assertTrue(openOnUtil.openOnByOption("managerImpl", className,
CDIConstants.SHOW_ALL_ASSIGNABLE));
+ assertTrue(openOnUtil.openOnByOption("managerImpl", APPLICATION_CLASS,
CDIConstants.SHOW_ALL_ASSIGNABLE));
AssignableBeansDialogExt assignDialog = new
AssignableBeansDialogExt(bot.shell("Assignable Beans"));
@@ -99,7 +102,7 @@
assertTrue(allBeans.size() == 1);
assertTrue(allBeans.get(0).contains("ManagerImpl"));
- openOnUtil.openOnByOption("managerImpl", className,
CDIConstants.OPEN_INJECT_BEAN);
+ openOnUtil.openOnByOption("managerImpl", APPLICATION_CLASS,
CDIConstants.OPEN_INJECT_BEAN);
String destinationFile = getEd().getTitle();
assertTrue("ERROR: redirected to " + destinationFile,
destinationFile.equals("ManagerImpl.java"));
@@ -113,9 +116,9 @@
"Manager", null, null).finish();
packageExplorer.openFile(getProjectName(), CDIConstants.SRC,
- getPackageName(), className);
+ getPackageName(), APPLICATION_CLASS);
- assertTrue(openOnUtil.openOnByOption("managerImpl", className,
CDIConstants.SHOW_ALL_ASSIGNABLE));
+ assertTrue(openOnUtil.openOnByOption("managerImpl", APPLICATION_CLASS,
CDIConstants.SHOW_ALL_ASSIGNABLE));
AssignableBeansDialogExt assignDialog = new
AssignableBeansDialogExt(bot.shell("Assignable Beans"));
@@ -132,7 +135,7 @@
assertTrue(allBeans.size() == 1);
assertTrue(allBeans.get(0).contains("ManagerImpl"));
- openOnUtil.openOnByOption("managerImpl", className,
CDIConstants.OPEN_INJECT_BEAN);
+ openOnUtil.openOnByOption("managerImpl", APPLICATION_CLASS,
CDIConstants.OPEN_INJECT_BEAN);
String destinationFile = getEd().getTitle();
assertTrue("ERROR: redirected to " + destinationFile,
destinationFile.equals("ManagerImpl.java"));
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/ExactAnnotationTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/ExactAnnotationTest.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/ExactAnnotationTest.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -13,22 +13,20 @@
import org.jboss.tools.cdi.bot.test.CDIConstants;
import org.jboss.tools.cdi.seam3.bot.test.base.SolderAnnotationTestBase;
-import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibraries;
+import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibrary;
import org.junit.Test;
+/**
+ *
+ * @author jjankovi
+ *
+ */
public class ExactAnnotationTest extends SolderAnnotationTestBase {
- private String className = "Application.java";
-
private final String EXACT_INTERFACE = "exact-interface";
private final String EXACT_BEANS = "exact-beans";
@Override
- public String getProjectName() {
- return "exact-interface";
- }
-
- @Override
public void prepareWorkspace() {
}
@@ -58,22 +56,22 @@
String peopleManager = "PeopleManager";
String otherManager = "OtherManager";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
- getPackageName(), className).toTextEditor());
+ getPackageName(), APPLICATION_CLASS).toTextEditor());
- testAnnotationImproperValue(projectName, false);
+ testMultipleBeansValidationProblemExists(projectName);
editResourceUtil.replaceInEditor(managerClass, peopleManager + ".class");
- testAnnotationProperValue(projectName, peopleManager + ".class",
- peopleManager, false, null);
+ testProperInjectBean(projectName, peopleManager + ".class",
+ peopleManager);
- bot.editorByTitle(className).show();
+ bot.editorByTitle(APPLICATION_CLASS).show();
editResourceUtil.replaceInEditor(peopleManager + ".class", otherManager +
".class");
- testAnnotationProperValue(projectName, otherManager + ".class",
- otherManager, false, null);
+ testProperInjectBean(projectName, otherManager + ".class",
+ otherManager);
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/FullyQualifiedTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/FullyQualifiedTest.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/FullyQualifiedTest.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -18,20 +18,18 @@
import org.jboss.tools.cdi.bot.test.CDIConstants;
import org.jboss.tools.cdi.bot.test.annotations.ProblemsType;
import org.jboss.tools.cdi.bot.test.uiutils.CollectionsUtil;
-import org.jboss.tools.cdi.seam3.bot.test.base.SolderTestBase;
-import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibraries;
+import org.jboss.tools.cdi.seam3.bot.test.base.SolderAnnotationTestBase;
+import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibrary;
import org.junit.Test;
-public class FullyQualifiedTest extends SolderTestBase {
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class FullyQualifiedTest extends SolderAnnotationTestBase {
- private String APPLICATION_CLASS = "Application.java";
-
@Override
- public String getProjectName() {
- return "fullyQualified";
- }
-
- @Override
public void waitForJobs() {
projectExplorer.deleteAllProjects();
}
@@ -46,7 +44,7 @@
String projectName = "fullyQualified1";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
@@ -63,7 +61,7 @@
String projectName = "fullyQualified2";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
@@ -89,7 +87,7 @@
String projectName = "fullyQualified3";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
@@ -110,7 +108,7 @@
String projectName = "fullyQualified4";
String myBean1 = "MyBean1.java";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), myBean1).toTextEditor());
@@ -135,7 +133,7 @@
String projectName = "fullyQualified5";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
@@ -172,7 +170,7 @@
String projectName = "fullyQualified6";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
@@ -228,7 +226,7 @@
String projectName = "fullyQualified7";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/NamedPackagesTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/NamedPackagesTest.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/NamedPackagesTest.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -19,6 +19,11 @@
import org.jboss.tools.cdi.seam3.bot.test.base.SolderTestBase;
import org.junit.Test;
+/**
+ *
+ * @author jjankovi
+ *
+ */
public class NamedPackagesTest extends SolderTestBase {
private final String CDI_SEAM_PACKAGE = "cdi.seam";
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/RequiresAnnotationTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/RequiresAnnotationTest.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/RequiresAnnotationTest.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -13,17 +13,17 @@
import org.jboss.tools.cdi.bot.test.CDIConstants;
import org.jboss.tools.cdi.seam3.bot.test.base.SolderAnnotationTestBase;
-import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibraries;
+import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibrary;
import org.junit.Test;
+/**
+ *
+ * @author jjankovi
+ *
+ */
public class RequiresAnnotationTest extends SolderAnnotationTestBase {
@Override
- public String getProjectName() {
- return "requires1";
- }
-
- @Override
public void waitForJobs() {
projectExplorer.deleteAllProjects();
}
@@ -40,19 +40,19 @@
String manager = "Manager";
String projectName = "requires1";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
- testAnnotationImproperValue(projectName, true);
+ testNoBeanValidationProblemExists(projectName);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), managerProducer + ".java").toTextEditor());
editResourceUtil.replaceInEditor("(a)Requires(\"cdi.test." + manager +
"\")",
"@Requires(\"" + getPackageName() + "." + manager +
"\")");
- testAnnotationProperValue(projectName, "managerProducer", managerProducer,
false, null);
+ testProperInjectBean(projectName, "managerProducer", managerProducer);
}
@@ -63,19 +63,19 @@
String manager = "Manager";
String projectName = "requires2";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
- testAnnotationImproperValue(projectName, true);
+ testNoBeanValidationProblemExists(projectName);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), managerProducer + ".java").toTextEditor());
editResourceUtil.replaceInEditor("(a)Requires(\"cdi.test." + manager +
"\")",
"@Requires(\"" + getPackageName() + "." + manager +
"\")");
- testAnnotationProperValue(projectName, "managerProducer", managerProducer,
false, null);
+ testProperInjectBean(projectName, "managerProducer", managerProducer);
}
@@ -86,20 +86,20 @@
String manager = "Manager";
String projectName = "requires3";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
- testAnnotationImproperValue(projectName, true);
+ testNoBeanValidationProblemExists(projectName);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), managerProducer + ".java").toTextEditor());
editResourceUtil.replaceInEditor("(a)Requires(\"cdi.test." + manager +
"\")",
"@Requires(\"" + getPackageName() + "." + manager +
"\")");
- testAnnotationProperValue(projectName, "managerProducer",
- managerProducer, true, "getManagerProducer");
+ testProperInjectProducer(projectName, "managerProducer",
+ managerProducer, "getManagerProducer");
}
@@ -110,20 +110,20 @@
String manager = "Manager";
String projectName = "requires4";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
- testAnnotationImproperValue(projectName, true);
+ testNoBeanValidationProblemExists(projectName);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), managerProducer + ".java").toTextEditor());
editResourceUtil.replaceInEditor("(a)Requires(\"cdi.test." + manager +
"\")",
"@Requires(\"" + getPackageName() + "." + manager +
"\")");
- testAnnotationProperValue(projectName, "managerProducer",
- managerProducer, true, "managerProducer");
+ testProperInjectProducer(projectName, "managerProducer",
+ managerProducer, "managerProducer");
}
@@ -135,7 +135,7 @@
String projectName = "requires5";
String eventAttribute = "eventAttribute";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/VetoAnnotationTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/VetoAnnotationTest.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/VetoAnnotationTest.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -13,17 +13,17 @@
import org.jboss.tools.cdi.bot.test.CDIConstants;
import org.jboss.tools.cdi.seam3.bot.test.base.SolderAnnotationTestBase;
-import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibraries;
+import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibrary;
import org.junit.Test;
+/**
+ *
+ * @author jjankovi
+ *
+ */
public class VetoAnnotationTest extends SolderAnnotationTestBase {
@Override
- public String getProjectName() {
- return "veto1";
- }
-
- @Override
public void waitForJobs() {
projectExplorer.deleteAllProjects();
}
@@ -40,19 +40,19 @@
String otherBean = "OtherBean";
String projectName = "veto1";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
- testAnnotationImproperValue(projectName, true);
+ testNoBeanValidationProblemExists(projectName);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), otherBean + ".java").toTextEditor());
editResourceUtil.replaceInEditor("public class " + otherBean,
"public class " + otherBean + " extends " + vetoBean);
- testAnnotationProperValue(projectName, "bean", otherBean, false, null);
+ testProperInjectBean(projectName, "bean", otherBean);
}
@@ -63,19 +63,19 @@
String otherBean = "OtherBean";
String projectName = "veto2";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
- testAnnotationImproperValue(projectName, true);
+ testNoBeanValidationProblemExists(projectName);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), otherBean + ".java").toTextEditor());
editResourceUtil.replaceInEditor("public class " + otherBean,
"public class " + otherBean + " extends " + vetoBean);
- testAnnotationProperValue(projectName, "bean", otherBean, false, null);
+ testProperInjectBean(projectName, "bean", otherBean);
}
@@ -85,20 +85,19 @@
String vetoBean = "Bean";
String projectName = "veto3";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
- testAnnotationImproperValue(projectName, true);
+ testNoBeanValidationProblemExists(projectName);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), vetoBean + ".java").toTextEditor());
editResourceUtil.replaceInEditor("@Veto", "");
editResourceUtil.replaceInEditor("import org.jboss.seam.solder.core.Veto;",
"");
- testAnnotationProperValue(projectName, "manager", vetoBean,
- true, "getManager");
+ testProperInjectProducer(projectName, "manager", vetoBean,
"getManager");
}
@@ -108,20 +107,19 @@
String vetoBean = "Bean";
String projectName = "veto4";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
- testAnnotationImproperValue(projectName, true);
+ testNoBeanValidationProblemExists(projectName);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), vetoBean + ".java").toTextEditor());
editResourceUtil.replaceInEditor("@Veto", "");
editResourceUtil.replaceInEditor("import org.jboss.seam.solder.core.Veto;",
"");
- testAnnotationProperValue(projectName, "manager", vetoBean,
- true, "manager");
+ testProperInjectProducer(projectName, "manager", vetoBean,
"manager");
}
@@ -132,7 +130,7 @@
String projectName = "veto5";
String eventAttribute = "eventAttribute";
- importSeam3ProjectWithLibrary(projectName, SeamLibraries.SOLDER);
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER);
setEd(packageExplorer.openFile(projectName, CDIConstants.SRC,
getPackageName(), APPLICATION_CLASS).toTextEditor());
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/uiutils/AssignableBeansDialogExt.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/uiutils/AssignableBeansDialogExt.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/uiutils/AssignableBeansDialogExt.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -13,21 +13,27 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.jboss.tools.cdi.bot.test.uiutils.wizards.AssignableBeansDialog;
-
+/**
+ *
+ * @author jjankovi
+ *
+ */
public class AssignableBeansDialogExt extends AssignableBeansDialog {
+ private final String ELIMINATED_DEFAULT_BEAN = "Eliminated @DefaultBean";
+
public AssignableBeansDialogExt(SWTBotShell shell) {
super(shell);
showDefaultBeans();
}
public AssignableBeansDialog hideDefaultBeans() {
- getTreeItem("Eliminated @DefaultBean").uncheck();
+ getTreeItem(ELIMINATED_DEFAULT_BEAN).uncheck();
return this;
}
public AssignableBeansDialog showDefaultBeans() {
- getTreeItem("Eliminated @DefaultBean").check();
+ getTreeItem(ELIMINATED_DEFAULT_BEAN).check();
return this;
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/LibraryHelper.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/LibraryHelper.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/LibraryHelper.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -25,16 +25,22 @@
import org.jboss.tools.cdi.bot.test.CDIConstants;
import org.jboss.tools.cdi.seam3.bot.test.Activator;
import org.jboss.tools.ui.bot.ext.SWTBotExt;
+import org.jboss.tools.ui.bot.ext.SWTBotFactory;
import org.jboss.tools.ui.bot.ext.SWTUtilExt;
import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
import org.jboss.tools.ui.bot.ext.types.IDELabel;
import org.jboss.tools.ui.bot.ext.view.ProjectExplorer;
+/**
+ *
+ * @author jjankovi
+ *
+ */
public class LibraryHelper {
- private ProjectExplorer projectExplorer = new ProjectExplorer();
+ private ProjectExplorer projectExplorer = SWTBotFactory.getProjectexplorer();
- private SWTBotExt bot = new SWTBotExt();
+ private SWTBotExt bot = SWTBotFactory.getBot();
private SWTUtilExt util = new SWTUtilExt(bot);
Deleted:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/SeamLibraries.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/SeamLibraries.java 2012-05-08
10:41:25 UTC (rev 40845)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/SeamLibraries.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2012 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.cdi.seam3.bot.test.util;
-
-public enum SeamLibraries {
-
- SOLDER, INTERNATIONAL;
-
- public String getName() {
- switch (this) {
- case SOLDER:
- return "seam-solder.jar";
- case INTERNATIONAL:
- return "seam-international.jar";
- default:
- throw new AssertionError("Unknown libraries");
- }
- }
-
-}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/SeamLibrary.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/SeamLibrary.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/util/SeamLibrary.java 2012-05-08
11:17:39 UTC (rev 40846)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 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.cdi.seam3.bot.test.util;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public enum SeamLibrary {
+
+ SOLDER, INTERNATIONAL, UNKNOWN;
+
+ public String getName() {
+ switch (this) {
+ case SOLDER:
+ return "seam-solder.jar";
+ case INTERNATIONAL:
+ return "seam-international.jar";
+ case UNKNOWN:
+ default:
+ throw new AssertionError("Unknown libraries");
+ }
+ }
+
+}