Author: scabanovich
Date: 2011-02-11 08:52:11 -0500 (Fri, 11 Feb 2011)
New Revision: 29115
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
Log:
JBIDE-8264
https://issues.jboss.org/browse/JBIDE-8264
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2011-02-11
13:51:11 UTC (rev 29114)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2011-02-11
13:52:11 UTC (rev 29115)
@@ -52,6 +52,8 @@
import org.jboss.tools.cdi.ui.wizard.NewScopeWizardPage;
import org.jboss.tools.cdi.ui.wizard.NewStereotypeWizardPage;
import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.JobUtils;
@@ -189,7 +191,11 @@
page.setInherited(true);
page.setTarget("METHOD,FIELD");
page.setNamed(true);
+ page.setAlternative(true);
+ page.setToBeRegisteredInBeansXML(true);
+ assertTrue(page.isToBeRegisteredInBeansXML());
+
context.wizard.performFinish();
String text = context.getNewTypeContent();
@@ -199,6 +205,12 @@
assertTrue(text.contains("@Named"));
assertTrue(text.contains("@Target({ METHOD, FIELD })"));
assertTrue(text.contains("@Retention(RUNTIME)"));
+
+ IProject tck = ResourcesPlugin.getWorkspace().getRoot().getProject("tck");
+ IFile f = tck.getFile("WebContent/WEB-INF/beans.xml");
+ XModelObject o = EclipseResourceUtil.createObjectForResource(f);
+ XModelObject c = o.getChildByPath("Alternatives/" + PACK_NAME +
"." + STEREOTYPE_NAME);
+ assertNotNull(c);
} finally {
context.close();
@@ -342,6 +354,12 @@
assertTrue(text.contains("@Interceptor"));
assertTrue(text.contains("@" + INTERCEPTOR_BINDING_NAME));
+
+ IProject tck = ResourcesPlugin.getWorkspace().getRoot().getProject("tck");
+ IFile f = tck.getFile("WebContent/WEB-INF/beans.xml");
+ XModelObject o = EclipseResourceUtil.createObjectForResource(f);
+ XModelObject c = o.getChildByPath("Interceptors/" + PACK_NAME +
"." + INTERCEPTOR_NAME);
+ assertNotNull(c);
} finally {
context.close();
}