Author: jjankovi
Date: 2012-06-26 11:39:02 -0400 (Tue, 26 Jun 2012)
New Revision: 42228
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/SeamConfigOpenOnTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/CDISeam3AllBotTests.java
Log:
new seam3 bot test SeamConfigOpenOnTest implemented and added into testsuite
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/CDISeam3AllBotTests.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/CDISeam3AllBotTests.java 2012-06-26
15:38:06 UTC (rev 42227)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/CDISeam3AllBotTests.java 2012-06-26
15:39:02 UTC (rev 42228)
@@ -22,6 +22,7 @@
import org.jboss.tools.cdi.seam3.bot.test.tests.NamedPackagesTest;
import org.jboss.tools.cdi.seam3.bot.test.tests.RequiresAnnotationTest;
import org.jboss.tools.cdi.seam3.bot.test.tests.ResourceOpenOnTest;
+import org.jboss.tools.cdi.seam3.bot.test.tests.SeamConfigOpenOnTest;
import org.jboss.tools.cdi.seam3.bot.test.tests.VetoAnnotationTest;
import org.jboss.tools.ui.bot.ext.RequirementAwareSuite;
import org.junit.runner.RunWith;
@@ -44,7 +45,8 @@
FullyQualifiedTest.class,
LoggerSupportTest.class,
InterfaceAndAbstractValidationTest.class,
- MessageLoggerAnnotationTest.class
+ MessageLoggerAnnotationTest.class,
+ SeamConfigOpenOnTest.class
})
public class CDISeam3AllBotTests extends AbstractTestSuite {
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/SeamConfigOpenOnTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/SeamConfigOpenOnTest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.seam3.bot.test/src/org/jboss/tools/cdi/seam3/bot/test/tests/SeamConfigOpenOnTest.java 2012-06-26
15:39:02 UTC (rev 42228)
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2010-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.seam3.bot.test.tests;
+
+import org.jboss.tools.cdi.bot.test.CDIConstants;
+import org.jboss.tools.cdi.seam3.bot.test.base.Seam3TestBase;
+import org.jboss.tools.cdi.seam3.bot.test.util.SeamLibrary;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class SeamConfigOpenOnTest extends Seam3TestBase {
+
+ private static String projectName = "seamConfigOpenOn";
+ private final String SEAM_CONFIG = "seam-beans.xml";
+
+ @BeforeClass
+ public static void setup() {
+ importSeam3ProjectWithLibrary(projectName, SeamLibrary.SOLDER_3_1);
+ }
+
+ @Before
+ public void openSeamConfig() {
+ packageExplorer.openFile(projectName, CDIConstants.WEBCONTENT,
+ CDIConstants.WEB_INF, SEAM_CONFIG).toTextEditor();
+ bot.cTabItem("Source").activate();
+ }
+
+ @Test
+ public void testBeanOpenOn() {
+
+ /* open on bean class */
+ openOnUtil.openOnDirect("b:Bean1", SEAM_CONFIG);
+
+ /* test opened object */
+ assertExpectedOpenedClassAndSelection("Bean1.java", "Bean1");
+ }
+
+ @Test
+ public void testContructorOpenOn() {
+
+ /* open on bean class */
+ openOnUtil.openOnDirect("s:parameters", SEAM_CONFIG);
+
+ /* test opened object */
+ assertExpectedOpenedClassAndSelection("Bean1.java", "Bean1");
+ }
+
+ @Test
+ public void testFieldOpenOn() {
+
+ /* open on bean class */
+ openOnUtil.openOnDirect("b:value", SEAM_CONFIG);
+
+ /* test opened object */
+ assertExpectedOpenedClassAndSelection("Bean1.java", "value");
+ }
+
+ @Test
+ public void testMethodOpenOn() {
+
+ /* open on bean class */
+ openOnUtil.openOnDirect("b:method", SEAM_CONFIG);
+
+ /* test opened object */
+ assertExpectedOpenedClassAndSelection("Bean1.java", "method");
+ }
+
+ private void assertExpectedOpenedClassAndSelection(String className,
+ String selectedString) {
+ assertEquals(className, bot.activeEditor().getTitle());
+ assertEquals(selectedString, bot.activeEditor().toTextEditor().getSelection());
+ }
+
+}