[jbosstools-commits] JBoss Tools SVN: r43626 - in trunk/cdi: tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon and 1 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Sep 12 16:38:50 EDT 2012


Author: dazarov
Date: 2012-09-12 16:38:49 -0400 (Wed, 12 Sep 2012)
New Revision: 43626

Added:
   trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestInjections.java
   trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestInjections.qfxresult
Modified:
   trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java
   trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
Log:
CDI hyper links should work on modified files correctly https://issues.jboss.org/browse/JBIDE-12404

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java	2012-09-12 19:46:56 UTC (rev 43625)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansHyperlink.java	2012-09-12 20:38:49 UTC (rev 43626)
@@ -49,6 +49,12 @@
 	}
 
 	public Set<? extends ICDIElement> getCDIElements() {
-		return null;
+		Display display = Display.getCurrent();
+		if(display == null) {
+			display = Display.getDefault();
+		}
+		AssignableBeansDialog dialog = new AssignableBeansDialog(display.getActiveShell());
+		dialog.setInjectionPoint(injectionPoint);
+		return dialog.beans;
 	}
 }

Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestInjections.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestInjections.java	                        (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestInjections.java	2012-09-12 20:38:49 UTC (rev 43626)
@@ -0,0 +1,5 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+
+public class TestInjections {
+}


Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestInjections.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestInjections.qfxresult
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestInjections.qfxresult	                        (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/TestInjections.qfxresult	2012-09-12 20:38:49 UTC (rev 43626)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+
+public class TestInjections {
+   @Inject private Logger logger;
+   
+   @Produces Logger ll;
+
+   public Logger getLogger()
+   {
+      return logger;
+   }
+
+   public void doSomething()
+   {
+      logger.log("Test message");
+   }
+}

Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java	2012-09-12 19:46:56 UTC (rev 43625)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java	2012-09-12 20:38:49 UTC (rev 43626)
@@ -90,6 +90,45 @@
 		
 		CDIHyperlinkTestUtil.checkRegions(tckProject, "JavaSource/org/jboss/jsr299/tck/tests/lookup/injectionpoint/LoggerConsumer.java", regionList, new InjectedPointHyperlinkDetector());
 	}
+	
+	public void testInjectedPointHyperlinkDetectorForAsYouType() throws Exception {
+		String[] paths = new String[]{
+			"/tck/JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/BasicLogger.java",
+			"/tck/JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/TestInjections.java"
+		};
+		Collection<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/BasicLogger.java",	true);
+		IBean bean=null;
+		for(IBean b : beans){
+			bean = b;
+		}
+		ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+		regionList.add(new TestRegion(/*115, 6*/"Inject",   new TestHyperlink[]{
+			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
+			new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE, paths)
+		})); // Inject
+		regionList.add(new TestRegion(/*133, 6*/"Logger",   new TestHyperlink[]{
+			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
+			new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE, paths)
+		})); // Logger
+		regionList.add(new TestRegion(/*140, 6*/"logger",   new TestHyperlink[]{
+			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
+			new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE, paths)
+		})); // logger
+		regionList.add(new TestRegion(/*196, 6*/"logger",   new TestHyperlink[]{
+			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
+			new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE, paths)
+		})); // logger
+		regionList.add(new TestRegion(/*250, 6*/"logger",   new TestHyperlink[]{
+			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
+			new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE, paths)
+		})); // logger
+		
+		CDIHyperlinkTestUtil.checkRegionsForAsYouType(tckProject,
+				"JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/TestInjections.java",
+				"JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/TestInjections.qfxresult",
+				regionList,
+				new InjectedPointHyperlinkDetector());
+	}
 
 	public void testInjectedPointHyperlinkDetectorWithComment() throws Exception {
 		Collection<IBean> beans = cdiProject.getBeans("/tck/JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/BasicLogger.java",	true);
@@ -99,19 +138,24 @@
 		}
 		ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
 		regionList.add(new TestRegion("Inject",   new TestHyperlink[]{
-			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean)
+			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
+			new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
 		})); // Inject
 		regionList.add(new TestRegion("Logger",   new TestHyperlink[]{
-			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean)
+			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
+			new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
 		})); // Logger
 		regionList.add(new TestRegion("logger",   new TestHyperlink[]{
-			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean)
+			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
+			new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
 		})); // logger
 		regionList.add(new TestRegion("logger",   new TestHyperlink[]{
-			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean)
+			new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
+			new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
 		})); // logger
 		regionList.add(new TestRegion("logger",   new TestHyperlink[]{
-				new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean)
+				new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " BasicLogger", bean),
+				new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
 			})); // logger
 		
 		CDIHyperlinkTestUtil.checkRegions(tckProject, "JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/LoggerConsumer.java", regionList, new InjectedPointHyperlinkDetector());



More information about the jbosstools-commits mailing list