Author: jjankovi
Date: 2011-11-21 05:06:20 -0500 (Mon, 21 Nov 2011)
New Revision: 36469
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MainBean.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean2.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean3.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean4.java.cdi
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean5.java.cdi
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/openon/OpenOnTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/BeanValidationQuickFixTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/QuickFixTestBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/CDIProjectHelper.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/OpenOnHelper.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/SWTEclipseCDIExtUtil.java
Log:
New resource for OpenOn test + JavaDoc for some classes
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MainBean.java.cdi
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MainBean.java.cdi
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MainBean.java.cdi 2011-11-21
10:06:20 UTC (rev 36469)
@@ -0,0 +1,29 @@
+package cdi;
+
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+public class MainBean {
+
+ @Inject private MyBean1 myBean1;
+
+ @Inject private MyBean2 myBean2;
+
+ @Inject @Q1 private MyBean1 myBean3;
+
+ @Inject @Q1 private MyBean2 myBean4;
+
+ @Inject @Q2 private MyBean1 myBean5;
+
+ @Inject @Q2 private MyBean2 myBean6;
+
+ @Inject @Any private MyBean1 myBean7;
+
+ @Inject @Any private MyBean2 myBean8;
+
+ @Inject @Q1 @Q2 private MyBean1 myBean9;
+
+ @Inject @Q1 @Q2 private MyBean2 myBean10;
+
+ @Inject @Q1 @Q2 private MyBean4 myBean11;
+}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean2.java.cdi
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean2.java.cdi
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean2.java.cdi 2011-11-21
10:06:20 UTC (rev 36469)
@@ -0,0 +1,9 @@
+package cdi;
+
+public class MyBean2 extends MyBean1{
+
+ public MyBean2() {
+
+ }
+
+}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean3.java.cdi
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean3.java.cdi
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean3.java.cdi 2011-11-21
10:06:20 UTC (rev 36469)
@@ -0,0 +1,67 @@
+package cdi;
+
+import javax.enterprise.inject.Produces;
+
+public class MyBean3 {
+
+ public MyBean3() {
+
+ }
+
+ @Produces
+ public MyBean1 getMyBean1() {
+ return new MyBean1();
+ }
+
+ @Produces
+ public MyBean2 getMyBean2() {
+ return new MyBean2();
+ }
+
+ @Produces
+ public MyBean1 getMyBean1WithIMB2() {
+ return new MyBean2();
+ }
+
+
+
+ @Produces
+ @Q1
+ public MyBean1 getMyBean1WithQ1() {
+ return new MyBean1();
+ }
+
+ @Produces
+ @Q2
+ public MyBean1 getMyBean1WithQ2() {
+ return new MyBean1();
+ }
+
+
+
+ @Produces
+ @Q1
+ public MyBean2 getMyBean2WithQ1() {
+ return new MyBean2();
+ }
+
+ @Produces
+ @Q2
+ public MyBean2 getMyBean2WithQ2() {
+ return new MyBean2();
+ }
+
+
+ @Produces
+ @Q1
+ public MyBean1 getMyBean1WithIMB2Q1() {
+ return new MyBean2();
+ }
+
+ @Produces
+ @Q2
+ public MyBean1 getMyBean1WithIMB2Q2() {
+ return new MyBean2();
+ }
+
+}
\ No newline at end of file
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean4.java.cdi
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean4.java.cdi
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean4.java.cdi 2011-11-21
10:06:20 UTC (rev 36469)
@@ -0,0 +1,10 @@
+package cdi;
+@Q1
+@Q2
+public class MyBean4 extends MyBean2{
+
+ public MyBean4() {
+
+ }
+
+}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean5.java.cdi
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean5.java.cdi
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/resources/openon/InjectedPoints/MyBean5.java.cdi 2011-11-21
10:06:20 UTC (rev 36469)
@@ -0,0 +1,6 @@
+package cdi;
+
+@Q2
+public class MyBean5 extends MyBean2 {
+
+}
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 2011-11-21
09:33:15 UTC (rev 36468)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2011-11-21
10:06:20 UTC (rev 36469)
@@ -48,7 +48,7 @@
* JAVA=1.6,/space/java/sdk/jdk1.6.0_22
*
*
- * Suite duration: aprox. 25min
+ * Suite duration: aprox. 23min
*
* @author Lukas Jungmann
* @author Jaroslav Jankovic
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 2011-11-21
09:33:15 UTC (rev 36468)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDISmokeBotTests.java 2011-11-21
10:06:20 UTC (rev 36469)
@@ -33,7 +33,7 @@
*
* Sample swtbot.properties file:
*
- * SERVER=JBOSS_AS,6.0,default,/home/lukas/latest/jboss-6.0.0.Final
+ *
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
*
*
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 2011-11-21
09:33:15 UTC (rev 36468)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/OpenOnTest.java 2011-11-21
10:06:20 UTC (rev 36469)
@@ -153,27 +153,27 @@
wizard.createComponent(CDIWizardType.BEAN, "MyBean2", getPackageName(),
null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
- .getResourceAsStream("/resources/openon/injectedPoints/MyBean2.java.cdi"),
+ .getResourceAsStream("/resources/openon/InjectedPoints/MyBean2.java.cdi"),
false);
wizard.createComponent(CDIWizardType.BEAN, "MyBean3", getPackageName(),
null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
- .getResourceAsStream("/resources/openon/injectedPoints/MyBean3.java.cdi"),
+ .getResourceAsStream("/resources/openon/InjectedPoints/MyBean3.java.cdi"),
false);
wizard.createComponent(CDIWizardType.BEAN, "MyBean4", getPackageName(),
null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
- .getResourceAsStream("/resources/openon/injectedPoints/MyBean4.java.cdi"),
+ .getResourceAsStream("/resources/openon/InjectedPoints/MyBean4.java.cdi"),
false);
wizard.createComponent(CDIWizardType.BEAN, "MyBean5", getPackageName(),
null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
- .getResourceAsStream("/resources/openon/injectedPoints/MyBean5.java.cdi"),
+ .getResourceAsStream("/resources/openon/InjectedPoints/MyBean5.java.cdi"),
false);
wizard.createComponent(CDIWizardType.BEAN, "MainBean", getPackageName(),
null);
editResourceUtil.replaceClassContentByResource(OpenOnTest.class
- .getResourceAsStream("/resources/openon/injectedPoints/MainBean.java.cdi"),
+ .getResourceAsStream("/resources/openon/InjectedPoints/MainBean.java.cdi"),
false);
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/BeanValidationQuickFixTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/BeanValidationQuickFixTest.java 2011-11-21
09:33:15 UTC (rev 36468)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/BeanValidationQuickFixTest.java 2011-11-21
10:06:20 UTC (rev 36469)
@@ -88,7 +88,7 @@
checkMultipleBean();
}
- @Ignore
+
//
https://issues.jboss.org/browse/JBIDE-7664
@Test
public void testConstructor() {
@@ -113,7 +113,7 @@
checkQuickFix(CDIAnnotationsType.OBSERVES, CDIWizardType.BEAN);
}
- @Ignore
+
//
https://issues.jboss.org/browse/JBIDE-7665
@Test
public void testProducer() {
@@ -139,7 +139,7 @@
checkQuickFix(CDIAnnotationsType.OBSERVES, CDIWizardType.BEAN);
}
- @Ignore
+
//
https://issues.jboss.org/browse/JBIDE-7667
@Test
public void testInjectDisposer() {
@@ -155,7 +155,7 @@
checkQuickFix(CDIAnnotationsType.DISPOSES, CDIWizardType.BEAN);
}
- @Ignore
+
//
https://issues.jboss.org/browse/JBIDE-7667
@Test
public void testInjectObserver() {
@@ -174,7 +174,7 @@
checkQuickFix(CDIAnnotationsType.OBSERVES, CDIWizardType.BEAN);
}
- @Ignore
+
//
https://issues.jboss.org/browse/JBIDE-7667
@Test
public void testInjectProducer() {
@@ -191,7 +191,7 @@
checkQuickFix(CDIAnnotationsType.PRODUCES, CDIWizardType.BEAN);
}
- @Ignore
+
//
https://issues.jboss.org/browse/JBIDE-7668
@Test
public void testObserverWithDisposer() {
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/QuickFixTestBase.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/QuickFixTestBase.java 2011-11-21
09:33:15 UTC (rev 36468)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/quickfix/QuickFixTestBase.java 2011-11-21
10:06:20 UTC (rev 36469)
@@ -133,7 +133,11 @@
util.waitForNonIgnoredJobs();
}
-
+ /**
+ * Method resolves one validation problem in one test case in
+ * BeanValidationQuickFixTest - it is too specific method, not usable
+ * in general, only in this case
+ */
public void resolveMultipleBeans() {
SWTBotTreeItem validationProblem = getProblem(CDIAnnotationsType.INJECT,
@@ -158,6 +162,10 @@
util.waitForNonIgnoredJobs();
}
+ /**
+ * Method checks if specific validation problem was resolved by
+ * quick fix - not usable in general, only in this case
+ */
public void checkMultipleBean() {
String code = getEd().toTextEditor().getText();
assertTrue(code.contains("@Inject @Q1 private Animal animal;"));
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/CDIProjectHelper.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/CDIProjectHelper.java 2011-11-21
09:33:15 UTC (rev 36468)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/CDIProjectHelper.java 2011-11-21
10:06:20 UTC (rev 36469)
@@ -21,12 +21,19 @@
public class CDIProjectHelper extends CDIBase{
-
+ /**
+ * Method creates new CDI Project - Dynamic Web Project + CDI Support
+ * @param projectName
+ */
public void createCDIProject(String projectName) {
createDynamicWebProject(projectName);
addCDISupport(projectName);
}
+ /**
+ * Method creates new Dynamic Web Project with CDI Preset checked
+ * @param projectName
+ */
public void createDynamicWebProjectWithCDIPreset(String projectName) {
new NewFileWizardAction().run()
.selectTemplate("Web", "Dynamic Web Project").next();
@@ -34,6 +41,10 @@
util.waitForNonIgnoredJobs();
}
+ /**
+ * Method creates new Dynamic Web Project with CDI Facets checked
+ * @param projectName
+ */
public void createDynamicWebProjectWithCDIFacets(String projectName) {
new NewFileWizardAction().run()
.selectTemplate("Web", "Dynamic Web Project").next();
@@ -42,6 +53,11 @@
util.waitForNonIgnoredJobs();
}
+ /**
+ * Methods checks if project with entered name exists in actual workspace
+ * @param projectName
+ * @return
+ */
public boolean projectExists(String projectName) {
SWTBotTree tree = projectExplorer.bot().tree();
boolean projectExists = false;
@@ -53,6 +69,10 @@
return projectExists;
}
+ /**
+ * Method creates new Dynamic Web Project
+ * @param projectName
+ */
private void createDynamicWebProject(String projectName) {
new NewFileWizardAction().run()
.selectTemplate("Web", "Dynamic Web Project").next();
@@ -60,6 +80,10 @@
util.waitForNonIgnoredJobs();
}
+ /**
+ * Method adds CDI support to project with entered name
+ * @param projectName
+ */
private void addCDISupport(String projectName) {
projectExplorer.selectProject(projectName);
SWTBotTree tree = projectExplorer.bot().tree();
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/OpenOnHelper.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/OpenOnHelper.java 2011-11-21
09:33:15 UTC (rev 36468)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/OpenOnHelper.java 2011-11-21
10:06:20 UTC (rev 36469)
@@ -21,6 +21,15 @@
public class OpenOnHelper extends CDIBase{
+ /**
+ * Method simulates "OpenOn" - press Ctrl, move mouse over selected string
and
+ * context menu appears. Method selects "openOnString", open context menu,
select
+ * "chosenOption" and simulates click - after OpenOn, it sets active editor to
+ * one, opened by OpenOn
+ * @param openOnString
+ * @param titleName
+ * @param chosenOption
+ */
public void openOnByOption(String openOnString, String titleName, String chosenOption)
{
selectTextForOpenOn(openOnString, titleName);
SWTBotMenu navigateMenu = bot.menu("Navigate");
@@ -38,6 +47,13 @@
setEd(bot.activeEditor().toTextEditor());
}
+ /**
+ * Method simulates direct "OpenOn" - press F3 when selecting some string.
+ * Method selects "openOnString" and simulates F3 - after OpenOn, it sets
+ * active editor to one, opened by OpenOn
+ * @param openOnString
+ * @param titleName
+ */
public void openOnDirect(String openOnString, String titleName) {
selectTextForOpenOn(openOnString, titleName);
bot.sleep(Timing.time3S());
@@ -45,6 +61,12 @@
setEd(bot.activeEditor().toTextEditor());
}
+ /**
+ * Methods select text in editor. It has some workaround when "openOnString"
+ * contains @, these string cannot be opened by openon, so offset is set to 1
+ * @param openOnString
+ * @param titleName
+ */
private void selectTextForOpenOn(String openOnString, String titleName) {
SWTBotEditor ed = bot.editorByTitle(titleName);
ed.show();
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 2011-11-21
09:33:15 UTC (rev 36468)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/QuickFixHelper.java 2011-11-21
10:06:20 UTC (rev 36469)
@@ -10,8 +10,6 @@
protected AbstractValidationProvider validationErrorsProvider;
- public static SWTBotTreeItem[] problemsTrees;
-
/**
* Method open context menu for given tree item and opens Quick Fix option
* @param item
@@ -37,6 +35,10 @@
return problemsTree;
}
+ /**
+ * Method gets allProblems in problemsView as array of SWTBotTreeItem
+ * @return
+ */
public SWTBotTreeItem[] getAllProblems() {
SWTBotTreeItem[] warningProblemsTree = getProblems(ProblemsType.WARNINGS);
@@ -46,6 +48,12 @@
return joinTwoArrays(warningProblemsTree, errorProblemsTree);
}
+ /**
+ * Method joins two arrays and returns them as one joined array
+ * @param aArray
+ * @param bArray
+ * @return
+ */
private SWTBotTreeItem[] joinTwoArrays(SWTBotTreeItem[] aArray, SWTBotTreeItem[] bArray)
{
SWTBotTreeItem[] bigArray = new SWTBotTreeItem[aArray.length + bArray.length];
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/SWTEclipseCDIExtUtil.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/SWTEclipseCDIExtUtil.java 2011-11-21
09:33:15 UTC (rev 36468)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/SWTEclipseCDIExtUtil.java 2011-11-21
10:06:20 UTC (rev 36469)
@@ -13,15 +13,25 @@
throw new AssertionError();
}
+ /**
+ * Method disables folding used in editor in eclipse
+ * @param bot
+ * @param util
+ */
public static void disableFolding(SWTBotExt bot, SWTUtilExt util) {
editFolding(bot, util, false);
}
+ /**
+ * Method enable folding used in editor in eclipse
+ * @param bot
+ * @param util
+ */
public static void enableFolding(SWTBotExt bot, SWTUtilExt util) {
editFolding(bot, util, true);
}
- public static void editFolding(SWTBotExt bot, SWTUtilExt util,
+ private static void editFolding(SWTBotExt bot, SWTUtilExt util,
boolean select) {
bot.menu("Window").menu("Preferences").click();
bot.shell("Preferences").activate();