tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r595970 [2/2] - in /tapestry/tapestry5/trunk/tapestry-ioc/src: main/java/org/apache/tapestry/ioc/internal/ main/java/org/apache/tapestry/ioc/test/ main/resources/org/apache/tapestry/ioc/internal/ main/resources/org/apache/tapestry/ioc/inter...
Date Sat, 17 Nov 2007 16:36:52 GMT
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/PropertyAccessImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/PropertyAccessImplTest.java?rev=595970&r1=595969&r2=595970&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/PropertyAccessImplTest.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/PropertyAccessImplTest.java
Sat Nov 17 08:36:50 2007
@@ -209,8 +209,8 @@
         }
         catch (IllegalArgumentException ex)
         {
-            assertEquals(ex.getMessage(), "Class " + CLASS_NAME + "$Bean does not "
-                    + "contain a property named 'zaphod'.");
+            assertEquals(ex.getMessage(),
+                         "Class " + CLASS_NAME + "$Bean does not " + "contain a property
named 'zaphod'.");
         }
     }
 
@@ -226,8 +226,8 @@
         }
         catch (UnsupportedOperationException ex)
         {
-            assertEquals(ex.getMessage(), "Class " + CLASS_NAME
-                    + "$Bean does not provide an mutator ('setter') method for property 'class'.");
+            assertEquals(ex.getMessage(),
+                         "Class " + CLASS_NAME + "$Bean does not provide an mutator ('setter')
method for property 'class'.");
         }
     }
 
@@ -243,11 +243,8 @@
         }
         catch (UnsupportedOperationException ex)
         {
-            assertEquals(
-                    ex.getMessage(),
-                    "Class "
-                            + CLASS_NAME
-                            + "$Bean does not provide an accessor ('getter') method for property
'writeOnly'.");
+            assertEquals(ex.getMessage(),
+                         "Class " + CLASS_NAME + "$Bean does not provide an accessor ('getter')
method for property 'writeOnly'.");
         }
     }
 
@@ -263,9 +260,7 @@
         }
         catch (RuntimeException ex)
         {
-            assertEquals(
-                    ex.getMessage(),
-                    "Error reading property 'failure' of PropertyUtilsExceptionBean: getFailure");
+            assertEquals(ex.getMessage(), "Error reading property 'failure' of PropertyUtilsExceptionBean:
getFailure");
         }
     }
 
@@ -281,9 +276,8 @@
         }
         catch (RuntimeException ex)
         {
-            assertEquals(
-                    ex.getMessage(),
-                    "Error updating property 'failure' of PropertyUtilsExceptionBean: setFailure");
+            assertEquals(ex.getMessage(),
+                         "Error updating property 'failure' of PropertyUtilsExceptionBean:
setFailure");
         }
     }
 
@@ -326,8 +320,8 @@
     {
         ClassPropertyAdapter cpa = _access.getAdapter(Bean.class);
 
-        assertEquals(cpa.toString(), "<ClassPropertyAdaptor " + CLASS_NAME
-                + "$Bean : class, readOnly, value, writeOnly>");
+        assertEquals(cpa.toString(),
+                     "<ClassPropertyAdaptor " + CLASS_NAME + "$Bean : class, readOnly,
value, writeOnly>");
     }
 
     @Test
@@ -379,11 +373,7 @@
     {
         ClassPropertyAdapter cpa = _access.getAdapter(Bean.class);
 
-        assertEquals(cpa.getPropertyNames(), Arrays.asList(
-                "class",
-                "readOnly",
-                "value",
-                "writeOnly"));
+        assertEquals(cpa.getPropertyNames(), Arrays.asList("class", "readOnly", "value",
"writeOnly"));
     }
 
     @Test
@@ -400,6 +390,8 @@
         pa.set(b, "value", value);
 
         assertEquals(b.getValue(), value);
+
+        registry.shutdown();
     }
 
     @Test
@@ -407,10 +399,7 @@
     {
         ClassPropertyAdapter cpa = _access.getAdapter(SubInterface.class);
 
-        assertEquals(cpa.getPropertyNames(), Arrays.asList(
-                "grandParentProperty",
-                "parentProperty",
-                "subProperty"));
+        assertEquals(cpa.getPropertyNames(), Arrays.asList("grandParentProperty", "parentProperty",
"subProperty"));
     }
 
     @Test
