[jbosstools-commits] JBoss Tools SVN: r41943 - in trunk/cdi: tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/WEB-INF/lib and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Jun 13 16:58:22 EDT 2012


Author: dazarov
Date: 2012-06-13 16:58:22 -0400 (Wed, 13 Jun 2012)
New Revision: 41943

Added:
   trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader30.java
   trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader31.java
Removed:
   trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader.java
Modified:
   trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java
   trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/WEB-INF/lib/seam-solder-test.jar
   trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java
Log:
Add support for annotation @Resource of Solder 3.1 https://issues.jboss.org/browse/JBIDE-12172

Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java	2012-06-13 20:27:43 UTC (rev 41942)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/CDISeamResourceLoadingHyperlinkDetector.java	2012-06-13 20:58:22 UTC (rev 41943)
@@ -34,7 +34,8 @@
 import org.jboss.tools.cdi.seam.text.ext.CDISeamExtPlugin;
 
 public class CDISeamResourceLoadingHyperlinkDetector extends AbstractHyperlinkDetector{
-	public static final String RESOURCE_ANNOTATION = "org.jboss.seam.solder.resourceLoader.Resource";
+	public static final String RESOURCE_ANNOTATION_30 = "org.jboss.seam.solder.resourceLoader.Resource";
+	public static final String RESOURCE_ANNOTATION_31 = "org.jboss.solder.resourceLoader.Resource";
 	public static final String VALUE = "value";
 
 	@Override
@@ -63,7 +64,10 @@
 			IJavaElement element = input.getElementAt(offset);
 			if(element != null){
 				if(element instanceof IField){
-					IAnnotation annotation = CDIMarkerResolutionUtils.findAnnotation(element, RESOURCE_ANNOTATION);
+					IAnnotation annotation = CDIMarkerResolutionUtils.findAnnotation(element, RESOURCE_ANNOTATION_30);
+					if(annotation == null || !annotation.exists()){
+						annotation = CDIMarkerResolutionUtils.findAnnotation(element, RESOURCE_ANNOTATION_31);
+					}
 					if(annotation != null && annotation.exists()){
 						IRegion annotationRegion = getAnnotationRegion(document, annotation);
 						String text = getValue(annotation);

Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/WEB-INF/lib/seam-solder-test.jar
===================================================================
(Binary files differ)

Deleted: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader.java	2012-06-13 20:27:43 UTC (rev 41942)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader.java	2012-06-13 20:58:22 UTC (rev 41943)
@@ -1,46 +0,0 @@
-package org.jboss.jsr299.tck.tests.jbt.openon;
-
-import java.net.URL;
-
-import javax.inject.Inject;
-
-import org.jboss.seam.solder.resourceLoader.Resource;
-
-public class ResourceLoader
-{
-   @Inject
-   @Resource("WEB-INF/beans.xml")
-   URL beansXml;
-
-   @Inject
-   @Resource("org/jboss/jsr299/tck/tests/jbt/openon/test.properties")
-   URL properties1;
-
-   @Inject
-   @Resource("org/jboss/jsr299/tck/tests/jbt/openon/test")
-   URL properties2;
-
-   @Inject
-   @Resource("org.jboss.jsr299.tck.tests.jbt.openon.test.properties")
-   URL properties3;
-
-   @Inject
-   @Resource("org.jboss.jsr299.tck.tests.jbt.openon.test")
-   URL properties4;
-
-   private String foo;
-   
-   public ResourceLoader(String foo)
-   {
-      this.foo = foo;
-   }
-   
-   /**
-    * @return the foo
-    */
-   public String getFoo()
-   {
-      return foo;
-   }
-
-}

Copied: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader30.java (from rev 41938, trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader.java)
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader30.java	                        (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader30.java	2012-06-13 20:58:22 UTC (rev 41943)
@@ -0,0 +1,46 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+import java.net.URL;
+
+import javax.inject.Inject;
+
+import org.jboss.seam.solder.resourceLoader.Resource;
+
+public class ResourceLoader30
+{
+   @Inject
+   @Resource("WEB-INF/beans.xml")
+   URL beansXml;
+
+   @Inject
+   @Resource("org/jboss/jsr299/tck/tests/jbt/openon/test.properties")
+   URL properties1;
+
+   @Inject
+   @Resource("org/jboss/jsr299/tck/tests/jbt/openon/test")
+   URL properties2;
+
+   @Inject
+   @Resource("org.jboss.jsr299.tck.tests.jbt.openon.test.properties")
+   URL properties3;
+
+   @Inject
+   @Resource("org.jboss.jsr299.tck.tests.jbt.openon.test")
+   URL properties4;
+
+   private String foo;
+   
+   public ResourceLoader(String foo)
+   {
+      this.foo = foo;
+   }
+   
+   /**
+    * @return the foo
+    */
+   public String getFoo()
+   {
+      return foo;
+   }
+
+}


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

Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader31.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader31.java	                        (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/openon/ResourceLoader31.java	2012-06-13 20:58:22 UTC (rev 41943)
@@ -0,0 +1,46 @@
+package org.jboss.jsr299.tck.tests.jbt.openon;
+
+import java.net.URL;
+
+import javax.inject.Inject;
+
+import org.jboss.solder.resourceLoader.Resource;
+
+public class ResourceLoader31
+{
+   @Inject
+   @Resource("WEB-INF/beans.xml")
+   URL beansXml;
+
+   @Inject
+   @Resource("org/jboss/jsr299/tck/tests/jbt/openon/test.properties")
+   URL properties1;
+
+   @Inject
+   @Resource("org/jboss/jsr299/tck/tests/jbt/openon/test")
+   URL properties2;
+
+   @Inject
+   @Resource("org.jboss.jsr299.tck.tests.jbt.openon.test.properties")
+   URL properties3;
+
+   @Inject
+   @Resource("org.jboss.jsr299.tck.tests.jbt.openon.test")
+   URL properties4;
+
+   private String foo;
+   
+   public ResourceLoader(String foo)
+   {
+      this.foo = foo;
+   }
+   
+   /**
+    * @return the foo
+    */
+   public String getFoo()
+   {
+      return foo;
+   }
+
+}


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

Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java	2012-06-13 20:27:43 UTC (rev 41942)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/CDISeamResourceLoadingHyperlinkDetectorTest.java	2012-06-13 20:58:22 UTC (rev 41943)
@@ -24,10 +24,17 @@
 import org.jboss.tools.cdi.text.ext.test.CDIHyperlinkTestUtil.TestRegion;
 
 public class CDISeamResourceLoadingHyperlinkDetectorTest extends TCKTest{
-	private static final String FILENAME = "JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/ResourceLoader.java";
 	
-	public void testCDISeamResourceLoadingHyperlinkDetector() throws Exception {
-		IFile file = tckProject.getFile(FILENAME);
+	public void testCDISeamResourceLoadingHyperlinkDetector_Solder30() throws Exception {
+		checkFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/ResourceLoader30.java");
+	}
+
+	public void testCDISeamResourceLoadingHyperlinkDetector_Solder31() throws Exception {
+		checkFile("JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/ResourceLoader31.java");
+	}
+	
+	private void checkFile(String fileName) throws Exception{
+		IFile file = tckProject.getFile(fileName);
 		String text = FileUtil.readStream(file);
 		
 		
@@ -69,7 +76,7 @@
 							"JavaSource/org/jboss/jsr299/tck/tests/jbt/openon/test.properties"))}));
 		}
 		 
-		CDIHyperlinkTestUtil.checkRegions(tckProject, FILENAME, regionList, new CDISeamResourceLoadingHyperlinkDetector());
+		CDIHyperlinkTestUtil.checkRegions(tckProject, fileName, regionList, new CDISeamResourceLoadingHyperlinkDetector());
 	}
 
 }



More information about the jbosstools-commits mailing list