Update of
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-tapestry/src/test/java/org/xdoclet/plugin/tapestry
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4216/xdoclet-plugins/plugin-tapestry/src/test/java/org/xdoclet/plugin/tapestry
Modified Files:
ComponentSpecificationPluginTestCase.java
PageSpecificationPluginTestCase.java
Log Message:
Added test for page and component filtering
Index: ComponentSpecificationPluginTestCase.java
===================================================================
RCS file:
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-tapestry/src/test/java/org/xdoclet/plugin/tapestry/ComponentSpecificationPluginTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ComponentSpecificationPluginTestCase.java 22 Aug 2005 09:51:31 -0000
1.1
--- ComponentSpecificationPluginTestCase.java 28 Sep 2005 17:25:56 -0000
1.2
***************
*** 6,9 ****
--- 6,10 ----
package org.xdoclet.plugin.tapestry;
+ import com.thoughtworks.qdox.model.JavaClass;
import java.io.File;
import java.io.IOException;
***************
*** 40,42 ****
--- 41,62 ----
return getResourceRelativeToThisPackage("sample/SampleComponent.xml");
}
+
+ public void testShouldGenerate(){
+ JavaClass sampleComponent =
getJavaClass("sample/SampleComponent.java");
+ assertTrue("SampleComponent.jwc should be
generated.",plugin.shouldGenerate(sampleComponent));
+
+ JavaClass wrongComponent1 =
getJavaClass("sample/WrongComponent1.java");
+ assertFalse("WrongComponent1.jwc should not be
generated.",plugin.shouldGenerate(wrongComponent1));
+
+ JavaClass wrongComponent2 =
getJavaClass("sample/WrongComponent2.java");
+ assertFalse("WrongComponent2.jwc should not be
generated.",plugin.shouldGenerate(wrongComponent2));
+ }
+
+ private JavaClass getJavaClass(String relativeFileName){
+ QDoxMetadataProvider provider = new
QDoxMetadataProvider(getResourceRelativeToThisPackage(relativeFileName));
+ // assert only one source is present
+ assertEquals(1,provider.getMetadata().size());
+ Object o = provider.getMetadata().iterator().next();
+ return (JavaClass) o;
+ }
}
\ No newline at end of file
Index: PageSpecificationPluginTestCase.java
===================================================================
RCS file:
/cvsroot/xdoclet-plugins/xdoclet-plugins/plugin-tapestry/src/test/java/org/xdoclet/plugin/tapestry/PageSpecificationPluginTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PageSpecificationPluginTestCase.java 22 Aug 2005 09:51:31 -0000
1.1
--- PageSpecificationPluginTestCase.java 28 Sep 2005 17:25:56 -0000
1.2
***************
*** 6,9 ****
--- 6,10 ----
package org.xdoclet.plugin.tapestry;
+ import com.thoughtworks.qdox.model.JavaClass;
import java.io.File;
import java.io.IOException;
***************
*** 40,42 ****
--- 41,62 ----
return getResourceRelativeToThisPackage("sample/SamplePage.xml");
}
+
+ public void testShouldGenerate(){
+ JavaClass samplePage = getJavaClass("sample/SamplePage.java");
+ assertTrue("SamplePage.page should be
generated.",plugin.shouldGenerate(samplePage));
+
+ JavaClass wrongPage1 = getJavaClass("sample/WrongPage1.java");
+ assertFalse("WrongPage1.page should not be
generated.",plugin.shouldGenerate(wrongPage1));
+
+ JavaClass wrongPage2 = getJavaClass("sample/WrongPage2.java");
+ assertFalse("WrongPage2.page should not be
generated.",plugin.shouldGenerate(wrongPage2));
+ }
+
+ private JavaClass getJavaClass(String relativeFileName){
+ QDoxMetadataProvider provider = new
QDoxMetadataProvider(getResourceRelativeToThisPackage(relativeFileName));
+ // assert only one source is present
+ assertEquals(1,provider.getMetadata().size());
+ Object o = provider.getMetadata().iterator().next();
+ return (JavaClass) o;
+ }
}
\ No newline at end of file
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
xdoclet-plugins-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-commits