User: rinkrank
Date: 02/03/10 09:56:01
Modified: etc xjavadoctest.j
Log:
-Modified grammar and core, so both plain JavaCC and JJTree is supported.
JavaCC is faster, and will be used by XDoclet. The sources will be read-only. JJTree
is slower,
but enables svaing of (modified) sources.
-Removed XTagParameter class for the sake of simpler API and implementation
-Removed old benchmark tests
-Fixed some more deadlock issues
-Implemented wait/notify in interfaces too
-And some more tests (I think)
Revision Changes Path
1.2 +24 -0 xjavadoc/etc/xjavadoctest.j
Index: xjavadoctest.j
===================================================================
RCS file: /cvsroot/xdoclet/xjavadoc/etc/xjavadoctest.j,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- xjavadoctest.j 1 Mar 2002 10:44:41 -0000 1.1
+++ xjavadoctest.j 10 Mar 2002 17:56:01 -0000 1.2
@@ -3,6 +3,8 @@
import junit.framework.*;
import xjavadoc.*;
import java.io.File;
+import java.util.Arrays;
+import java.util.StringTokenizer;
/**
* Automatically generated JUnit test for xjavadoc
@@ -15,6 +17,15 @@
private XClass _testedClass;
+ private static final String tokenizeAndTrim( final String s ) {
+ StringBuffer sb = new StringBuffer();
+ StringTokenizer st = new StringTokenizer(s);
+ while( st.hasMoreTokens() ) {
+ sb.append( st.nextToken() ).append(" ");
+ }
+ return sb.toString().trim();
+ }
+
public <XDtClass:className/>__GENERATED__Test( String name ) {
super( name );
}
@@ -61,6 +72,7 @@
int f = 0;
XField[] fields = _testedClass.fields();
+ Arrays.sort(fields);
<XDtField:forAllFields superclasses="false" sort="true">
// test if field type is the same
assertEquals( "<XDtField:fieldType/>",
fields[f].type().qualifiedName() + toArray(fields[f].dimension()));
@@ -74,9 +86,12 @@
public void testMethods() {
int m = 0;
int p = 0;
+ int t = 0;
XMethod[] methods = _testedClass.methods();
+ Arrays.sort(methods);
XParameter[] parameters;
+ XTag[] paramTags;
<XDtMethod:forAllMethods superclasses="false" sort="true">
// test if return type is the same
assertEquals( "<XDtMethod:methodType/>",
methods[m].returnType().qualifiedName() + toArray(methods[m].returnDimension()) );
@@ -92,6 +107,15 @@
assertEquals( "<XDtParameter:methodParamName/>", parameters[p].name()
);
p++;
</XDtParameter:forAllMethodParams>
+
+ // test if doc is the same
+ paramTags = methods[m].doc().tags("param");
+ t = 0;
+ <XDtMethod:forAllMethodTags tagName="param">
+ assertEquals( tokenizeAndTrim("<XDtMethod:methodTagValue
tagName="param"/>"), paramTags[t].value() );
+ t++;
+ </XDtMethod:forAllMethodTags>
+
m++;
</XDtMethod:forAllMethods>
}
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel