[jbosstools-commits] JBoss Tools SVN: r35764 - in trunk/cdi/tests/org.jboss.tools.cdi.bot.test: resources/cdi and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Oct 18 11:03:51 EDT 2011


Author: jjankovi
Date: 2011-10-18 11:03:51 -0400 (Tue, 18 Oct 2011)
New Revision: 35764

Added:
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/DisposerProducerBean.java.cdi
Removed:
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/CdiATWizardTest.launch
Modified:
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java
   trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java
Log:
added OpenOn test for disposer and producer method

Deleted: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/CdiATWizardTest.launch
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/CdiATWizardTest.launch	2011-10-18 13:46:55 UTC (rev 35763)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/CdiATWizardTest.launch	2011-10-18 15:03:51 UTC (rev 35764)
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CdiATWizardTest.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<mapAttribute key="org.eclipse.debug.core.environmentVariables">
-<mapEntry key="DISPLAY" value=":1"/>
-</mapAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<stringAttribute key="org.eclipse.jdt.launching.JAVA_COMMAND" value="java"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.jboss.tools.cdi.bot.test.wizard.CdiATWizardTest"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.jboss.tools.cdi.bot.test"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Djava.library.path=${env_var:JAVA_HOME}/jre/lib/i386/client:${env_var:JAVA_HOME}/jre/lib/i386:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/java/packages/lib/i386:/lib:/usr/lib:/usr/lib/jni -Xms512m -Xmx1024m -Dswtbot.test.properties.file=${env_var:HOME}/swtbot.properties -Dusage_reporting_enabled=false"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.epp.package.jee.product"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="true"/>
-</launchConfiguration>

