[jbosstools-commits] JBoss Tools SVN: r43600 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test: beansxml and 11 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Sep 11 10:37:26 EDT 2012


Author: jjankovi
Date: 2012-09-11 10:37:26 -0400 (Tue, 11 Sep 2012)
New Revision: 43600

Removed:
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDISupportTest.java
Modified:
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDISmokeBotTests.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/decorator/DecoratorFromWebBeanTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/base/BeansXMLQuickFixTestBase.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/dialog/AllAssignableDialogTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/dialog/AssignableDialogFilterTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/injection/ProblemEligibleInjectionTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeanValidationQuickFixTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeansXMLValidationQuickFixTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/IBindingValidationQuickFixTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/InterceptorValidationQuickFixTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QualifierValidationQuickFixTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QuickFixProposalsDescriptionTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/ScopeValidationQuickFixTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/StereotypeValidationQuickFixTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/QuickFixHelper.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIRefactorWizard.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/QuickFixDialogWizard.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java
Log:
fixing CDI test against 4.0.0 Alpha1 + stabilizing CDI tests

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -30,7 +30,6 @@
 import org.jboss.tools.cdi.bot.test.quickfix.test.QuickFixProposalsDescriptionTest;
 import org.jboss.tools.cdi.bot.test.quickfix.test.ScopeValidationQuickFixTest;
 import org.jboss.tools.cdi.bot.test.quickfix.test.StereotypeValidationQuickFixTest;
-import org.jboss.tools.cdi.bot.test.wizard.CDISupportTest;
 import org.jboss.tools.cdi.bot.test.wizard.CDIWebProjectWizardTest;
 import org.jboss.tools.cdi.bot.test.wizard.ConfigurationPresetTest;
 import org.jboss.tools.cdi.bot.test.wizard.DynamicWebProjectWithCDITest;
@@ -41,23 +40,7 @@
 import org.junit.runners.Suite.SuiteClasses;
 
 /**
- * This test suite requires JBoss AS 6 or newer
- * 
- * 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. 30min
- * 
  * @author Lukas Jungmann
  * @author Jaroslav Jankovic
  */
@@ -68,7 +51,6 @@
 	
 	ConfigurationPresetTest.class,
 	FacetTest.class, 
-	CDISupportTest.class,
 	CDIWebProjectWizardTest.class,
 	DynamicWebProjectWithCDITest.class,
 	WizardTest.class,

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDISmokeBotTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDISmokeBotTests.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDISmokeBotTests.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -13,8 +13,9 @@
 import org.jboss.tools.cdi.bot.test.beansxml.BeansXMLValidationTest;
 import org.jboss.tools.cdi.bot.test.editor.BeansEditorTest;
 import org.jboss.tools.cdi.bot.test.quickfix.injection.ProblemEligibleInjectionTest;
-import org.jboss.tools.cdi.bot.test.wizard.CDISupportTest;
+import org.jboss.tools.cdi.bot.test.wizard.CDIWebProjectWizardTest;
 import org.jboss.tools.cdi.bot.test.wizard.ConfigurationPresetTest;
+import org.jboss.tools.cdi.bot.test.wizard.DynamicWebProjectWithCDITest;
 import org.jboss.tools.cdi.bot.test.wizard.FacetTest;
 import org.jboss.tools.cdi.bot.test.wizard.WizardTest;
 import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
