commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1243713 - in /commons/sandbox/beanutils2/trunk/src: main/java/org/apache/commons/beanutils2/ main/java/org/apache/commons/beanutils2/type/ test/java/org/apache/commons/beanutils2/ test/java/org/apache/commons/beanutils2/type/
Date Mon, 13 Feb 2012 22:03:01 GMT
Author: simonetripodi
Date: Mon Feb 13 22:03:01 2012
New Revision: 1243713

URL: http://svn.apache.org/viewvc?rev=1243713&view=rev
Log:
rolled back the TypeLiteral 'framework' and getting ready to apply pending patches

Removed:
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/type/
    commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/type/
Modified:
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanUtils.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassAccessor.java
    commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassLoaderBuilder.java
    commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/ConstructorsTestCase.java
    commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/StaticMethodsTestCase.java

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanUtils.java?rev=1243713&r1=1243712&r2=1243713&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanUtils.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/BeanUtils.java
Mon Feb 13 22:03:01 2012
@@ -21,8 +21,6 @@ package org.apache.commons.beanutils2;
 
 import static org.apache.commons.beanutils2.internal.Assertions.checkNotNull;
 
-import org.apache.commons.beanutils2.type.TypeLiteral;
-
 public final class BeanUtils
 {
 
@@ -37,7 +35,7 @@ public final class BeanUtils
 
     // introspection stuff
 
-    public static <B> ClassAccessor<B> on( TypeLiteral<B> beanType )
+    public static <B> ClassAccessor<B> on( Class<B> beanType )
     {
         beanType = checkNotNull( beanType, "No bean class specified" );
 

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassAccessor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassAccessor.java?rev=1243713&r1=1243712&r2=1243713&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassAccessor.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassAccessor.java
Mon Feb 13 22:03:01 2012
@@ -26,8 +26,6 @@ import static org.apache.commons.beanuti
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 
-import org.apache.commons.beanutils2.type.TypeLiteral;
-
 final class DefaultClassAccessor<B>
     implements ClassAccessor<B>
 {
@@ -35,9 +33,9 @@ final class DefaultClassAccessor<B>
     private final AccessibleObjectsRegistry<Constructor<?>> constructorRegistry
=
                     AccessibleObjectsRegistry.getConstructorsRegistry();
 
-    private final TypeLiteral<B> beanClass;
+    private final Class<B> beanClass;
 
-    public DefaultClassAccessor( TypeLiteral<B> beanClass )
+    public DefaultClassAccessor( Class<B> beanClass )
     {
         this.beanClass = beanClass;
     }
@@ -50,7 +48,7 @@ final class DefaultClassAccessor<B>
     public BeanAccessor<B> newInstance()
         throws InstantiationException, IllegalAccessException
     {
-        B bean = (B) beanClass.getRawType().newInstance();
+        B bean = (B) beanClass.newInstance();
         return new DefaultBeanAccessor<B>( bean );
     }
 
@@ -101,7 +99,7 @@ final class DefaultClassAccessor<B>
     {
         @SuppressWarnings( "unchecked" ) // type driven by beanClass
         Constructor<B> constructor = (Constructor<B>) constructorRegistry.get(
exact,
-                                                                               beanClass.getRawType(),
+                                                                               beanClass,
                                                                                getParameterTypes(
arguments ) );
 
         if ( null == constructor )
@@ -128,7 +126,7 @@ final class DefaultClassAccessor<B>
     public ArgumentsAccessor invokeStatic( String methodName )
     {
         methodName = checkNotNull( methodName, "Impossible to execute null static method
in %s", beanClass );
-        return new DefaultArgumentsAccessor( beanClass.getRawType(), false, methodName, null
);
+        return new DefaultArgumentsAccessor( beanClass, false, methodName, null );
     }
 
     /**
@@ -137,7 +135,7 @@ final class DefaultClassAccessor<B>
     public ArgumentsAccessor invokeExactStatic( String methodName )
     {
         methodName = checkNotNull( methodName, "Impossible to execute null static method
in %s", beanClass );
-        return new DefaultArgumentsAccessor( beanClass.getRawType(), true, methodName, null
);
+        return new DefaultArgumentsAccessor( beanClass, true, methodName, null );
     }
 
 }

Modified: commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassLoaderBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassLoaderBuilder.java?rev=1243713&r1=1243712&r2=1243713&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassLoaderBuilder.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultClassLoaderBuilder.java
Mon Feb 13 22:03:01 2012
@@ -20,9 +20,6 @@ package org.apache.commons.beanutils2;
  */
 
 import static java.lang.Thread.currentThread;
-
-import org.apache.commons.beanutils2.type.TypeLiteral;
-
 import static org.apache.commons.beanutils2.internal.Assertions.checkNotNull;
 
 final class DefaultClassLoaderBuilder
@@ -65,7 +62,7 @@ final class DefaultClassLoaderBuilder
         Class<?> beanType = classLoader.loadClass( beanTypeName );
 
         @SuppressWarnings( { "rawtypes", "unchecked" } ) // ClassAccessor raw type is unknown
-        DefaultClassAccessor<?> accessor = new DefaultClassAccessor( TypeLiteral.get(beanType
) );
+        DefaultClassAccessor<?> accessor = new DefaultClassAccessor( beanType );
         return accessor;
     }
 

Modified: commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/ConstructorsTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/ConstructorsTestCase.java?rev=1243713&r1=1243712&r2=1243713&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/ConstructorsTestCase.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/ConstructorsTestCase.java
Mon Feb 13 22:03:01 2012
@@ -24,7 +24,6 @@ import static org.apache.commons.beanuti
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import org.apache.commons.beanutils2.type.TypeLiteral;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
@@ -46,12 +45,12 @@ public class ConstructorsTestCase
         throws Exception
     {
         {
-            TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeConstructor( argument(
"TEST" ) ).get();
+            TestBean obj = on( TestBean.class ).invokeConstructor( argument( "TEST" ) ).get();
             assertNotNull( obj );
             assertEquals( "TEST", obj.getStringProperty() );
         }
         {
-            TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeConstructor( argument(
new Float( 17.3f ) ) ).get();
+            TestBean obj = on( TestBean.class ).invokeConstructor( argument( new Float( 17.3f
) ) ).get();
             assertNotNull( obj );
             assertEquals( 17.3f, obj.getFloatProperty(), 0.0f );
         }
@@ -61,26 +60,24 @@ public class ConstructorsTestCase
     public void invokeConstructorWithInvalidArgument()
         throws Exception
     {
-        TypeLiteral<TestBean> testBeanLiteral = new TypeLiteral<TestBean>(){};
-
         thrown.expect( NoSuchMethodException.class );
         thrown.expectMessage( "No such accessible constructor on class:" );
-        thrown.expectMessage( String.valueOf( testBeanLiteral ) );
-        on( testBeanLiteral ).invokeConstructor( argument( (byte) 6 ) ).get();
+        thrown.expectMessage( TestBean.class.getName() );
+        on( TestBean.class ).invokeConstructor( argument( (byte) 6 ) ).get();
     }
 
     @Test( expected = NullPointerException.class )
     public void invokeConstructorWithNull()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeConstructor( (Argument<?>)
null );
+        on( TestBean.class ).invokeConstructor( (Argument<?>) null );
     }
 
     @Test
     public void invokeConstructorWithArgArray()
         throws Exception
     {
-        TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeConstructor( argument(
new Float( 17.3f ) ), argument( "TEST" ) ).get();
+        TestBean obj = on( TestBean.class ).invokeConstructor( argument( new Float( 17.3f
) ), argument( "TEST" ) ).get();
         assertNotNull( obj );
         assertEquals( 17.3f, obj.getFloatProperty(), 0.0f );
         assertEquals( "TEST", obj.getStringProperty() );
@@ -90,19 +87,17 @@ public class ConstructorsTestCase
     public void invokeConstrucotrWithInvalidArgArray()
         throws Exception
     {
-        TypeLiteral<TestBean> testBeanLiteral = new TypeLiteral<TestBean>(){};
-
         thrown.expect( NoSuchMethodException.class );
         thrown.expectMessage( "No such accessible constructor on class:" );
-        thrown.expectMessage( String.valueOf( testBeanLiteral ) );
-        on( testBeanLiteral ).invokeConstructor( argument( (byte) 17 ), argument( "TEST"
) ).get();
+        thrown.expectMessage( TestBean.class.getName() );
+        on( TestBean.class ).invokeConstructor( argument( (byte) 17 ), argument( "TEST" )
).get();
     }
 
     @Test( expected = NullPointerException.class )
     public void invokeConstructorWithNullArray()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeConstructor( null, null, null );
+        on( TestBean.class ).invokeConstructor( null, null, null );
     }
 
     @Test
@@ -110,14 +105,14 @@ public class ConstructorsTestCase
         throws Exception
     {
         {
-            TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeConstructor( argument(
Boolean.TYPE, Boolean.TRUE ),
+            TestBean obj = on( TestBean.class ).invokeConstructor( argument( Boolean.TYPE,
Boolean.TRUE ),
                                                                    argument( String.class,
"TEST" ) ).get();
             assertNotNull( obj );
             assertEquals( true, obj.getBooleanProperty() );
             assertEquals( "TEST", obj.getStringProperty() );
         }
         {
-            TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeConstructor( argument(
Boolean.class, Boolean.TRUE ),
+            TestBean obj = on( TestBean.class ).invokeConstructor( argument( Boolean.class,
Boolean.TRUE ),
                                                                    argument( String.class,
"TEST" ) ).get();
             assertNotNull( obj );
             assertEquals( true, obj.isBooleanSecond() );
@@ -128,13 +123,11 @@ public class ConstructorsTestCase
     @Test
     public void invokeConstructorWithInvalidTypeArray() throws Exception
     {
-        TypeLiteral<TestBean> testBeanLiteral = new TypeLiteral<TestBean>(){};
-
         thrown.expect( NoSuchMethodException.class );
         thrown.expectMessage( "No such accessible constructor on class:" );
-        thrown.expectMessage( String.valueOf( testBeanLiteral ) );
-        on( testBeanLiteral ).invokeConstructor( argument( String.class, "TEST" ),
-                                                 argument( Boolean.TYPE, Boolean.TRUE )).get();
+        thrown.expectMessage( TestBean.class.getName() );
+        on( TestBean.class ).invokeConstructor( argument( String.class, "TEST" ),
+                                                argument( Boolean.TYPE, Boolean.TRUE )).get();
     }
 
     @Test
@@ -142,12 +135,12 @@ public class ConstructorsTestCase
         throws Exception
     {
         {
-            TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeExactConstructor(
argument( "TEST" ) ).get();
+            TestBean obj = on( TestBean.class ).invokeExactConstructor( argument( "TEST"
) ).get();
             assertNotNull( obj );
             assertEquals( "TEST", obj.getStringProperty() );
         }
         {
-            TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeExactConstructor(
argument( Boolean.TRUE ) ).get();
+            TestBean obj = on( TestBean.class ).invokeExactConstructor( argument( Boolean.TRUE
) ).get();
             assertNotNull( obj );
 
             assertEquals( true, obj.isBooleanSecond() );
@@ -158,27 +151,25 @@ public class ConstructorsTestCase
     public void invokeExactConstructorWithInvalidArgument()
         throws Exception
     {
-        TypeLiteral<TestBean> testBeanLiteral = new TypeLiteral<TestBean>(){};
-
         thrown.expect( NoSuchMethodException.class );
         thrown.expectMessage( "No such accessible constructor on class:" );
-        thrown.expectMessage( String.valueOf( testBeanLiteral ) );
-        on( testBeanLiteral ).invokeExactConstructor( argument( new Float( 17.3f ) ) ).get();
+        thrown.expectMessage( TestBean.class.getName() );
+        on( TestBean.class ).invokeExactConstructor( argument( new Float( 17.3f ) ) ).get();
     }
 
     @Test( expected = NullPointerException.class )
     public void invokeExactConstructorWithNull()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeExactConstructor( (Argument<?>)
null );
+        on( TestBean.class ).invokeExactConstructor( (Argument<?>) null );
     }
 
     @Test
     public void invokeExactConstructorWithArgArray()
         throws Exception
     {
-        TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeExactConstructor(
argument( Boolean.TRUE ),
-                                                                                   argument(
"TEST" ) ).get();
+        TestBean obj = on( TestBean.class ).invokeExactConstructor( argument( Boolean.TRUE
),
+                                                                    argument( "TEST" ) ).get();
         assertNotNull( obj );
         assertEquals( true, obj.isBooleanSecond() );
         assertEquals( "TEST", obj.getStringProperty() );
@@ -187,19 +178,17 @@ public class ConstructorsTestCase
     @Test
     public void invokeExactConstructorWithInvalidArgArray() throws Exception
     {
-        TypeLiteral<TestBean> testBeanLiteral = new TypeLiteral<TestBean>(){};
-
         thrown.expect( NoSuchMethodException.class );
         thrown.expectMessage( "No such accessible constructor on class:" );
-        thrown.expectMessage( String.valueOf( testBeanLiteral ) );
-        on( testBeanLiteral ).invokeExactConstructor( argument( new Float( 17.3f ) ),argument(
"TEST" ) ).get();
+        thrown.expectMessage( TestBean.class.getName() );
+        on( TestBean.class ).invokeExactConstructor( argument( new Float( 17.3f ) ),argument(
"TEST" ) ).get();
     }
 
     @Test( expected = NullPointerException.class )
     public void invokeExactConstructorWithNullArray()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeExactConstructor( null, null, null
);
+        on( TestBean.class ).invokeExactConstructor( null, null, null );
     }
 
     @Test
@@ -207,21 +196,21 @@ public class ConstructorsTestCase
         throws Exception
     {
         {
-            TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeExactConstructor(
argument( Boolean.TYPE, Boolean.TRUE ),
+            TestBean obj = on( TestBean.class ).invokeExactConstructor( argument( Boolean.TYPE,
Boolean.TRUE ),
                                                                         argument( String.class,
"TEST" ) ).get();
             assertNotNull( obj );
             assertEquals( true, obj.getBooleanProperty() );
             assertEquals( "TEST", obj.getStringProperty() );
         }
         {
-            TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeExactConstructor(
argument( Boolean.class, Boolean.TRUE ),
+            TestBean obj = on( TestBean.class ).invokeExactConstructor( argument( Boolean.class,
Boolean.TRUE ),
                                                                         argument( String.class,
"TEST" ) ).get();
             assertNotNull( obj );
             assertEquals( true, obj.isBooleanSecond() );
             assertEquals( "TEST", obj.getStringProperty() );
         }
         {
-            TestBean obj = on( new TypeLiteral<TestBean>(){} ).invokeExactConstructor(
argument( Float.TYPE, new Float( 17.3f ) ),
+            TestBean obj = on( TestBean.class ).invokeExactConstructor( argument( Float.TYPE,
new Float( 17.3f ) ),
                                                                         argument( String.class,
"TEST" ) ).get();
             assertNotNull( obj );
 
@@ -233,13 +222,11 @@ public class ConstructorsTestCase
     @Test
     public void invokeExactConstructorWithInvalidTypeArray() throws Exception
     {
-        TypeLiteral<TestBean> testBeanLiteral = new TypeLiteral<TestBean>(){};
-
         thrown.expect( NoSuchMethodException.class );
         thrown.expectMessage( "No such accessible constructor on class:" );
-        thrown.expectMessage( String.valueOf( testBeanLiteral ) );
-        on( testBeanLiteral ).invokeExactConstructor( argument( Float.class, new Float( 17.3f
) ),
-                                                      argument( String.class, "TEST" ) ).get();
+        thrown.expectMessage( TestBean.class.getName() );
+        on( TestBean.class ).invokeExactConstructor( argument( Float.class, new Float( 17.3f
) ),
+                                                     argument( String.class, "TEST" ) ).get();
     }
 
 }

Modified: commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/StaticMethodsTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/StaticMethodsTestCase.java?rev=1243713&r1=1243712&r2=1243713&view=diff
==============================================================================
--- commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/StaticMethodsTestCase.java
(original)
+++ commons/sandbox/beanutils2/trunk/src/test/java/org/apache/commons/beanutils2/StaticMethodsTestCase.java
Mon Feb 13 22:03:01 2012
@@ -23,7 +23,6 @@ import static org.apache.commons.beanuti
 import static org.apache.commons.beanutils2.BeanUtils.on;
 import static org.junit.Assert.assertEquals;
 
-import org.apache.commons.beanutils2.type.TypeLiteral;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -53,7 +52,7 @@ public final class StaticMethodsTestCase
     public void invokeStaticMethodCurrentCounter()
         throws Exception
     {
-        Object value = on( new TypeLiteral<TestBean>(){} ).invokeStatic( "currentCounter"
).withArguments().get();
+        Object value = on( TestBean.class ).invokeStatic( "currentCounter" ).withArguments().get();
         assertEquals( "currentCounter value", oldValue, ( (Integer) value ).intValue() );
     }
 
@@ -61,7 +60,7 @@ public final class StaticMethodsTestCase
     public void invokeStaticMethodIncrementCounter()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeStatic( "incrementCounter" ).withArguments();
+        on( TestBean.class ).invokeStatic( "incrementCounter" ).withArguments();
         assertEquals( oldValue + 1, TestBean.currentCounter() );
     }
 
@@ -69,7 +68,7 @@ public final class StaticMethodsTestCase
     public void invokeStaticMethodIncrementCounterIntegerPrimitive()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeStatic( "incrementCounter" ).withArguments(
argument( 8  ) ).get();
+        on( TestBean.class ).invokeStatic( "incrementCounter" ).withArguments( argument(
8  ) ).get();
         assertEquals( oldValue + 8, TestBean.currentCounter() );
     }
 
@@ -77,7 +76,7 @@ public final class StaticMethodsTestCase
     public void invokeStaticMethodIncrementCounterIntegerWrapper()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeStatic( "incrementCounter" ).withArguments(
argument( new Integer( 8 ) ) ).get();
+        on( TestBean.class ).invokeStatic( "incrementCounter" ).withArguments( argument(
new Integer( 8 ) ) ).get();
         assertEquals( oldValue + 8, TestBean.currentCounter() );
     }
 
@@ -85,7 +84,7 @@ public final class StaticMethodsTestCase
     public void invokeStaticMethodIncrementCounterIntegerWrapperAsPrimitive()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeStatic( "incrementCounter" ).withArguments(
argument( int.class,
+        on( TestBean.class ).invokeStatic( "incrementCounter" ).withArguments( argument(
int.class,
                                                                                         
      new Integer( 8 ) ) ).get();
         assertEquals( oldValue + 8, TestBean.currentCounter() );
     }
@@ -94,7 +93,7 @@ public final class StaticMethodsTestCase
     public void invokeStaticMethodIncrementCounterNumberInteger()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeStatic( "incrementCounter" ).withArguments(
argument( Number.class,
+        on( TestBean.class ).invokeStatic( "incrementCounter" ).withArguments( argument(
Number.class,
                                                                                         
      new Integer( 8 ) ) ).get();
         // incrementCounter(Number) will multiply its input with 2
         assertEquals( oldValue + 8 * 2, TestBean.currentCounter() );
@@ -104,20 +103,18 @@ public final class StaticMethodsTestCase
     public void invokeStaticMethodWithInvalidArgument()
         throws Exception
     {
-        TypeLiteral<TestBean> testBeanLiteral = new TypeLiteral<TestBean>(){};
-
         String methodName = "incrementCounter";
         thrown.expect( NoSuchMethodException.class );
         thrown.expectMessage( "No such accessible method:" );
         thrown.expectMessage( methodName );
-        thrown.expectMessage( String.valueOf( testBeanLiteral ) );
-        on( testBeanLiteral ).invokeStatic( methodName ).withArguments( argument( 'x' ) );
+        thrown.expectMessage( TestBean.class.getName() );
+        on( TestBean.class ).invokeStatic( methodName ).withArguments( argument( 'x' ) );
     }
 
     @Test
     public void invokeExactStaticMethodIncrementCounter() throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeExactStatic( "incrementCounter" ).withArguments();
+        on( TestBean.class ).invokeExactStatic( "incrementCounter" ).withArguments();
         assertEquals( oldValue + 1, TestBean.currentCounter() );
     }
 
@@ -125,7 +122,7 @@ public final class StaticMethodsTestCase
     public void invokeExactStaticMethodIncrementIntegerPrimitive()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeExactStatic( "incrementCounter" ).withArguments(
argument( int.class, 8 ) ).get();
+        on( TestBean.class ).invokeExactStatic( "incrementCounter" ).withArguments( argument(
int.class, 8 ) ).get();
         assertEquals( oldValue + 8, TestBean.currentCounter() );
     }
 
@@ -133,15 +130,15 @@ public final class StaticMethodsTestCase
     public void invokeExactStaticMethodIncrementIntegerWrapper()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeExactStatic( "incrementCounter" ).withArguments(
argument( new Integer( 8 ) ) ).get();
+        on( TestBean.class ).invokeExactStatic( "incrementCounter" ).withArguments( argument(
new Integer( 8 ) ) ).get();
     }
 
     @Test
     public void invokeExactStaticMethodIncrementNumberInteger()
         throws Exception
     {
-        on( new TypeLiteral<TestBean>(){} ).invokeExactStatic( "incrementCounter" ).withArguments(
argument( Number.class,
-                                                                                        
                    new Integer( 8 ) ) ).get();
+        on( TestBean.class ).invokeExactStatic( "incrementCounter" ).withArguments( argument(
Number.class,
+                                                                                        
           new Integer( 8 ) ) ).get();
         // incrementCounter(Number) will multiply its input with 2
         assertEquals( oldValue + 2 * 8, TestBean.currentCounter() );
     }



Mime
View raw message