Added: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/DisposerProducerBean.java.cdi
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/DisposerProducerBean.java.cdi	                        (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/cdi/DisposerProducerBean.java.cdi	2011-10-18 15:03:51 UTC (rev 35764)
@@ -0,0 +1,25 @@
+package org.cdi.test;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+public class Disposes1 {
+	
+	@Inject
+	MyBean mybean;
+	
+	public Disposes1() {
+		
+	}
+	
+	public void disposeMethod(@Disposes MyBean myBean) {
+		
+	}
+	
+	@Produces
+	public MyBean produceMethod() {
+		return mybean;
+	}
+		
+}

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java	2011-10-18 13:46:55 UTC (rev 35763)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java	2011-10-18 15:03:51 UTC (rev 35764)
@@ -124,26 +124,22 @@
 	 * https://issues.jboss.org/browse/JBIDE-6251
 	 */
 	@Test
-	public void testDisposerOpenOn() {
-		/*
-		 * not implemented yet
-		 */
+	public void testDisposerProducerOpenOn() {
 		
-	}
-	
-	/*
-	 * https://issues.jboss.org/browse/JBIDE-6311
-	 * https://issues.jboss.org/browse/JBIDE-6251
-	 * https://issues.jboss.org/browse/JBIDE-5928
-	 */
-	@Test
-	public void testProducerOpenOn() {
-		/*
-		 * not implemented yet
-		 */
+		String testedBean = "DisposerProducerBean";
+		createComponent(CDICOMPONENT.BEAN, "MyBean", PACKAGE_NAME, null);
+		createComponent(CDICOMPONENT.BEAN, testedBean, PACKAGE_NAME, null);
+		CDIUtil.copyResourceToClass(getEd(), CDIOpenOnTest.class
+				.getResourceAsStream("/resources/cdi/" + testedBean + ".java.cdi"),
+				false);
+		openOn("disposeMethod", testedBean + ".java", "Open Bound Producer");
+		assertTrue(getEd().toTextEditor().getSelection().equals("produceMethod"));
 		
+		openOn("produceMethod", testedBean + ".java", "Open Bound Disposer");
+		assertTrue(getEd().toTextEditor().getSelection().equals("disposeMethod"));
 	}
 	
+
 	@Test
 	public void testObserverOpenOn() {
 		/*

Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java	2011-10-18 13:46:55 UTC (rev 35763)
+++ trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/seam3/CDISeam3Test.java	2011-10-18 15:03:51 UTC (rev 35764)
@@ -15,6 +15,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
 import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
@@ -22,6 +23,7 @@
 import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIBase;
 import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIUtil;
 import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
 import org.jboss.tools.ui.bot.ext.config.Annotations.Require;
 import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
 import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
@@ -62,6 +64,7 @@
 	/*
 	 * https://issues.jboss.org/browse/JBIDE-8202
 	 */	
+	
 	@Test
 	public void testResourceOpenOn() {
 			
@@ -218,67 +221,66 @@
 		checkThirdOpenOnAndGeneric();
 	}
 			
-	private void checkMyGenericBean() {
-		
+	private void checkMyGenericBean() {		
+								
 	}
 
 	private void checkMyGenericBean2() {
 	
 	}
 	private void checkFirstOpenOnAndGeneric() {
-		checkOpenOnAndGeneric("first1", "Generic Configuration Point", 
+		checkOpenOnAndGeneric("first1", "MyBeanInjections.java", "Generic Configuration Point", 
 				"MyConfigurationProducer.java", "getOneConfig");
-		checkOpenOnAndGeneric("first1", "@Inject Bean", 
+		checkOpenOnAndGeneric("first1", "MyBeanInjections.java", "@Inject Bean", 
 				"MyGenericBean.java", "createMyFirstBean");	
 		
-		checkOpenOnAndGeneric("first2", "Generic Configuration Point", 
+		checkOpenOnAndGeneric("first2", "MyBeanInjections.java", "Generic Configuration Point", 
 				"MyConfigurationProducer.java", "getSecondConfig");
-		checkOpenOnAndGeneric("first2", "@Inject Bean", 
+		checkOpenOnAndGeneric("first2", "MyBeanInjections.java", "@Inject Bean", 
 				"MyGenericBean.java", "createMyFirstBean");
 		
-		checkOpenOnAndGeneric("first3", "Generic Configuration Point", 
+		checkOpenOnAndGeneric("first3", "MyBeanInjections.java", "Generic Configuration Point", 
 				"MyExtendedConfiguration.java", "MyExtendedConfiguration");
-		checkOpenOnAndGeneric("first3", "@Inject Bean", 
+		checkOpenOnAndGeneric("first3", "MyBeanInjections.java", "@Inject Bean", 
 				"MyGenericBean.java", "createMyFirstBean");
 	}
 	
 	private void checkSecondOpenOnAndGeneric() {
-		checkOpenOnAndGeneric("second1", "Generic Configuration Point", 
+		checkOpenOnAndGeneric("second1", "MyBeanInjections.java", "Generic Configuration Point", 
 				"MyConfigurationProducer.java", "getOneConfig");
-		checkOpenOnAndGeneric("second1", "@Inject Bean", 
+		checkOpenOnAndGeneric("second1", "MyBeanInjections.java", "@Inject Bean", 
 				"MyGenericBean2.java", "createMySecondBean");	
 		
-		checkOpenOnAndGeneric("second2", "Generic Configuration Point", 
+		checkOpenOnAndGeneric("second2", "MyBeanInjections.java", "Generic Configuration Point", 
 				"MyConfigurationProducer.java", "getSecondConfig");
-		checkOpenOnAndGeneric("second2", "@Inject Bean", 
+		checkOpenOnAndGeneric("second2", "MyBeanInjections.java", "@Inject Bean", 
 				"MyGenericBean2.java", "createMySecondBean");
 		
-		checkOpenOnAndGeneric("second3", "Generic Configuration Point", 
+		checkOpenOnAndGeneric("second3", "MyBeanInjections.java", "Generic Configuration Point", 
 				"MyExtendedConfiguration.java", "MyExtendedConfiguration");
-		checkOpenOnAndGeneric("second3", "@Inject Bean", 
+		checkOpenOnAndGeneric("second3", "MyBeanInjections.java", "@Inject Bean", 
 				"MyGenericBean2.java", "createMySecondBean");
 	}
 	
 	private void checkThirdOpenOnAndGeneric() {
-		checkOpenOnAndGeneric("third1", "Generic Configuration Point", 
+		checkOpenOnAndGeneric("third1", "MyBeanInjections.java", "Generic Configuration Point", 
 				"MyConfigurationProducer.java", "getOneConfig");
-		checkOpenOnAndGeneric("third1", "@Inject Bean", 
+		checkOpenOnAndGeneric("third1", "MyBeanInjections.java", "@Inject Bean", 
 				"MyGenericBean.java", "myThirdBean");	
 		
-		checkOpenOnAndGeneric("third2", "Generic Configuration Point", 
+		checkOpenOnAndGeneric("third2", "MyBeanInjections.java", "Generic Configuration Point", 
 				"MyConfigurationProducer.java", "getSecondConfig");
-		checkOpenOnAndGeneric("third2", "@Inject Bean", 
+		checkOpenOnAndGeneric("third2", "MyBeanInjections.java", "@Inject Bean", 
 				"MyGenericBean.java", "myThirdBean");
 		
-		checkOpenOnAndGeneric("third3", "Generic Configuration Point", 
+		checkOpenOnAndGeneric("third3", "MyBeanInjections.java", "Generic Configuration Point", 
 				"MyExtendedConfiguration.java", "MyExtendedConfiguration");
-		checkOpenOnAndGeneric("third3", "@Inject Bean", 
+		checkOpenOnAndGeneric("third3", "MyBeanInjections.java", "@Inject Bean", 
 				"MyGenericBean.java", "myThirdBean");
 	}
 	
-	private void checkOpenOnAndGeneric(String openOnString, String chosenOption, 
-			String afterOpenOnTitleName, String injectSelectionAtribute) {
-		String titleName = "MyBeanInjections.java";
+	private void checkOpenOnAndGeneric(String openOnString, String titleName, String chosenOption, 
+			String afterOpenOnTitleName, String injectSelectionAtribute) {		
 		openOn(openOnString, titleName, chosenOption);
 		String activeEditor = bot.activeEditor().getTitle();
 		String selectedString = bot.activeEditor().toTextEditor().getSelection();



More information about the jbosstools-commits mailing list