Author: scabanovich
Date: 2008-01-29 09:56:13 -0500 (Tue, 29 Jan 2008)
New Revision: 6013
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/BaseComponent.java
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/InheritedComponent.java
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
JBIDE-1691
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/BaseComponent.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/BaseComponent.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/BaseComponent.java 2008-01-29
14:56:13 UTC (rev 6013)
@@ -0,0 +1,11 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import javax.ejb.Remove;
+import org.jboss.seam.annotations.Destroy;
+
+public abstract class BaseComponent {
+
+ @Remove @Destroy
+ public void destroy() {}
+
+}
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/InheritedComponent.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/InheritedComponent.java
(rev 0)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/src/action/org/domain/SeamWebWarTestProject/session/InheritedComponent.java 2008-01-29
14:56:13 UTC (rev 6013)
@@ -0,0 +1,13 @@
+package org.domain.SeamWebWarTestProject.session;
+
+import javax.ejb.Stateful;
+import javax.persistence.Entity;
+
+import org.jboss.seam.annotations.Name;
+
+@Name("inheritedComponent")
+@Entity
+@Stateful
+public class InheritedComponent extends BaseComponent {
+
+}
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-01-29
14:44:34 UTC (rev 6012)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-01-29
14:56:13 UTC (rev 6013)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.core.test;
import java.io.IOException;
+import java.util.Set;
import junit.framework.TestCase;
@@ -24,7 +25,10 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.preference.IPersistentPreferenceStore;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamComponentMethod;
import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamComponentMethodType;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
import org.jboss.tools.seam.internal.core.SeamProject;
@@ -839,7 +843,24 @@
assertTrue(errorMessage, lineNumbers[0] == 16);
assertTrue(errorMessage, lineNumbers[1] == 16);
}
+
+ public void testInheritedMethods() {
+ ISeamProject seamProject = getSeamProject(project);
+ ISeamComponent c = seamProject.getComponent("inheritedComponent");
+ assertTrue("Component inheritedComponent is not found", c != null);
+
+ Set<ISeamComponentMethod> ms =
c.getMethodsByType(SeamComponentMethodType.DESTROY);
+ assertTrue("Seam tools does not see @Destroy-annotated method declared in super
class", ms.size() > 0);
+
+ ms = c.getMethodsByType(SeamComponentMethodType.REMOVE);
+ assertTrue("Seam tools does not see @Remove-annotated method declared in super
class", ms.size() > 0);
+
+ IFile f =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/InheritedComponent.java");
+ int errorsCount = getMarkersNumber(f);
+ assertTrue("Seam tools validator does not see annotated methods declared in super
class", errorsCount == 0);
+ }
+
private void modifyPreferences(){
IPreferenceStore store = SeamCorePlugin.getDefault().getPreferenceStore();
store.putValue(SeamPreferences.UNKNOWN_EL_VARIABLE_NAME, SeamPreferences.ERROR);
Show replies by date