Title: [1148] trunk/qdox/src/test/java/com/thoughtworks/qdox: mock Type for builders
Revision
1148
Author
rfscholte
Date
2011-04-01 14:54:38 -0500 (Fri, 01 Apr 2011)

Log Message

mock Type for builders
add JavaConstructor.getCodeBlock()

Modified Paths


Diff

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaConstructor.java (1147 => 1148)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaConstructor.java	2011-03-30 21:05:14 UTC (rev 1147)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaConstructor.java	2011-04-01 19:54:38 UTC (rev 1148)
@@ -13,5 +13,7 @@
     public List<Type> getExceptions();
 
     public String getSourceCode();
+    
+    public String getCodeBlock();
 
 }

Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaDocBuilderTest.java (1147 => 1148)

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaDocBuilderTest.java	2011-03-30 21:05:14 UTC (rev 1147)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaDocBuilderTest.java	2011-04-01 19:54:38 UTC (rev 1148)
@@ -460,7 +460,10 @@
         JavaMethod getFoo = propertyClass.getMethodBySignature("getFoo", null);
         JavaMethod isBar = propertyClass.getMethodBySignature("isBar", null);
         JavaMethod get = propertyClass.getMethodBySignature("get", null);
-        JavaMethod set = propertyClass.getMethodBySignature("set", Collections.singletonList(new Type("int")));
+        Type intType = mock(Type.class);
+        when(intType.getValue()).thenReturn( "int" );
+        when(intType.getDimensions()).thenReturn( 0 );
+        JavaMethod set = propertyClass.getMethodBySignature("set", Collections.singletonList(intType));
 
         JavaMethod protectedMethod = propertyClass.getMethodBySignature("protectedMethod", null);
         JavaMethod privateMethod = propertyClass.getMethodBySignature("privateMethod", null);

Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java (1147 => 1148)

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java	2011-03-30 21:05:14 UTC (rev 1147)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java	2011-04-01 19:54:38 UTC (rev 1148)
@@ -461,7 +461,10 @@
         JavaMethod getFoo = propertyClass.getMethodBySignature("getFoo", null);
         JavaMethod isBar = propertyClass.getMethodBySignature("isBar", null);
         JavaMethod get = propertyClass.getMethodBySignature("get", null);
-        JavaMethod set = propertyClass.getMethodBySignature("set", Collections.singletonList(new Type("int")));
+        Type intType = mock( Type.class );
+        when( intType.getValue() ).thenReturn( "int" );
+        when( intType.getDimensions() ).thenReturn( 0 );
+        JavaMethod set = propertyClass.getMethodBySignature( "set", Collections.singletonList( intType ) );
 
         JavaMethod protectedMethod = propertyClass.getMethodBySignature("protectedMethod", null);
         JavaMethod privateMethod = propertyClass.getMethodBySignature("privateMethod", null);


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to