Title: [1361] trunk/qdox/src/test/java/com/thoughtworks/qdox: Refactored all variants of signatureMatches

Diff

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/AbstractBaseMethod.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/AbstractBaseMethod.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/AbstractBaseMethod.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -60,9 +60,9 @@
         this.exceptions = exceptions;
     }
 
-    protected boolean signatureMatches( List<Type> parameterTypes, boolean varArgs )
+    protected boolean signatureMatches( List<JavaType> parameterTypes, boolean varArgs )
     {
-        List<Type> parameterTypeList;
+        List<JavaType> parameterTypeList;
         if( parameterTypes == null) {
             parameterTypeList = Collections.emptyList();
         }
@@ -92,7 +92,7 @@
     public List<DocletTag> getTagsByName( String name, boolean inherited )
     {
         JavaClass cls = getParentClass();
-        List<Type> types = new LinkedList<Type>();
+        List<JavaType> types = new LinkedList<JavaType>();
         for (JavaParameter parameter : getParameters()) {
             types.add(parameter.getType());
         }

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaClass.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaClass.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaClass.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -425,7 +425,7 @@
      * (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getConstructor(java.util.List)
      */
-    public JavaConstructor getConstructor( List<Type> parameterTypes )
+    public JavaConstructor getConstructor( List<JavaType> parameterTypes )
     {
         return getConstructor( parameterTypes, false );
     }
@@ -434,7 +434,7 @@
      * (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getConstructor(java.util.List, boolean)
      */
-    public JavaConstructor getConstructor( List<Type> parameterTypes, boolean varArgs )
+    public JavaConstructor getConstructor( List<JavaType> parameterTypes, boolean varArgs )
     {
         for ( JavaConstructor constructor : getConstructors() )
         {
@@ -518,14 +518,14 @@
     /* (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getMethodBySignature(java.lang.String, java.util.List)
      */
-    public JavaMethod getMethodBySignature(String name, List<Type> parameterTypes) {
+    public JavaMethod getMethodBySignature(String name, List<JavaType> parameterTypes) {
         return getMethod( name, parameterTypes, false );
     }
 
     /* (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getMethod(java.lang.String, java.util.List, boolean)
      */
-    public JavaMethod getMethod(String name, List<Type> parameterTypes, boolean varArgs) {
+    public JavaMethod getMethod(String name, List<JavaType> parameterTypes, boolean varArgs) {
         for (JavaMethod method : getMethods()) {
             if (method.signatureMatches(name, parameterTypes, varArgs)) {
                 return method;
@@ -537,7 +537,7 @@
     /* (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getMethodBySignature(java.lang.String, java.util.List, boolean)
      */
-    public JavaMethod getMethodBySignature(String name, List<Type> parameterTypes,
+    public JavaMethod getMethodBySignature(String name, List<JavaType> parameterTypes,
                                            boolean superclasses) {
         return getMethodBySignature( name, parameterTypes, superclasses, false );
     }
@@ -545,7 +545,7 @@
     /* (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getMethodBySignature(java.lang.String, java.util.List, boolean, boolean)
      */
-    public JavaMethod getMethodBySignature(String name, List<Type> parameterTypes,
+    public JavaMethod getMethodBySignature(String name, List<JavaType> parameterTypes,
                                            boolean superclasses, boolean varArg) {
         
         List<JavaMethod> result = getMethodsBySignature(name, parameterTypes,
@@ -558,7 +558,7 @@
      * @see com.thoughtworks.qdox.model.JavaClass#getMethodsBySignature(java.lang.String, java.util.List, boolean)
      */
     public List<JavaMethod> getMethodsBySignature(String name,
-                                              List<Type> parameterTypes, boolean superclasses) {
+                                              List<JavaType> parameterTypes, boolean superclasses) {
         return getMethodsBySignature( name, parameterTypes, superclasses, false );
     }
 
@@ -566,7 +566,7 @@
      * @see com.thoughtworks.qdox.model.JavaClass#getMethodsBySignature(java.lang.String, java.util.List, boolean, boolean)
      */
     public List<JavaMethod> getMethodsBySignature(String name,
-                                              List<Type> parameterTypes, boolean superclasses, boolean varArg) {
+                                              List<JavaType> parameterTypes, boolean superclasses, boolean varArg) {
         List<JavaMethod> result = new LinkedList<JavaMethod>();
 
         JavaMethod methodInThisClass = getMethod(name, parameterTypes, varArg);
@@ -883,6 +883,11 @@
         return sb.toString();
     }
     
+    public String toGenericString()
+    {
+        return toString();
+    }
+    
     @Override
     public int hashCode()
     {

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaConstructor.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaConstructor.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaConstructor.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -25,12 +25,12 @@
         return typeParameters;
     }
     
-    public boolean signatureMatches( List<Type> parameterTypes )
+    public boolean signatureMatches( List<JavaType> parameterTypes )
     {
         return signatureMatches( parameterTypes, false );
     }
     
-    public boolean signatureMatches( List<Type> parameterTypes, boolean varArgs )
+    public boolean signatureMatches( List<JavaType> parameterTypes, boolean varArgs )
     {
         return super.signatureMatches( parameterTypes, varArgs );
     }

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaMethod.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -273,7 +273,7 @@
     /* (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaMethod#getPropertyType()
      */
-    public Type getPropertyType() 
+    public JavaType getPropertyType() 
     {
         if ( isPropertyAccessor() ) 
         {
@@ -355,7 +355,7 @@
             {
                 result.append( "," );
             }
-            Type originalType = getParameters().get( paramIndex ).getType();
+            JavaType originalType = getParameters().get( paramIndex ).getType();
             TypeVariable typeVariable = Type.resolve( originalType, getTypeParameters() ); 
             result.append( typeVariable == null ? originalType.getFullyQualifiedName() : typeVariable.getResolvedFullyQualifiedName() );
         }
@@ -398,12 +398,12 @@
         return returns;
     }
     
-    public boolean signatureMatches( String name, List<Type> parameterTypes )
+    public boolean signatureMatches( String name, List<JavaType> parameterTypes )
     {
         return signatureMatches( name, parameterTypes, false );
     }
     
-    public boolean signatureMatches( String name, List<Type> parameterTypes, boolean varArg )
+    public boolean signatureMatches( String name, List<JavaType> parameterTypes, boolean varArg )
     {
         if ( !name.equals( this.getName() ) ) 
         {

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaParameter.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaParameter.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/DefaultJavaParameter.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -20,19 +20,19 @@
  */
 
 
-public class DefaultJavaParameter extends AbstractBaseJavaEntity implements JavaParameter 
+public class DefaultJavaParameter<T extends JavaClass & JavaParameterizedType> extends AbstractBaseJavaEntity implements JavaParameter 
 {
 
     private String name;
-    private Type type;
+    private T type;
     private JavaMethod parentMethod;
     private boolean varArgs;
 
-    public DefaultJavaParameter(Type type, String name) {
+    public DefaultJavaParameter(T type, String name) {
         this(type, name, false);
     }
 
-    public DefaultJavaParameter(Type type, String name, boolean varArgs) {
+    public DefaultJavaParameter(T type, String name, boolean varArgs) {
         this.name = name;
         this.type = type;
         this.varArgs = varArgs;
@@ -56,10 +56,14 @@
     /* (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaParameter#getType()
      */
-    public Type getType() {
+    public JavaType getType() {
         return type;
     }
 
+    public JavaClass getJavaClass()
+    {
+        return type;
+    }
     /* (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaParameter#getParentMethod()
      */

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaClass.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaClass.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaClass.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -186,7 +186,7 @@
      * @return the matching constructor, otherwise <code>null</code>
      * @since 2.0
      */
-    JavaConstructor getConstructor(List<Type> parameterTypes);
+    JavaConstructor getConstructor(List<JavaType> parameterTypes);
     
     /**
      * 
@@ -195,7 +195,7 @@
      * @return the matching constructor, otherwise <code>null</code>
      * @since 2.0
      */
-    JavaConstructor getConstructor(List<Type> parameterTypes, boolean varArg);
+    JavaConstructor getConstructor(List<JavaType> parameterTypes, boolean varArg);
     
 
     /**
@@ -209,7 +209,7 @@
      * @param parameterTypes the parameter types of the method, can be <code>null</code>.
      * @return the matching method, otherwise <code>null</code>
      */
-    JavaMethod getMethodBySignature( String name, List<Type> parameterTypes );
+    JavaMethod getMethodBySignature( String name, List<JavaType> parameterTypes );
 
     /**
      * This should be the signature for getMethodBySignature.
@@ -219,7 +219,7 @@
      * @param varArgs define if the method has varArgs
      * @return the matching method, otherwise <code>null</code>
      */
-    JavaMethod getMethod( String name, List<Type> parameterTypes, boolean varArgs );
+    JavaMethod getMethod( String name, List<JavaType> parameterTypes, boolean varArgs );
 
     /**
      * 
@@ -228,7 +228,7 @@
      * @param superclasses to define if superclasses should be included as well
      * @return the matching method, otherwise <code>null</code> 
      */
-    JavaMethod getMethodBySignature( String name, List<Type> parameterTypes, boolean superclasses );
+    JavaMethod getMethodBySignature( String name, List<JavaType> parameterTypes, boolean superclasses );
 
     /**
      * 
@@ -238,7 +238,7 @@
      * @param varArg define if the method has varArgs
      * @return the matching method, otherwise <code>null</code>
      */
-    JavaMethod getMethodBySignature( String name, List<Type> parameterTypes, boolean superclasses, boolean varArg );
+    JavaMethod getMethodBySignature( String name, List<JavaType> parameterTypes, boolean superclasses, boolean varArg );
 
     /**
      * 
@@ -247,7 +247,7 @@
      * @param superclasses to define if superclasses should be included as well
      * @return the matching methods, otherwise <code>null</code>
      */
-    List<JavaMethod> getMethodsBySignature( String name, List<Type> parameterTypes, boolean superclasses );
+    List<JavaMethod> getMethodsBySignature( String name, List<JavaType> parameterTypes, boolean superclasses );
 
     /**
      * 
@@ -257,7 +257,7 @@
      * @param varArg define if the method has varArgs
      * @return the matching methods, otherwise <code>null</code>
      */
-    List<JavaMethod> getMethodsBySignature( String name, List<Type> parameterTypes, boolean superclasses,
+    List<JavaMethod> getMethodsBySignature( String name, List<JavaType> parameterTypes, boolean superclasses,
                                                    boolean varArg );
 
     /**

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

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaConstructor.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaConstructor.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -93,7 +93,7 @@
      * @param parameterTypes
      * @return <code>true</code> if signature matches, otherwise <code>false</code>
      */
-    boolean signatureMatches( List<Type> parameterTypes );
+    boolean signatureMatches( List<JavaType> parameterTypes );
 
     /**
      * Returns <code>true</code> if this constructor matches the parameterTypes and matches the varArg argument.
@@ -102,6 +102,6 @@
      * @param varArgs 
      * @return <code>true</code> if signature matches, otherwise <code>false</code>
      */
-    boolean signatureMatches( List<Type> parameterTypes, boolean varArgs );
+    boolean signatureMatches( List<JavaType> parameterTypes, boolean varArgs );
 
 }

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethod.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethod.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethod.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -64,7 +64,7 @@
      * @param parameterTypes the parameter types of the method, can be <code>null</code>
      * @return <code>true</code> if this method matches the signature, otherwise <code>false</code>
      */
-    boolean signatureMatches( String name, List<Type> parameterTypes );
+    boolean signatureMatches( String name, List<JavaType> parameterTypes );
 
     /**
      * @param name the name of the method
@@ -72,7 +72,7 @@
      * @param varArg <code>true</code> is signature should match a varArg-method, otherwise <code>false</code>
      * @return <code>true</code> if this method matches the signature, otherwise <code>false</code>
      */
-    boolean signatureMatches( String name, List<Type> parameterTypes, boolean varArg );
+    boolean signatureMatches( String name, List<JavaType> parameterTypes, boolean varArg );
 
     /**
      * Returns <code>true</code> if this method follows the bean convention of being an accessor.

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethodDelegate.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethodDelegate.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaMethodDelegate.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -286,12 +286,12 @@
         return originalMethod.isVolatile();
     }
 
-    public boolean signatureMatches( String name, List<Type> parameterTypes, boolean varArg )
+    public boolean signatureMatches( String name, List<JavaType> parameterTypes, boolean varArg )
     {
         return originalMethod.signatureMatches( name, parameterTypes, varArg );
     }
 
-    public boolean signatureMatches( String name, List<Type> parameterTypes )
+    public boolean signatureMatches( String name, List<JavaType> parameterTypes )
     {
         return originalMethod.signatureMatches( name, parameterTypes );
     }

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaParameter.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaParameter.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaParameter.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -38,7 +38,9 @@
      * 
      * @return the type of this parameter
      */
-    Type getType();
+    JavaType getType();
+    
+    JavaClass getJavaClass();
 
     /**
      * Returns the declaring method of this parameter

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaType.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaType.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaType.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -1,7 +1,5 @@
 package com.thoughtworks.qdox.model;
 
-import java.util.List;
-
 public interface JavaType
 {
     String getCanonicalName();
@@ -13,4 +11,6 @@
     String getValue();
 
     String getGenericValue();
+
+    String toGenericString();
 }
\ No newline at end of file

Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/Type.java (1360 => 1361)

--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/Type.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/Type.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -860,7 +860,7 @@
      * (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getConstructor(java.util.List)
      */
-    public JavaConstructor getConstructor( List<Type> parameterTypes )
+    public JavaConstructor getConstructor( List<JavaType> parameterTypes )
     {
         return resolveRealClass().getConstructor( parameterTypes );
     }
@@ -869,7 +869,7 @@
      * (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getConstructor(java.util.List, boolean)
      */
-    public JavaConstructor getConstructor( List<Type> parameterTypes, boolean varArg )
+    public JavaConstructor getConstructor( List<JavaType> parameterTypes, boolean varArg )
     {
         return resolveRealClass().getConstructor( parameterTypes, varArg );
     }
@@ -887,7 +887,7 @@
      * (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getMethodBySignature(java.lang.String, java.util.List)
      */
-    public JavaMethod getMethodBySignature( String name, List<Type> parameterTypes )
+    public JavaMethod getMethodBySignature( String name, List<JavaType> parameterTypes )
     {
         return resolveRealClass().getMethodBySignature( name, parameterTypes );
     }
@@ -896,7 +896,7 @@
      * (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getMethod(java.lang.String, java.util.List, boolean)
      */
-    public JavaMethod getMethod( String name, List<Type> parameterTypes, boolean varArgs )
+    public JavaMethod getMethod( String name, List<JavaType> parameterTypes, boolean varArgs )
     {
         return resolveRealClass().getMethod( name, parameterTypes, varArgs );
     }
@@ -905,7 +905,7 @@
      * (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getMethodBySignature(java.lang.String, java.util.List, boolean)
      */
-    public JavaMethod getMethodBySignature( String name, List<Type> parameterTypes, boolean superclasses )
+    public JavaMethod getMethodBySignature( String name, List<JavaType> parameterTypes, boolean superclasses )
     {
         return resolveRealClass().getMethodBySignature( name, parameterTypes, superclasses );
     }
@@ -914,7 +914,7 @@
      * (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getMethodBySignature(java.lang.String, java.util.List, boolean, boolean)
      */
-    public JavaMethod getMethodBySignature( String name, List<Type> parameterTypes, boolean superclasses, boolean varArg )
+    public JavaMethod getMethodBySignature( String name, List<JavaType> parameterTypes, boolean superclasses, boolean varArg )
     {
         return resolveRealClass().getMethodBySignature( name, parameterTypes, superclasses, varArg );
     }
@@ -923,7 +923,7 @@
      * (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getMethodsBySignature(java.lang.String, java.util.List, boolean)
      */
-    public List<JavaMethod> getMethodsBySignature( String name, List<Type> parameterTypes, boolean superclasses )
+    public List<JavaMethod> getMethodsBySignature( String name, List<JavaType> parameterTypes, boolean superclasses )
     {
         return resolveRealClass().getMethodsBySignature( name, parameterTypes, superclasses );
     }
@@ -932,7 +932,7 @@
      * (non-Javadoc)
      * @see com.thoughtworks.qdox.model.JavaClass#getMethodsBySignature(java.lang.String, java.util.List, boolean, boolean)
      */
-    public List<JavaMethod> getMethodsBySignature( String name, List<Type> parameterTypes, boolean superclasses,
+    public List<JavaMethod> getMethodsBySignature( String name, List<JavaType> parameterTypes, boolean superclasses,
                                                    boolean varArg )
     {
         return resolveRealClass().getMethodsBySignature( name, parameterTypes, superclasses, varArg );

Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/ClassResolutionTest.java (1360 => 1361)

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/ClassResolutionTest.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/ClassResolutionTest.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -7,6 +7,7 @@
 import com.thoughtworks.qdox.model.JavaClass;
 import com.thoughtworks.qdox.model.JavaMethod;
 import com.thoughtworks.qdox.model.JavaParameter;
+import com.thoughtworks.qdox.model.JavaType;
 import com.thoughtworks.qdox.model.Type;
 
 public class ClassResolutionTest extends TestCase {
@@ -36,7 +37,7 @@
         JavaClass class2 = builder.getClassByName("package2.Class2");
         JavaMethod method = class2.getMethods().get(0);
         JavaParameter parameter = method.getParameters().get(0);
-        Type type = parameter.getType();
+        JavaType type = parameter.getType();
 
         // verify
         assertEquals("Should include fully qualified name", "package1.Class1$NestedClass", type.getFullyQualifiedName());
@@ -91,7 +92,8 @@
     	builder.addSource(new StringReader(source));
     	JavaMethod method = builder.getClassByName("some.pack.Test").getMethods().get(0);
     	JavaParameter parameter = method.getParameters().get(0);
-    	assertEquals( "some.pack.Test$Inner$Inner2", parameter.getType().getJavaClass().getFullyQualifiedName() );
+        assertEquals( "some.pack.Test$Inner$Inner2", parameter.getJavaClass().getFullyQualifiedName() );
+    	assertEquals( "some.pack.Test$Inner$Inner2", parameter.getType().getFullyQualifiedName() );
         assertEquals( "some.pack.Test$Inner$Inner2", parameter.getFullyQualifiedName() );
     }
 }

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

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -473,14 +473,14 @@
         assertEquals(2, propertyClass.getConstructors().size());
 
         JavaConstructor ctor = propertyClass.getConstructor(null);
-        JavaConstructor ctor2 = propertyClass.getConstructor(Collections.singletonList(propertyClass.asType()));
+        JavaConstructor ctor2 = propertyClass.getConstructor(Collections.singletonList((JavaType) propertyClass.asType()));
         JavaMethod getFoo = propertyClass.getMethodBySignature("getFoo", null);
         JavaMethod isBar = propertyClass.getMethodBySignature("isBar", null);
         JavaMethod get = propertyClass.getMethodBySignature("get", null);
         Type intType = mock( Type.class );
         when( intType.getFullyQualifiedName() ).thenReturn( "int" );
         when( intType.getDimensions() ).thenReturn( 0 );
-        JavaMethod set = propertyClass.getMethodBySignature( "set", Collections.singletonList( intType ) );
+        JavaMethod set = propertyClass.getMethodBySignature( "set", Collections.singletonList( (JavaType) intType ) );
 
         JavaMethod protectedMethod = propertyClass.getMethodBySignature("protectedMethod", null);
         JavaMethod privateMethod = propertyClass.getMethodBySignature("privateMethod", null);

Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/MethodsTest.java (1360 => 1361)

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/MethodsTest.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/MethodsTest.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -8,6 +8,7 @@
 import com.thoughtworks.qdox.model.JavaMethod;
 import com.thoughtworks.qdox.model.JavaParameter;
 import com.thoughtworks.qdox.model.JavaSource;
+import com.thoughtworks.qdox.model.JavaType;
 import com.thoughtworks.qdox.model.Type;
 
 public class MethodsTest extends TestCase {
@@ -27,9 +28,9 @@
     public void testVarArgsParametersAreAlsoArrays() {
         JavaMethod javaMethod = buildMethod("void doStuff(AThing param1, BThing[] param2, CThing... param3);");
 
-        Type standardType = javaMethod.getParameterByName("param1").getType();
-        Type arrayType = javaMethod.getParameterByName("param2").getType();
-        Type varArgsType = javaMethod.getParameterByName("param3").getType();
+        JavaClass standardType = javaMethod.getParameterByName("param1").getJavaClass();
+        JavaClass arrayType = javaMethod.getParameterByName("param2").getJavaClass();
+        JavaClass varArgsType = javaMethod.getParameterByName("param3").getJavaClass();
 
         assertFalse("param1 should NOT be array", standardType.isArray());
         assertTrue("param2 should be array", arrayType.isArray());

Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/builder/ModelBuilderTest.java (1360 => 1361)

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/builder/ModelBuilderTest.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/builder/ModelBuilderTest.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -428,8 +428,8 @@
 
         JavaSource source = builder.getSource();
         JavaMethod result = source.getClasses().get(0).getMethods().get(0);
-        assertEquals(1, result.getParameters().get(0).getType().getDimensions());
-        assertEquals(2, result.getParameters().get(1).getType().getDimensions());
+        assertEquals(1, result.getParameters().get(0).getJavaClass().getDimensions());
+        assertEquals(2, result.getParameters().get(1).getJavaClass().getDimensions());
     }
 
     public void testMethodExceptions() throws Exception {

Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/model/JavaClassTest.java (1360 => 1361)

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/model/JavaClassTest.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/model/JavaClassTest.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -533,7 +533,7 @@
 
     public void testCanGetMethodBySignature() {
         final String methodName = "doStuff";
-        final List<Type> parameterTypes = type(new String[]{"int", "double"});
+        final List<JavaType> parameterTypes = javaType(new String[]{"int", "double"});
         JavaMethod method = mock(JavaMethod.class);
         when(method.getName()).thenReturn(methodName);
         //both signatureMatches-methods are allowed
@@ -697,12 +697,17 @@
         return result;
     }
     
+    private List<JavaType> javaType(String[] typeNames)
+    {
+        return new LinkedList<JavaType>(type(typeNames));
+    }
+    
     // QDOX-201
     public void testGetVarArgMethodSignature() {
         List<JavaMethod> methods = new ArrayList<JavaMethod>();
         JavaMethod simpleMethod = mock(JavaMethod.class);
         
-        Type stringType = newType( "String" );
+        JavaType stringType = newType( "String" );
         //both signatureMatches-methods are allowed
         when(simpleMethod.signatureMatches( "doSomething", Collections.singletonList( stringType ) )).thenReturn( true );
         when(simpleMethod.signatureMatches( "doSomething", Collections.singletonList( stringType ), false )).thenReturn( true );

Modified: trunk/qdox/src/test/java/com/thoughtworks/qdox/model/JavaMethodTest.java (1360 => 1361)

--- trunk/qdox/src/test/java/com/thoughtworks/qdox/model/JavaMethodTest.java	2011-10-02 20:42:47 UTC (rev 1360)
+++ trunk/qdox/src/test/java/com/thoughtworks/qdox/model/JavaMethodTest.java	2011-10-02 21:17:41 UTC (rev 1361)
@@ -324,17 +324,17 @@
         setParameters(mth, Arrays.asList( newJavaParameter(intType, "x"), newJavaParameter(longArrayType, "y") ));
         setReturns(mth, newType("void"));
 
-        Type[] correctTypes = new Type[]{
+        JavaType[] correctTypes = new Type[]{
             intType,
             longArrayType
         };
 
-        Type[] wrongTypes1 = new Type[]{
+        JavaType[] wrongTypes1 = new Type[]{
             newType("int", 2),
             newType("long")
         };
 
-        Type[] wrongTypes2 = new Type[]{
+        JavaType[] wrongTypes2 = new Type[]{
             intType,
             longArrayType,
             newType("double")
@@ -354,17 +354,17 @@
         setParameters(mth, Arrays.asList( newJavaParameter(intType, "x"), newJavaParameter(longArrayType, "y", true) ));
         setReturns(mth, newType("void"));
 
-        Type[] correctTypes = new Type[]{
+        JavaType[] correctTypes = new Type[]{
             intType,
             longArrayType
         };
 
-        Type[] wrongTypes1 = new Type[]{
+        JavaType[] wrongTypes1 = new Type[]{
             newType("int", 2),
             newType("long")
         };
 
-        Type[] wrongTypes2 = new Type[]{
+        JavaType[] wrongTypes2 = new Type[]{
             intType,
             longArrayType,
             newType("double")


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to