@@ -22,31 +23,17 @@
 import org.junit.runners.Suite.SuiteClasses;
 
 /**
- * This test suite requires JBoss AS 6 or newer
- * 
- * 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
- */
+*
+* @author Lukas Jungmann
+* @author Jaroslav Jankovic
+*/
 @RunWith(RequirementAwareSuite.class)
 @SuiteClasses({	
 //	PerspectiveTest.class,	 
 	ConfigurationPresetTest.class,
 	FacetTest.class, 
-	CDISupportTest.class,
+	CDIWebProjectWizardTest.class,
+	DynamicWebProjectWithCDITest.class,
 	WizardTest.class,	
 	BeansEditorTest.class,
 	ProblemEligibleInjectionTest.class,

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -44,13 +44,13 @@
 	private static SWTBotEclipseEditor ed;
 	
 	protected static final Logger LOGGER = Logger.getLogger(CDITestBase.class.getName());
-	public static final CDIProjectHelper projectHelper = new CDIProjectHelper(); 
-	public static final BeansXMLHelper beansHelper = new BeansXMLHelper();
-	public static final CDIWizardHelper wizard = new CDIWizardHelper();
-	public static final CDIWizardBaseExt wizardExt = new CDIWizardBaseExt();
-	public static final OpenOnHelper openOnUtil = new OpenOnHelper();
-	public static final EditorResourceHelper editResourceUtil = new EditorResourceHelper();
-	public static final QuickFixHelper quickFixHelper = new QuickFixHelper();
+	protected static final CDIProjectHelper projectHelper = new CDIProjectHelper(); 
+	protected static final BeansXMLHelper beansHelper = new BeansXMLHelper();
+	protected static final CDIWizardHelper wizard = new CDIWizardHelper();
+	protected static final CDIWizardBaseExt wizardExt = new CDIWizardBaseExt();
+	protected static final OpenOnHelper openOnUtil = new OpenOnHelper();
+	protected static final EditorResourceHelper editResourceUtil = new EditorResourceHelper();
+	protected static final QuickFixHelper quickFixHelper = new QuickFixHelper();
 	
 	public SWTBotEclipseEditor getEd() {
 		return ed;
@@ -63,7 +63,8 @@
 	@Before
 	public void prepareWorkspace() {
 		if (!projectHelper.projectExists(getProjectName())) {
-			projectHelper.createCDIProjectWithDynamicWizard(getProjectName());
+//			projectHelper.createCDIProjectWithDynamicWizard(getProjectName());
+			importCDITestProject(getProjectName());
 		}
 	}
 	

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLCompletionTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -41,11 +41,6 @@
 	private static final List<String> BEANS_XML_TAGS = Arrays.asList(
 			"alternatives", "decorators", "interceptors");
 
-	@Override
-	public String getProjectName() {
-		return "CDIBeansCodeCompletion";
-	}
-	
 	@Test
 	public void testPossibleCompletionInBeansXML() {
 		

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/beansxml/BeansXMLValidationTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -30,11 +30,6 @@
 	private static final String someBean = "Bean1";
 	private static final String nonExistingPackage = "somePackage";
 	
-	@Override
-	public String getProjectName() {
-		return "CDIBeansValidation";
-	}
-	
 	@BeforeClass
 	public static void setup() {
 		problems.show();		

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/decorator/DecoratorFromWebBeanTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/decorator/DecoratorFromWebBeanTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/decorator/DecoratorFromWebBeanTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -19,7 +19,6 @@
 import org.jboss.tools.cdi.bot.test.uiutils.actions.NewCDIFileWizard;
 import org.jboss.tools.cdi.bot.test.uiutils.wizards.CDIWizardBase;
 import org.junit.After;
-import org.junit.Before;
 import org.junit.Test;
 
 /**
@@ -44,12 +43,7 @@
 	public String getProjectName() {
 		return "DecoratorFromWebBean";
 	}
-	
-	@Before
-	public void prepareWorkspace() {
-		
-	}
-	
+
 	@After
 	public void cleanUp() {
 		projectExplorer.deleteAllProjects();
@@ -58,8 +52,6 @@
 	@Test
 	public void testCreatingDecoratorWithMenu() {
 		
-		importCDITestProject(getProjectName());
-		
 		String[] path = (getProjectName() + "/" + CDIConstants.SRC
 				+ "/" + getPackageName()).split("/");
 		
@@ -108,8 +100,6 @@
 	@Test
 	public void testCreatingDecoratorWithWizard() {
 		
-		importCDITestProject(getProjectName());
-		
 		CDIWizardBase decoratorWizard = new NewCDIFileWizard(
 				CDIWizardType.DECORATOR).run();
 		decoratorWizard.setName(ACCOUNT_DECORATOR).

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/editor/BeansEditorTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -69,7 +69,7 @@
 		 * project should be located in workspace after previous test
 		 */
 		try {
-			projectExplorer.selectProject("CDIWizardTest");
+			projectExplorer.selectProject("CDIProject");
 		} catch (WidgetNotFoundException wnfe) {
 			fail("project should be located in workspace");
 		}
@@ -79,11 +79,6 @@
 	public void prepareWorkspace() {
 		new ProjectExplorer().openFile(getProjectName(), descPath.split("/"));								
 	}
-	
-	@Override
-	public String getProjectName() {
-		return "CDIWizardTest";
-	}
 			
 	@Test
 	public void testClasses() {		

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedComponentsSearchingTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -38,12 +38,7 @@
 	private SearchNamedDialogWizard namedDialog = null;
 	private static final String BEAN_STEREOTYPE_PATH = "/resources/named/BeanWithStereotype.java.cdi";
 	private static final String BEAN_STEREOTYPE_NAMED_PATH = "/resources/named/BeanWithStereotypeAndNamed.java.cdi";
-	
-	@Override
-	public String getProjectName() {
-		return "CDINamedSearching";
-	}
-	
+
 	@After
 	public void waitForJobs() {
 		editResourceUtil.deletePackage(getProjectName(), getPackageName());

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/named/NamedRefactoringTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -35,12 +35,7 @@
 	private static final String INDEX_XHTML_2= "index2.xhtml";
 	private static final String INDEX_XHTML_3= "index3.xhtml";
 	private static final String NEW_NAMED_PARAM = "bean2";	
-	
-	@Override
-	public String getProjectName() {
-		return "CDIRefactoring";
-	}
-			
+
 	@After
 	public void waitForJobs() {
 		editResourceUtil.deletePackage(getProjectName(), getPackageName());

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/FindObserverForEventTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -24,11 +24,6 @@
 
 public class FindObserverForEventTest extends OpenOnBase {
 
-	@Override
-	public String getProjectName() {
-		return "CDIObserverTest";
-	}
-	
 	@Test
 	public void testSimpleCaseObserverFinding() {
 

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -26,11 +26,6 @@
 
 public class OpenOnTest extends OpenOnBase {
 	
-	@Override
-	public String getProjectName() {
-		return "CDIOpenOnTest";
-	}
-	
 	@Test
 	public void testBeanInjectOpenOn() {
 

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/base/BeansXMLQuickFixTestBase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/base/BeansXMLQuickFixTestBase.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/base/BeansXMLQuickFixTestBase.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -160,7 +160,7 @@
 		
 		quickFixHelper.openQuickFix(validationProblem);	
 		QuickFixDialogWizard qfWizard = new QuickFixDialogWizard();
-		qfWizard.setFix(qfWizard.getAvailableFixes().get(0));
+		qfWizard.setFix(qfWizard.getDefaultCDIQuickFix());
 		qfWizard.setResource(qfWizard.getResources().get(0));
 		qfWizard.finishWithWait();
 	}

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/dialog/AllAssignableDialogTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/dialog/AllAssignableDialogTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/dialog/AllAssignableDialogTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -14,7 +14,6 @@
 import org.jboss.tools.cdi.bot.test.CDIConstants;
 import org.jboss.tools.cdi.bot.test.CDITestBase;
 import org.jboss.tools.cdi.bot.test.uiutils.wizards.AssignableBeansDialog;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class AllAssignableDialogTest extends CDITestBase {
@@ -25,12 +24,7 @@
 	public String getProjectName() {
 		return "CDIAssignableDialogTest";
 	}
-	
-	@BeforeClass
-	public static void prepareWS() {
-		importCDITestProject("CDIAssignableDialogTest");
-	}
-	
+
 	@Test
 	public void testDecorator() {
 		

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/dialog/AssignableDialogFilterTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/dialog/AssignableDialogFilterTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/dialog/AssignableDialogFilterTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -14,7 +14,6 @@
 import org.jboss.tools.cdi.bot.test.CDIConstants;
 import org.jboss.tools.cdi.bot.test.CDITestBase;
 import org.jboss.tools.cdi.bot.test.uiutils.wizards.AssignableBeansDialog;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class AssignableDialogFilterTest extends CDITestBase {
@@ -25,12 +24,7 @@
 	public String getProjectName() {
 		return "AssignableDialogFilterTest";
 	}
-	
-	@BeforeClass
-	public static void prepareWS() {
-		importCDITestProject("AssignableDialogFilterTest");
-	}
-	
+
 	@Test
 	public void testFilterAssignableBeans() {
 		

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/injection/ProblemEligibleInjectionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/injection/ProblemEligibleInjectionTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/injection/ProblemEligibleInjectionTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -31,11 +31,6 @@
 	private static final String BROKEN_FARM = "BrokenFarm";
 	private static final String QUALIFIER = "Q1";
 	
-	@Override
-	public String getProjectName() {
-		return "CDIMultipleInjections";
-	}
-	
 	@After
 	public void waitForJobs() {
 		editResourceUtil.deletePackage(getProjectName(), getPackageName());		

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeanValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeanValidationQuickFixTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeanValidationQuickFixTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -28,12 +28,7 @@
 public class BeanValidationQuickFixTest extends CDITestBase {
 	
 	private static IValidationProvider validationProvider = new BeanValidationProvider();
-
-	@Override
-	public String getProjectName() {
-		return "CDIQuickFixBeanTest";
-	}
-		
+	
 	public IValidationProvider validationProvider() {
 		return validationProvider;
 	}

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeansXMLValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeansXMLValidationQuickFixTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/BeansXMLValidationQuickFixTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -24,11 +24,6 @@
 
 public class BeansXMLValidationQuickFixTest extends BeansXMLQuickFixTestBase {
 
-	@Override
-	public String getProjectName() {
-		return "CDIQuickFixBeanXMLTest";
-	}
-	
 	@Test
 	public void testNoBeanComponent() {
 

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/DecoratorValidationQuickFixTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -29,11 +29,6 @@
 	
 	private static IValidationProvider validationProvider = new DecoratorValidationProvider();
 
-	@Override
-	public String getProjectName() {
-		return "CDIQuickFixDecoratorTest";
-	}
-	
 	public IValidationProvider validationProvider() {
 		return validationProvider;
 		

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/IBindingValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/IBindingValidationQuickFixTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/IBindingValidationQuickFixTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -29,11 +29,6 @@
 	
 	private static IValidationProvider validationProvider = new InterceptorBindingValidationProvider();
 
-	@Override
-	public String getProjectName() {
-		return "CDIQuickFixIBindingTest";
-	}
-	
 	public IValidationProvider validationProvider() {
 		return validationProvider;
 	}

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/InterceptorValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/InterceptorValidationQuickFixTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/InterceptorValidationQuickFixTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -29,11 +29,6 @@
 	
 	private static IValidationProvider validationProvider = new InterceptorValidationProvider();
 	
-	@Override
-	public String getProjectName() {
-		return "CDIQuickFixInterceptorTest";
-	}
-	
 	public IValidationProvider validationProvider() {
 		return validationProvider;
 	}

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QualifierValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QualifierValidationQuickFixTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QualifierValidationQuickFixTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -28,12 +28,7 @@
 public class QualifierValidationQuickFixTest extends CDITestBase {
 	
 	private static IValidationProvider validationProvider = new QualifierValidationProvider();
-	
-	@Override
-	public String getProjectName() {
-		return "CDIQuickFixQualifierTest";
-	}
-	
+
 	public IValidationProvider validationProvider() {
 		return validationProvider;
 	}
@@ -49,7 +44,8 @@
 		editResourceUtil.replaceInEditor("@Target({ TYPE, METHOD, PARAMETER, FIELD })", 
 				"@Target({ TYPE, FIELD })");
 		
-		quickFixHelper.checkQuickFix(ValidationType.TARGET, getProjectName(), validationProvider());
+		quickFixHelper.checkQuickFix(ValidationType.TARGET, 
+				"@Target({TYPE, METHOD, FIELD, PARAMETER})", getProjectName(), validationProvider());
 		
 		editResourceUtil.replaceInEditor("@Target({TYPE, METHOD, FIELD, PARAMETER})", "");
 		

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QuickFixProposalsDescriptionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QuickFixProposalsDescriptionTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/QuickFixProposalsDescriptionTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -18,7 +18,6 @@
 import org.jboss.tools.cdi.bot.test.CDIConstants;
 import org.jboss.tools.cdi.bot.test.CDITestBase;
 import org.jboss.tools.cdi.bot.test.uiutils.wizards.OpenOnOptionsDialog;
-import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class QuickFixProposalsDescriptionTest extends CDITestBase {
@@ -27,12 +26,7 @@
 	public String getProjectName() {
 		return "CDIQuickFixProposals";
 	}
-	
-	@BeforeClass
-	public static void prepareWS() {
-		importCDITestProject("CDIQuickFixProposals");
-	}
-	
+
 	@Test
 	public void testAddedCode() {
 		

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/ScopeValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/ScopeValidationQuickFixTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/ScopeValidationQuickFixTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -28,12 +28,7 @@
 public class ScopeValidationQuickFixTest extends CDITestBase {
 	
 	private static IValidationProvider validationProvider = new ScopeValidationProvider();
-	
-	@Override
-	public String getProjectName() {
-		return "CDIQuickFixScopeTest";
-	}
-	
+
 	public IValidationProvider validationProvider() {
 		return validationProvider;
 	}

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/StereotypeValidationQuickFixTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/StereotypeValidationQuickFixTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/test/StereotypeValidationQuickFixTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -28,12 +28,7 @@
 public class StereotypeValidationQuickFixTest extends CDITestBase {
 	
 	private static IValidationProvider validationProvider = new StereotypeValidationProvider();
-	
-	@Override
-	public String getProjectName() {
-		return "CDIQuickFixStereotypeTest";
-	}
-	
+
 	public IValidationProvider validationProvider() {
 		return validationProvider;
 	}
@@ -49,7 +44,8 @@
 		editResourceUtil.replaceInEditor("@Target({ TYPE, METHOD, FIELD })", 
 				"@Target({ TYPE, FIELD })");
 		
-		quickFixHelper.checkQuickFix(ValidationType.TARGET, getProjectName(), validationProvider());
+		quickFixHelper.checkQuickFix(ValidationType.TARGET, "@Target({TYPE, METHOD, FIELD})", 
+				getProjectName(), validationProvider());
 
 		editResourceUtil.replaceInEditor("@Target({TYPE, METHOD, FIELD})", "");
 		

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/QuickFixHelper.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/QuickFixHelper.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/QuickFixHelper.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -40,6 +40,12 @@
 	private SWTUtilExt util = SWTBotFactory.getUtil();
 	private SWTBotExt bot = SWTBotFactory.getBot();
 	
+	
+	public void checkQuickFix(ValidationType validationType, String projectName,
+			IValidationProvider validationProvider) {
+		checkQuickFix(validationType, null, projectName, validationProvider);
+	}
+	
 	/**
 	 * checkQuickFix is the most important method in this class. It
 	 * gets validation error prior to component type and annotation type,
@@ -49,12 +55,12 @@
 	 * @param validationType
 	 * @param compType
 	 */
-	public void checkQuickFix(ValidationType validationType, String projectName,
+	public void checkQuickFix(ValidationType validationType, String text, String projectName,
 			IValidationProvider validationProvider) {
 		SWTBotTreeItem validationProblem = getProblem(
 				validationType, projectName, validationProvider);		
 		assertNotNull(validationProblem);
-		resolveQuickFix(validationProblem);
+		resolveQuickFix(validationProblem, text);
 		validationProblem = getProblem(
 				validationType, projectName, validationProvider);		
 		assertNull(validationProblem);
@@ -95,12 +101,22 @@
 	 * chooses first option and confirms it (resolve it)
 	 * @param ti
 	 */
-	private void resolveQuickFix(SWTBotTreeItem ti) {
+	private void resolveQuickFix(SWTBotTreeItem ti, String text) {
 		openQuickFix(ti);
 		
 		QuickFixDialogWizard qfWizard = new QuickFixDialogWizard();
 		
-		String firstFix = qfWizard.getAvailableFixes().get(0);				
+		/**
+		 * if text is not specified, choose the first CDI 
+		 * quickfix available proposal. Otherwise choose
+		 * the one contains entered text
+		 */
+		String firstFix = null;
+		if (text == null) {
+			 firstFix = qfWizard.getDefaultCDIQuickFix();
+		} else {
+			firstFix = qfWizard.getCDIQuickFix(text);
+		}
 		String firstResource = qfWizard.getResources().get(0);
 		
 		qfWizard.setFix(firstFix).setResource(firstResource).finish();

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIRefactorWizard.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIRefactorWizard.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIRefactorWizard.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -44,7 +44,7 @@
 	 */
 	public List<String> getAffectedFiles() {		
 		for (SWTBotTreeItem ti : bot().tree().getTreeItem(RENAME_TEXT_LABEL).getItems()) {			
-			affectedFiles.add(ti.getText());
+			affectedFiles.add(ti.getText().split(" - ")[0]); // remove package offset
 		}
 		return affectedFiles;
 	}

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/QuickFixDialogWizard.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/QuickFixDialogWizard.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/QuickFixDialogWizard.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -55,5 +55,23 @@
 		}
 		return resources;
 	}
+
+	public String getDefaultCDIQuickFix() {
+		for (String fix : getAvailableFixes()) {
+			if (fix.contains("Configure") 
+					|| fix.contains("Add @Suppress")) continue;
+			return fix;
+		}
+		throw new IllegalStateException("No default CDI quick fix is provided " +
+				"for validation problem");
+	}
 	
+	public String getCDIQuickFix(String text) {
+		for (String fix : getAvailableFixes()) {
+			if (fix.contains(text)) return fix;
+			
+		}
+		throw new IllegalStateException("No CDI quick fix contains " + text);
+	}
+	
 }

Deleted: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDISupportTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDISupportTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDISupportTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 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.bot.test.wizard;
-
-import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
-import org.jboss.tools.cdi.bot.test.CDISmokeBotTests;
-import org.jboss.tools.cdi.bot.test.CDITestBase;
-import org.junit.Test;
-import org.junit.runners.Suite.SuiteClasses;
-
- at SuiteClasses({ CDIAllBotTests.class , CDISmokeBotTests.class })
-public class CDISupportTest extends CDITestBase {
-	
-	@Override	
-	public void prepareWorkspace() {
-		if (!projectHelper.projectExists(getProjectName())) {
-			projectHelper.createCDIProjectWithDynamicWizard(getProjectName());
-		}
-	}
-	
-	@Override
-	public String getProjectName() {
-		return "CDIDynamicWizardProject";
-	}
-	
-	@Test
-	public void testDynamicWizard() {
-		if (projectHelper.projectExists(getProjectName())) {
-			LOGGER.info("CDI project was sucessfully created by Dynamic Web Project wizard");
-			assertTrue(projectHelper.checkCDISupport(getProjectName()));
-			LOGGER.info("Project has correctly set CDI support");
-		} else {
-			fail("CDI project was not succesfully created with Dynamic Web Project wizard");
-		}
-		
-	}
-
-}

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java	2012-09-11 14:36:10 UTC (rev 43599)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/WizardTest.java	2012-09-11 14:37:26 UTC (rev 43600)
@@ -33,10 +33,6 @@
 @SuiteClasses({ CDIAllBotTests.class, CDISmokeBotTests.class })
 public class WizardTest extends CDITestBase {
 
-	public String getProjectName() {
-		return "CDIWizardTest";
-	}
-	
 	@Override
 	public void waitForJobs() {
 		util.waitForNonIgnoredJobs();



More information about the jbosstools-commits mailing list