Author: jjankovi
Date: 2011-11-02 11:39:08 -0400 (Wed, 02 Nov 2011)
New Revision: 36133
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDIConfigurationPresetTest.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/openon/CDIFindObserverForEventTest.java
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/uiutils/actions/CDIBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java
Log:
CDIConfigurationPresetTest was added
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-02
10:20:44 UTC (rev 36132)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2011-11-02
15:39:08 UTC (rev 36133)
@@ -18,6 +18,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.cdi.bot.test.wizard.CDIATWizardTest;
+import org.jboss.tools.cdi.bot.test.wizard.CDIConfigurationPresetTest;
import org.jboss.tools.cdi.bot.test.wizard.CDIPerspectiveTest;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.types.ViewType;
@@ -49,6 +50,7 @@
@RunWith(RequirementAwareSuite.class)
@SuiteClasses({
//CDIPerspectiveTest.class,
+ CDIConfigurationPresetTest.class,
CDIATWizardTest.class,
BeansEditorTest.class,
CDIQuickFixTest.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 2011-11-02
10:20:44 UTC (rev 36132)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDISmokeBotTests.java 2011-11-02
15:39:08 UTC (rev 36133)
@@ -13,7 +13,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.cdi.bot.test.wizard.CDIATWizardTest;
-import org.jboss.tools.cdi.bot.test.wizard.CDIPerspectiveTest;
+import org.jboss.tools.cdi.bot.test.wizard.CDIConfigurationPresetTest;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.jboss.tools.ui.bot.ext.types.ViewType;
import org.junit.BeforeClass;
@@ -41,8 +41,9 @@
* @author Jaroslav Jankovic
*/
@RunWith(RequirementAwareSuite.class)
-@SuiteClasses({
- //CDIPerspectiveTest.class,
+@SuiteClasses({
+ //CDIPerspectiveTest.class,
+ CDIConfigurationPresetTest.class,
CDIATWizardTest.class,
})
public class CDISmokeBotTests extends CDIBase {
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIFindObserverForEventTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIFindObserverForEventTest.java 2011-11-02
10:20:44 UTC (rev 36132)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIFindObserverForEventTest.java 2011-11-02
15:39:08 UTC (rev 36133)
@@ -11,15 +11,8 @@
package org.jboss.tools.cdi.bot.test.openon;
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
-import org.jboss.tools.cdi.bot.test.CDISmokeBotTests;
-import org.jboss.tools.cdi.bot.test.quickfix.CDIQuickFixTest;
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.config.Annotations.Require;
import org.jboss.tools.ui.bot.ext.config.Annotations.Server;
@@ -41,9 +34,9 @@
@SuiteClasses({ CDIAllBotTests.class })
public class CDIFindObserverForEventTest extends CDIBase {
- private static final Logger LOGGER =
Logger.getLogger(CDIFindObserverForEventTest.class.getName());
+ //private static final Logger LOGGER =
Logger.getLogger(CDIFindObserverForEventTest.class.getName());
private static final String PROJECT_NAME = "CDIProject";
- private static final String PACKAGE_NAME = "cdi";
+ //private static final String PACKAGE_NAME = "cdi";
@BeforeClass
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-11-02
10:20:44 UTC (rev 36132)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/openon/CDIOpenOnTest.java 2011-11-02
15:39:08 UTC (rev 36133)
@@ -148,7 +148,7 @@
openOn("produceMethod", testedBean + ".java", "Open Bound
Disposer");
assertTrue(getEd().toTextEditor().getSelection().equals("disposeMethod"));
}
-
+
@Test
public void testObserverOpenOn() {
createComponent(CDICOMPONENT.QUALIFIER, "Q1", PACKAGE_NAME, null);
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java 2011-11-02
10:20:44 UTC (rev 36132)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/actions/CDIBase.java 2011-11-02
15:39:08 UTC (rev 36133)
@@ -148,6 +148,13 @@
new DynamicWebProjectWizard().setProjectName(projectName).finish();
util.waitForNonIgnoredJobs();
}
+
+ public static void createCDIProjectWithCDIPreset(SWTUtilExt util, String projectName) {
+ new NewFileWizardAction().run()
+ .selectTemplate("Web", "Dynamic Web Project").next();
+ new DynamicWebProjectWizard().setProjectName(projectName).setCDIPreset().finish();
+ util.waitForNonIgnoredJobs();
+ }
public static void addCDISupport(final SWTBotTree tree, SWTBotTreeItem item,
SWTBotExt bot, SWTUtilExt util) {
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java 2011-11-02
10:20:44 UTC (rev 36132)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizard.java 2011-11-02
15:39:08 UTC (rev 36133)
@@ -313,7 +313,7 @@
bot().button("Add...", 0).click();
SWTBotShell sh = bot().activeShell();
sh.bot().text().setText(intf);
- sh.bot().sleep(Timing.time2S());
+ sh.bot().sleep(Timing.time3S());
sh.bot().table().getTableItem(0).select();
sh.bot().button("OK").click();
setFocus();
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java 2011-11-02
10:20:44 UTC (rev 36132)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/Wizard.java 2011-11-02
15:39:08 UTC (rev 36133)
@@ -59,6 +59,13 @@
public boolean canFinish() {
return canClick("Finish");
}
+
+ public Wizard setCDIPreset() {
+ bot().comboBoxInGroup("Configuration", 0).
+ setSelection("Dynamic Web Project with CDI (Context and Dependency
Injection)");
+ return this;
+ }
+
protected void clickButton(String text) {
bot().button(text).click();
@@ -70,7 +77,7 @@
t.setFocus();
t.setText(text);
}
-
+
protected boolean canClick(String button) {
return bot().button(button).isEnabled();
}
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDIConfigurationPresetTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDIConfigurationPresetTest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDIConfigurationPresetTest.java 2011-11-02
15:39:08 UTC (rev 36133)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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 java.util.logging.Logger;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.cdi.bot.test.CDIAllBotTests;
+import org.jboss.tools.cdi.bot.test.CDISmokeBotTests;
+import org.jboss.tools.cdi.bot.test.uiutils.actions.CDIBase;
+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;
+import org.jboss.tools.ui.bot.ext.config.Annotations.ServerState;
+import org.jboss.tools.ui.bot.ext.helper.ContextMenuHelper;
+import org.junit.After;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+* Test checks if CDI configuration preset sets CDI support correctly
+*
+* @author Jaroslav Jankovic
+*/
+
+@Require(clearProjects = true, perspective = "Java EE", server = @Server(state
= ServerState.NotRunning, version = "6.0", operator = ">="))
+(a)RunWith(RequirementAwareSuite.class)
+@SuiteClasses({ CDIAllBotTests.class , CDISmokeBotTests.class })
+public class CDIConfigurationPresetTest extends CDIBase {
+
+ private static final Logger LOGGER =
Logger.getLogger(CDIConfigurationPresetTest.class.getName());
+ private static final String PROJECT_NAME = "CDIPresetProject";
+
+ @After
+ public void waitForJobs() {
+ jbt.deleteProject(PROJECT_NAME);
+ }
+
+ @Test
+ public void testCDIPreset() {
+ createCDIProjectWithCDIPreset(util, PROJECT_NAME);
+ LOGGER.info("Dynamic Web Project with CDI Configuration Preset created");
+ assertTrue(checkCDISupport(PROJECT_NAME));
+ }
+
+ private boolean checkCDISupport(String projectName) {
+ projectExplorer.selectProject(projectName);
+
+ SWTBotTree tree = projectExplorer.bot().tree();
+ ContextMenuHelper.prepareTreeItemForContextMenu(tree);
+ new
SWTBotMenu(ContextMenuHelper.getContextMenu(tree,"Properties",false)).click();
+
+ bot.tree().expandNode("CDI (Context and Dependency Injection)
Settings").select();
+ boolean isCDISupported = bot.checkBox().isChecked();
+ bot.button("Cancel").click();
+ return isCDISupported;
+ }
+
+
+}