Author: jjankovi
Date: 2012-02-29 05:55:05 -0500 (Wed, 29 Feb 2012)
New Revision: 39190
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/DynamicWebProjectWithCDITest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/launchers/CDIAllBotTests.launch
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/launchers/CDIAllBotTestsMaven.launch
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/CDITestBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/BeansXMLHelper.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/wizards/CDIWizardBase.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDIWebProjectWizardTest.java
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/FacetTest.java
Log:
CDI test fix + test related to dynamic web project wizard + cdi support added
Modified: trunk/cdi/tests/org.jboss.tools.cdi.bot.test/launchers/CDIAllBotTests.launch
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/launchers/CDIAllBotTests.launch 2012-02-29
06:45:45 UTC (rev 39189)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/launchers/CDIAllBotTests.launch 2012-02-29
10:55:05 UTC (rev 39190)
@@ -40,7 +40,7 @@
<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 -Xms256m -Xmx512m
-Dswtbot.test.properties.file=${env_var:HOME}/swtbot.properties
-Dusage_reporting_enabled=false"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS"
value="-Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms256m -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.platform.ide"/>
<booleanAttribute key="show_selected_only" value="false"/>
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/launchers/CDIAllBotTestsMaven.launch
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/launchers/CDIAllBotTestsMaven.launch 2012-02-29
06:45:45 UTC (rev 39189)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/launchers/CDIAllBotTestsMaven.launch 2012-02-29
10:55:05 UTC (rev 39190)
@@ -16,6 +16,6 @@
<mapEntry key="DISPLAY" value=":1"/>
</mapAttribute>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER"
value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_29"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS"
value="-Xmx2048m"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS"
value="-Xmx1024m"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY"
value="${workspace_loc:/org.jboss.tools.cdi.bot.test}"/>
</launchConfiguration>
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-02-29
06:45:45 UTC (rev 39189)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDIAllBotTests.java 2012-02-29
10:55:05 UTC (rev 39190)
@@ -32,6 +32,7 @@
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;
@@ -66,6 +67,7 @@
FacetTest.class,
CDISupportTest.class,
CDIWebProjectWizardTest.class,
+ DynamicWebProjectWithCDITest.class,
WizardTest.class,
BeansEditorTest.class,
NamedRefactoringTest.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-02-29
06:45:45 UTC (rev 39189)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/CDITestBase.java 2012-02-29
10:55:05 UTC (rev 39190)
@@ -37,7 +37,7 @@
@Before
public void prepareWorkspace() {
if (!projectHelper.projectExists(getProjectName())) {
- projectHelper.createCDIProjectWithDynamicWizard(getProjectName());
+ projectHelper.createCDIProjectWithCDIWizard(getProjectName());
}
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/BeansXMLHelper.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/BeansXMLHelper.java 2012-02-29
06:45:45 UTC (rev 39189)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/BeansXMLHelper.java 2012-02-29
10:55:05 UTC (rev 39190)
@@ -15,7 +15,6 @@
import org.jboss.tools.cdi.bot.test.CDIConstants;
import org.jboss.tools.cdi.bot.test.annotations.CDIWizardType;
import org.jboss.tools.cdi.bot.test.openon.OpenOnTest;
-import org.jboss.tools.ui.bot.ext.Timing;
/**
* Helper for beans.xml validation
@@ -157,9 +156,9 @@
*/
private void createBeansXML(String projectName) {
- if (!projectExplorer.isFilePresent(projectName,
+ if (!packageExplorer.isFilePresent(projectName,
CDIConstants.META_INF_BEANS_XML_PATH.split("/")) &&
- !projectExplorer.isFilePresent(projectName,
+ !packageExplorer.isFilePresent(projectName,
CDIConstants.WEB_INF_BEANS_XML_PATH.split("/"))) {
wizard.createCDIComponent(CDIWizardType.BEANS_XML, null,
@@ -177,11 +176,11 @@
*/
private void replaceBeansXMLContent(String projectName, String path) {
- if (projectExplorer.isFilePresent(projectName,
+ if (packageExplorer.isFilePresent(projectName,
CDIConstants.WEB_INF_BEANS_XML_PATH.split("/"))) {
- projectExplorer.openFile(projectName,
CDIConstants.WEB_INF_BEANS_XML_PATH.split("/"));
+ packageExplorer.openFile(projectName,
CDIConstants.WEB_INF_BEANS_XML_PATH.split("/"));
}else {
- projectExplorer.openFile(projectName,
CDIConstants.META_INF_BEANS_XML_PATH.split("/"));
+ packageExplorer.openFile(projectName,
CDIConstants.META_INF_BEANS_XML_PATH.split("/"));
}
bot.cTabItem("Source").activate();
setEd(bot.activeEditor().toTextEditor());
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 2012-02-29
06:45:45 UTC (rev 39189)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/CDIProjectHelper.java 2012-02-29
10:55:05 UTC (rev 39190)
@@ -104,7 +104,7 @@
item.expand();
NodeContextUtil.nodeContextMenu(tree, item, CDIConstants.CONFIGURE,
CDIConstants.ADD_CDI_SUPPORT).click();
- bot.activeShell().bot().button(IDELabel.Button.OK).click();
+ bot.button(IDELabel.Button.OK).click();
bot.waitWhile(new ProgressInformationShellIsActiveCondition(),
TaskDuration.LONG.getTimeout());
}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardBase.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardBase.java 2012-02-29
06:45:45 UTC (rev 39189)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/uiutils/wizards/CDIWizardBase.java 2012-02-29
10:55:05 UTC (rev 39190)
@@ -231,7 +231,7 @@
setFocus();
bot().button(IDELabel.Button.ADD_WITHOUT_DOTS, 0).click();
SWTBotShell sh = bot().activeShell();
- sh.bot().text().typeText(ib);
+ sh.bot().text().setText(ib);
sh.bot().waitUntil(new NonEmptyTableCondition(sh.bot().table()),
TaskDuration.LONG.getTimeout());
sh.bot().button(IDELabel.Button.OK).click();
setFocus();
@@ -317,7 +317,7 @@
setFocus();
bot().button(IDELabel.Button.ADD, 0).click();
SWTBotShell sh = bot().activeShell();
- sh.bot().text().typeText(intf);
+ sh.bot().text().setText(intf);
sh.bot().waitUntil(new NonEmptyTableCondition(sh.bot().table()),
TaskDuration.LONG.getTimeout());
sh.bot().table().getTableItem(0).select();
sh.bot().button(IDELabel.Button.OK).click();
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDIWebProjectWizardTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDIWebProjectWizardTest.java 2012-02-29
06:45:45 UTC (rev 39189)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/CDIWebProjectWizardTest.java 2012-02-29
10:55:05 UTC (rev 39190)
@@ -36,7 +36,7 @@
assertTrue(projectHelper.checkCDISupport(getProjectName()));
LOGGER.info("Project has correctly set CDI support");
assertTrue("Error: beans.xml should be created when using CDI Web Project
wizard",
- projectExplorer.isFilePresent(getProjectName(),
+ packageExplorer.isFilePresent(getProjectName(),
CDIConstants.WEB_INF_BEANS_XML_PATH.split("/")));
} else {
fail("CDI project was not succesfully created by CDI Web Project wizard");
Added:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/DynamicWebProjectWithCDITest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/DynamicWebProjectWithCDITest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/DynamicWebProjectWithCDITest.java 2012-02-29
10:55:05 UTC (rev 39190)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2011-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.bot.test.wizard;
+
+import org.jboss.tools.cdi.bot.test.CDITestBase;
+import org.junit.Test;
+
+public class DynamicWebProjectWithCDITest extends CDITestBase {
+
+ @Override
+ public void prepareWorkspace() {
+ if (!projectHelper.projectExists(getProjectName())) {
+ projectHelper.createCDIProjectWithDynamicWizard(getProjectName());
+ }
+ }
+
+ @Override
+ public String getProjectName() {
+ return "CDIDynamicWebProject";
+ }
+
+ @Test
+ public void testDynamicWebProjectWizard() {
+ if (projectHelper.projectExists(getProjectName())) {
+ LOGGER.info("CDI project was sucessfully created by CDI Web Project
wizard");
+ assertTrue(projectHelper.checkCDISupport(getProjectName()));
+ LOGGER.info("Project has correctly set CDI support");
+ } else {
+ fail("CDI project was not succesfully created by CDI Dynamic Web Project
wizard");
+ }
+
+ }
+
+}
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/FacetTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/FacetTest.java 2012-02-29
06:45:45 UTC (rev 39189)
+++
trunk/cdi/tests/org.jboss.tools.cdi.bot.test/src/org/jboss/tools/cdi/bot/test/wizard/FacetTest.java 2012-02-29
10:55:05 UTC (rev 39190)
@@ -44,9 +44,9 @@
if (projectHelper.projectExists(getProjectName())) {
LOGGER.info("Dynamic Web Project with CDI Facet created");
assertTrue("Error: beans.xml should be created when selecting CDI Facet",
- projectExplorer.isFilePresent(getProjectName(),
- CDIConstants.WEB_INF_BEANS_XML_PATH.split("/")));
- } else {
+ packageExplorer.isFilePresent(getProjectName(),
+ CDIConstants.WEB_INF_BEANS_XML_PATH.split("/")));
+ }else {
fail("CDI project was not succesfully created with Dynamic Web Project wizard
with CDI facet");
}