Author: scabanovich
Date: 2011-09-30 21:05:15 -0400 (Fri, 30 Sep 2011)
New Revision: 35255
Added:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/AssignableBeansDialogTest.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CdiTextExtAllTests.java
Log:
JBIDE-9347
https://issues.jboss.org/browse/JBIDE-9347
Test is added.
Added:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/AssignableBeansDialogTest.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/AssignableBeansDialogTest.java
(rev 0)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/AssignableBeansDialogTest.java 2011-10-01
01:05:15 UTC (rev 35255)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.text.ext.test;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IInjectionPointField;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
+import org.jboss.tools.cdi.text.ext.hyperlink.AssignableBeanFilters;
+import org.jboss.tools.cdi.text.ext.hyperlink.AssignableBeansDialog;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class AssignableBeansDialogTest extends TCKTest {
+
+ public AssignableBeansDialogTest() {}
+
+ public void testAssignableBeansDialog() {
+ String path =
"JavaSource/org/jboss/jsr299/tck/tests/jbt/lookup/ObjectInjection.java";
+ IFile file = tckProject.getFile(path);
+ assertTrue(file.exists());
+ IInjectionPointField injectionPoint = getInjectionPointField(path,
"object");
+
+ Display display = Display.getCurrent();
+ if(display == null) {
+ display = Display.getDefault();
+ }
+ AssignableBeansDialog dialog = new AssignableBeansDialog(display.getActiveShell());
+ dialog.setBlockOnOpen(false);
+ dialog.setInjectionPoint(injectionPoint);
+ dialog.open();
+
+ List<IBean> bs = dialog.getDisplayedBeans();
+ int allBeans = bs.size();
+ for (int i = 0; i < AssignableBeanFilters.ALL_OPTIONS.length; i++) {
+ dialog.setFilterEnabled(i, true);
+ }
+ for (int i = 0; i < AssignableBeanFilters.ALL_OPTIONS.length; i++) {
+ boolean b = dialog.isFilterEnabled(i);
+ dialog.setFilterEnabled(i, !b);
+ bs = dialog.getDisplayedBeans();
+ assertTrue(bs.size() < allBeans);
+ dialog.setFilterEnabled(i, b);
+ }
+ }
+}
Property changes on:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/AssignableBeansDialogTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CdiTextExtAllTests.java
===================================================================
---
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CdiTextExtAllTests.java 2011-10-01
00:58:47 UTC (rev 35254)
+++
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CdiTextExtAllTests.java 2011-10-01
01:05:15 UTC (rev 35255)
@@ -24,9 +24,10 @@
ValidationFramework.getDefault().suspendAllValidation(true);
- TestSuite suiteAll = new TestSuite("CDI Core Tests");
+ TestSuite suiteAll = new TestSuite("CDI Text Ext Tests");
TestSuite suite = new TestSuite("CDI OpenOns Tests");
+ suite.addTestSuite(AssignableBeansDialogTest.class);
suite.addTestSuite(InjectedPointHyperlinkDetectorTest.class);
suite.addTestSuite(ProducerDisposerHyperlinkDetectorTest.class);
suite.addTestSuite(EventAndObserverMethodHyperlinkDetectorTest.class);