@@ -433,8 +422,7 @@
     @Test
     public void get_annotation_with_annotation_on_write_method()
     {
-        PropertyAdapter pa = _access.getAdapter(AnnotatedBean.class).getPropertyAdapter(
-                "annotationOnWrite");
+        PropertyAdapter pa = _access.getAdapter(AnnotatedBean.class).getPropertyAdapter("annotationOnWrite");
 
         Scope annotation = pa.getAnnotation(Scope.class);
         assertNotNull(annotation);
@@ -445,8 +433,7 @@
     @Test
     public void read_method_annotation_overrides_write_method_annotation()
     {
-        PropertyAdapter pa = _access.getAdapter(AnnotatedBean.class).getPropertyAdapter(
-                "annotationOnRead");
+        PropertyAdapter pa = _access.getAdapter(AnnotatedBean.class).getPropertyAdapter("annotationOnRead");
 
         Scope annotation = pa.getAnnotation(Scope.class);
         assertNotNull(annotation);

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/RegistryStartupTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/RegistryStartupTest.java?rev=595970&r1=595969&r2=595970&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/RegistryStartupTest.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/internal/services/RegistryStartupTest.java
Sat Nov 17 08:36:50 2007
@@ -109,10 +109,8 @@
         }
         catch (IllegalStateException ex)
         {
-            assertMessageContains(
-                    ex,
-                    "Method org.apache.tapestry.ioc.internal.services.RegistryStartup.run(",
-                    "may no longer be invoked.");
+            assertMessageContains(ex, "Method org.apache.tapestry.ioc.internal.services.RegistryStartup.run(",
+                                  "may no longer be invoked.");
 
         }
 
@@ -132,5 +130,7 @@
 
         // Ideally we'd have a way to show that the ThreadCleanupHub was notified after
         // RegistryStartup did its thing, but ...
+
+        r.shutdown();
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/services/PropertyShadowBuilderImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/services/PropertyShadowBuilderImplTest.java?rev=595970&r1=595969&r2=595970&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/services/PropertyShadowBuilderImplTest.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry/ioc/services/PropertyShadowBuilderImplTest.java
Sat Nov 17 08:36:50 2007
@@ -15,24 +15,35 @@
 package org.apache.tapestry.ioc.services;
 
 import org.apache.tapestry.ioc.Registry;
-import org.apache.tapestry.ioc.internal.IOCInternalTestCase;
+import org.apache.tapestry.ioc.test.IOCTestCase;
+import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 import java.util.Map;
 
-public class PropertyShadowBuilderImplTest extends IOCInternalTestCase
+public class PropertyShadowBuilderImplTest extends IOCTestCase
 {
+    private Registry _registry;
     private PropertyShadowBuilder _builder;
 
     private final String CLASS_NAME = getClass().getName();
 
     @BeforeClass
-    public void setupBuilder()
+    public void setup_registry()
     {
-        Registry registry = buildRegistry();
+        _registry = buildRegistry();
 
-        _builder = registry.getService("PropertyShadowBuilder", PropertyShadowBuilder.class);
+        _builder = _registry.getService("PropertyShadowBuilder", PropertyShadowBuilder.class);
+    }
+
+    @AfterClass
+    public void shutdown_registry()
+    {
+        _registry.shutdown();
+
+        _registry = null;
+        _builder = null;
     }
 
     public class FooHolder
@@ -113,8 +124,8 @@
         }
         catch (RuntimeException ex)
         {
-            assertEquals(ex.getMessage(), "Class " + CLASS_NAME
-                    + "$FooHolder does not contain a property named 'bar'.");
+            assertEquals(ex.getMessage(),
+                         "Class " + CLASS_NAME + "$FooHolder does not contain a property
named 'bar'.");
         }
     }
 
@@ -130,8 +141,8 @@
         }
         catch (RuntimeException ex)
         {
-            assertEquals(ex.getMessage(), "Property 'count' of class " + CLASS_NAME
-                    + "$FooHolder is of type int, which is not assignable to type java.util.Map.");
+            assertEquals(ex.getMessage(),
+                         "Property 'count' of class " + CLASS_NAME + "$FooHolder is of type
int, which is not assignable to type java.util.Map.");
         }
     }
 
@@ -147,11 +158,8 @@
         }
         catch (RuntimeException ex)
         {
-            assertEquals(
-                    ex.getMessage(),
-                    "Class "
-                            + CLASS_NAME
-                            + "$FooHolder does not provide an accessor ('getter') method
for property 'writeOnly'.");
+            assertEquals(ex.getMessage(),
+                         "Class " + CLASS_NAME + "$FooHolder does not provide an accessor
('getter') method for property 'writeOnly'.");
         }
     }
 }



Mime
View raw message