Author: scabanovich
Date: 2010-06-11 09:02:39 -0400 (Fri, 11 Jun 2010)
New Revision: 22771
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java
Log:
https://jira.jboss.org/browse/JBIDE-6414
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 2010-06-11
13:01:10 UTC (rev 22770)
+++
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/NewCDIWizardTest.java 2010-06-11
13:02:39 UTC (rev 22771)
@@ -26,7 +26,9 @@
import org.jboss.tools.cdi.ui.CDIUIPlugin;
import org.jboss.tools.cdi.ui.wizard.NewCDIAnnotationCreationWizard;
import org.jboss.tools.cdi.ui.wizard.NewCDIAnnotationWizardPage;
+import org.jboss.tools.cdi.ui.wizard.NewInterceptorBindingWizardPage;
import org.jboss.tools.cdi.ui.wizard.NewQualifierWizardPage;
+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.util.FileUtil;
@@ -42,6 +44,8 @@
static String PACK_NAME = "test";
static String QUALIFIER_NAME = "MyQualifier";
static String STEREOTYPE_NAME = "MyStereotype";
+ static String SCOPE_NAME = "MyScope";
+ static String INTERCEPTOR_BINDING_NAME = "MyInterceptorBinding";
static class WizardContext {
NewCDIAnnotationCreationWizard wizard;
@@ -148,4 +152,48 @@
}
+ public void testNewScopeWizard() {
+ WizardContext context = new WizardContext();
+ context.init("org.jboss.tools.cdi.ui.wizard.NewScopeCreationWizard",
+ PACK_NAME, SCOPE_NAME);
+
+ try {
+ NewScopeWizardPage page = (NewScopeWizardPage)context.page;
+
+ context.wizard.performFinish();
+
+ String text = context.getNewTypeContent();
+
+ assertTrue(text.contains("@NormalScope"));
+ assertTrue(text.contains("@Inherited"));
+ assertTrue(text.contains("@Target( { TYPE, METHOD, FIELD })"));
+ assertTrue(text.contains("@Retention(RUNTIME)"));
+
+ } finally {
+ context.close();
+ }
+ }
+
+ public void testNewInterceptorBindingWizard() {
+ WizardContext context = new WizardContext();
+ context.init("org.jboss.tools.cdi.ui.wizard.NewInterceptorBindingCreationWizard",
+ PACK_NAME, INTERCEPTOR_BINDING_NAME);
+
+ try {
+ NewInterceptorBindingWizardPage page = (NewInterceptorBindingWizardPage)context.page;
+
+ context.wizard.performFinish();
+
+ String text = context.getNewTypeContent();
+
+ assertTrue(text.contains("@InterceptorBinding"));
+ assertTrue(text.contains("@Inherited"));
+ assertTrue(text.contains("@Target( { TYPE, METHOD })"));
+ assertTrue(text.contains("@Retention(RUNTIME)"));
+
+ } finally {
+ context.close();
+ }
+ }
+
}
\ No newline at end of file