Author: dazarov
Date: 2007-10-12 12:18:04 -0400 (Fri, 12 Oct 2007)
New Revision: 4168
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
http://jira.jboss.com/jira/browse/EXIN-13
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 2007-10-12
16:02:55 UTC (rev 4167)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2007-10-12
16:18:04 UTC (rev 4168)
@@ -206,7 +206,37 @@
}
public void testComponentLifeCycleMethodsValidator() {
+ ISeamProject seamProject = getSeamProject(project);
+ IFile statefulComponentFile =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.java");
+
+ int number = getMarkersNumber(statefulComponentFile);
+ assertTrue("Problem marker was found in StatefulComponent.java file", number
== 0);
+
+ // Duplicate @Destroy method
+ System.out.println("Test - Duplicate @Destroy method");
+
+ IFile statefulComponentFile6 =
project.getFile("src/action/org/domain/SeamWebWarTestProject/session/StatefulComponent.6");
+ try{
+ statefulComponentFile.setContents(statefulComponentFile6.getContents(), true, false,
new NullProgressMonitor());
+ statefulComponentFile.touch(new NullProgressMonitor());
+ }catch(Exception ex){
+ JUnitUtils.fail("Error in changing 'StatefulComponent.java' content to
" +
+ "'StatefulComponent.6'", ex);
+ }
+
+ refreshProject(project);
+
+ String message = getMarkersMessage(statefulComponentFile);
+ assertTrue("Problem marker 'Duplicate @Destroy method' not found",
"Stateful component \"statefulComponent\" must have a method marked
@Remove".equals(message));
+
+ // Duplicate @Create method
+ // Duplicate @Unwrap method
+ // Only component class can have @Destroy method
+ // Only component class can have @Create method
+ // Only component class can have @Unwrap method
+ // Only component class can have @Observer method
+
}
public void testFactoriesValidator() {