tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r569893 [3/6] - in /tapestry/tapestry5/trunk: ./ .settings/ quickstart/src/main/resources/archetype-resources/src/main/java/services/ src/site/ src/site/resources/ src/site/xdoc/ support/ tapestry-core/ tapestry-core/src/main/java/org/apach...
Date Sun, 26 Aug 2007 22:24:07 GMT
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/model/MutableComponentModelImplTest.java Sun Aug 26 15:23:55 2007
@@ -16,7 +16,6 @@
 
 import java.util.Arrays;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.TapestryConstants;
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.ioc.Location;
@@ -25,6 +24,7 @@
 import org.apache.tapestry.model.MutableComponentModel;
 import org.apache.tapestry.model.MutableEmbeddedComponentModel;
 import org.apache.tapestry.model.ParameterModel;
+import org.slf4j.Logger;
 import org.testng.annotations.Test;
 
 /**
@@ -41,15 +41,15 @@
     public void root_class_vs_sub_class()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         assertTrue(model.isRootClass());
 
-        MutableComponentModel subModel = new MutableComponentModelImpl(CLASS_NAME, log, r, model);
+        MutableComponentModel subModel = new MutableComponentModelImpl(CLASS_NAME, logger, r, model);
 
         assertFalse(subModel.isRootClass());
 
@@ -60,11 +60,11 @@
     public void add_new_parameter()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         assertTrue(model.getParameterNames().isEmpty());
 
@@ -95,11 +95,11 @@
     public void parameter_names_are_sorted()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         model.addParameter("fred", true, TapestryConstants.PROP_BINDING_PREFIX);
         model.addParameter("wilma", true, TapestryConstants.PROP_BINDING_PREFIX);
@@ -114,7 +114,7 @@
     public void declared_parameter_names_does_not_include_superclass_parameters()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
         ComponentModel parent = mockComponentModel();
 
         train_getPersistentFieldNames(parent);
@@ -122,7 +122,7 @@
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent);
 
         model.addParameter("fred", true, TapestryConstants.PROP_BINDING_PREFIX);
         model.addParameter("wilma", true, TapestryConstants.PROP_BINDING_PREFIX);
@@ -138,11 +138,11 @@
     public void add_duplicate_parameter()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         model.addParameter("fred", true, TapestryConstants.PROP_BINDING_PREFIX);
 
@@ -167,11 +167,11 @@
     public void get_parameter_by_name_with_no_parameters_defined()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         assertNull(model.getParameterModel("foo"));
 
@@ -182,11 +182,11 @@
     public void get_unknown_parameter()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
         model.addParameter("fred", true, TapestryConstants.PROP_BINDING_PREFIX);
 
         assertNull(model.getParameterModel("barney"));
@@ -198,12 +198,12 @@
     public void add_embedded()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
         Location l = mockLocation();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         assertTrue(model.getEmbeddedComponentIds().isEmpty());
 
@@ -244,11 +244,11 @@
     public void add_embedded_component_with_duplicate_id()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         model.addEmbeddedComponent("fred", "Fred1", COMPONENT_CLASS_NAME, null);
 
@@ -271,11 +271,11 @@
     public void add_embedded_is_case_insensitive()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         model.addEmbeddedComponent("fred", "Fred1", COMPONENT_CLASS_NAME, null);
 
@@ -298,11 +298,11 @@
     public void add_parameters_to_embedded()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         MutableEmbeddedComponentModel fred = model.addEmbeddedComponent(
                 "fred",
@@ -326,11 +326,11 @@
     public void add_duplicate_parameters_to_embedded()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         MutableEmbeddedComponentModel fred = model.addEmbeddedComponent(
                 "fred",
@@ -359,11 +359,11 @@
     public void mixin_names_is_initially_empty_list()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         MutableEmbeddedComponentModel fred = model.addEmbeddedComponent(
                 "fred",
@@ -380,11 +380,11 @@
     public void mixin_class_names_remembered_in_order_added()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         MutableEmbeddedComponentModel fred = model.addEmbeddedComponent(
                 "fred",
@@ -404,11 +404,11 @@
     public void mixin_name_conflict()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         MutableEmbeddedComponentModel fred = model.addEmbeddedComponent(
                 "fred",
@@ -441,11 +441,11 @@
     public void get_persistent_field_names_when_none_defined()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         assertTrue(model.getPersistentFieldNames().isEmpty());
 
@@ -456,11 +456,11 @@
     public void get_persistent_field_names_are_sorted()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         assertEquals(model.setFieldPersistenceStrategy("fred", "session"), "fred");
         assertEquals(model.setFieldPersistenceStrategy("barney", "client"), "barney");
@@ -474,11 +474,11 @@
     public void persistent_field_names_have_punctuation_stripped()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         assertEquals(model.setFieldPersistenceStrategy("_fred", "session"), "fred");
         assertEquals(model.setFieldPersistenceStrategy("_$barney", "client"), "barney");
@@ -492,15 +492,15 @@
     public void get_persistent_field_names_reflects_parent_model()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         assertEquals(parent.setFieldPersistenceStrategy("wilma", "session"), "wilma");
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent);
 
         assertEquals(model.setFieldPersistenceStrategy("fred", "session"), "fred");
         assertEquals(model.setFieldPersistenceStrategy("barney", "client"), "barney");
@@ -514,14 +514,14 @@
     public void persistent_field_names_allocated_in_subclasses_are_unique()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
         assertEquals(parent.setFieldPersistenceStrategy("wilma", "session"), "wilma");
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent);
 
         assertEquals(model.setFieldPersistenceStrategy("wilma", "session"), "wilma_0");
 
@@ -534,11 +534,11 @@
     public void get_persistent_field_defined_in_model()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         model.setFieldPersistenceStrategy("fred", "session");
         model.setFieldPersistenceStrategy("barney", "client");
@@ -553,11 +553,11 @@
     public void no_persistence_defined_for_field()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         try
         {
@@ -579,12 +579,12 @@
     public void get_persistent_field_defined_in_parent()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);
+        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent);
 
         parent.setFieldPersistenceStrategy("wilma", "parent");
 
@@ -599,11 +599,11 @@
     public void default_for_supports_informal_parameters_is_false()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         assertFalse(model.getSupportsInformalParameters());
 
@@ -618,10 +618,10 @@
     public void get_mixin_class_names_with_no_mixins()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
-        ComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        ComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         assertTrue(model.getMixinClassNames().isEmpty());
 
@@ -632,15 +632,15 @@
     public void get_mixin_class_names_mixes_with_parent_model()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         parent.addMixinClassName("Wilma");
 
-        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);
+        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent);
 
         child.addMixinClassName("Fred");
         child.addMixinClassName("Barney");
@@ -654,12 +654,12 @@
     public void get_parent_from_subclass()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
-        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);
+        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
+        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent);
 
         assertSame(child.getParentModel(), parent);
         assertNull(parent.getParentModel());
@@ -671,11 +671,11 @@
     public void set_and_get_meta()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
+        MutableComponentModel model = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
 
         model.setMeta("fred", "flintstone");
         model.setMeta("barney", "rubble");
@@ -695,12 +695,12 @@
     public void get_meta_from_parent()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
-        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);
+        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
+        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent);
 
         parent.setMeta("fred", "flintstone");
 
@@ -713,12 +713,12 @@
     public void parent_does_not_have_meta()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
-        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);
+        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
+        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent);
 
         parent.setMeta("fred", "flintstone");
 
@@ -731,12 +731,12 @@
     public void child_meta_overrides_parent_meta()
     {
         Resource r = mockResource();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, log, r, null);
-        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, log, r, parent);
+        MutableComponentModel parent = new MutableComponentModelImpl(CLASS_NAME, logger, r, null);
+        MutableComponentModel child = new MutableComponentModelImpl(CLASS_NAME, logger, r, parent);
 
         parent.setMeta("fred", "flintstone");
         child.setMeta("fred", "mcmurray");

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AliasManagerImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AliasManagerImplTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AliasManagerImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AliasManagerImplTest.java Sun Aug 26 15:23:55 2007
@@ -18,10 +18,10 @@
 import java.util.Collection;
 import java.util.Map;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.services.AliasContribution;
 import org.apache.tapestry.services.AliasManager;
+import org.slf4j.Logger;
 import org.testng.annotations.Test;
 
 public class AliasManagerImplTest extends InternalBaseTestCase
@@ -29,7 +29,7 @@
     @Test
     public void no_conflict()
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
         Runnable r = mockRunnable();
 
         replay();
@@ -39,7 +39,7 @@
                 AliasContribution.create(Runnable.class, r) };
         Collection<AliasContribution> configuration = Arrays.asList(contributions);
 
-        AliasManager manager = new AliasManagerImpl(log, configuration);
+        AliasManager manager = new AliasManagerImpl(logger, configuration);
 
         Map<Class, Object> map = manager.getAliasesForMode("foo");
 
@@ -53,10 +53,10 @@
     @Test
     public void first_entry_wins_on_conflict()
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
         Runnable r = mockRunnable();
 
-        log
+        logger
                 .error("Contribution FRED-CONFLICT (for type java.lang.String) conflicts with existing contribution FRED and has been ignored.");
 
         replay();
@@ -67,7 +67,7 @@
                 AliasContribution.create(Runnable.class, r) };
         Collection<AliasContribution> configuration = Arrays.asList(contributions);
 
-        AliasManager manager = new AliasManagerImpl(log, configuration);
+        AliasManager manager = new AliasManagerImpl(logger, configuration);
 
         Map<Class, Object> map = manager.getAliasesForMode("foo");
 
@@ -81,7 +81,7 @@
     @Test
     public void contributions_to_other_modes_are_ignored()
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
         Runnable r = mockRunnable();
 
         replay();
@@ -92,7 +92,7 @@
                 AliasContribution.create(Runnable.class, r) };
         Collection<AliasContribution> configuration = Arrays.asList(contributions);
 
-        AliasManager manager = new AliasManagerImpl(log, configuration);
+        AliasManager manager = new AliasManagerImpl(logger, configuration);
 
         Map<Class, Object> map = manager.getAliasesForMode("foo");
 
@@ -106,7 +106,7 @@
     @Test
     public void mode_specific_contribution_overrides_general_contribution()
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
         Runnable r = mockRunnable();
 
         replay();
@@ -117,7 +117,7 @@
                 AliasContribution.create(Runnable.class, r) };
         Collection<AliasContribution> configuration = Arrays.asList(contributions);
 
-        AliasManager manager = new AliasManagerImpl(log, configuration);
+        AliasManager manager = new AliasManagerImpl(logger, configuration);
 
         Map<Class, Object> map = manager.getAliasesForMode("BAR");
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ApplicationStateWorkerTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ApplicationStateWorkerTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ApplicationStateWorkerTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ApplicationStateWorkerTest.java Sun Aug 26 15:23:55 2007
@@ -19,7 +19,6 @@
 import javassist.Loader;
 import javassist.LoaderClassPath;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.annotations.ApplicationState;
 import org.apache.tapestry.internal.InternalComponentResources;
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
@@ -29,6 +28,7 @@
 import org.apache.tapestry.services.ApplicationStateManager;
 import org.apache.tapestry.services.ClassTransformation;
 import org.apache.tapestry.services.ComponentClassTransformWorker;
+import org.slf4j.Logger;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.Test;
 
@@ -67,7 +67,7 @@
     public void field_read_and_write() throws Exception
     {
         ApplicationStateManager manager = newApplicationStateManager();
-        Log log = mockLog();
+        Logger logger = mockLogger();
         MutableComponentModel model = mockMutableComponentModel();
         InternalComponentResources resources = mockInternalComponentResources();
 
@@ -84,7 +84,7 @@
 
         CtClass ctClass = pool.get(componentClassName);
         InternalClassTransformation transformation = new InternalClassTransformationImpl(ctClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         replay();
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentInstanceResultProcessorTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentInstanceResultProcessorTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentInstanceResultProcessorTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentInstanceResultProcessorTest.java Sun Aug 26 15:23:55 2007
@@ -14,7 +14,6 @@
 
 package org.apache.tapestry.internal.services;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.ComponentResources;
 import org.apache.tapestry.Link;
 import org.apache.tapestry.internal.structure.Page;
@@ -22,6 +21,7 @@
 import org.apache.tapestry.runtime.Component;
 import org.apache.tapestry.services.ComponentEventResultProcessor;
 import org.apache.tapestry.services.Response;
+import org.slf4j.Logger;
 import org.testng.annotations.Test;
 
 public class ComponentInstanceResultProcessorTest extends InternalBaseTestCase
@@ -38,7 +38,7 @@
         Component result = mockComponent();
         Component source = mockComponent();
         ComponentResources resources = mockComponentResources();
-        Log log = mockLog();
+        Logger logger = mockLogger();
         RequestPageCache cache = mockRequestPageCache();
         Page page = mockPage();
         LinkFactory factory = mockLinkFactory();
@@ -59,7 +59,7 @@
         replay();
 
         ComponentEventResultProcessor<Component> processor = new ComponentInstanceResultProcessor(
-                cache, factory, log);
+                cache, factory, logger);
 
         processor.processComponentEvent(result, source, METHOD_DESCRIPTION).sendClientResponse(
                 response);
@@ -72,12 +72,10 @@
     {
         Component value = mockComponent();
         Component source = mockComponent();
-        Component root = mockComponent();
         Component containerResources = mockComponent();
-        ComponentResources rootResources = mockComponentResources();
         ComponentResources valueResources = mockComponentResources();
         ComponentResources sourceResources = mockComponentResources();
-        Log log = mockLog();
+        Logger logger = mockLogger();
         RequestPageCache cache = mockRequestPageCache();
         Page page = mockPage();
         LinkFactory factory = mockLinkFactory();
@@ -92,7 +90,7 @@
         train_getCompleteId(sourceResources, PAGE_NAME + ":source");
         train_getCompleteId(valueResources, PAGE_NAME + ":child");
 
-        log
+        logger
                 .warn("Method foo.bar.Baz.biff() (for component Zoop:source) returned component Zoop:child, which is not a page component. The page containing the component will render the client response.");
 
         train_getPageName(valueResources, PAGE_NAME);
@@ -106,7 +104,7 @@
         replay();
 
         ComponentEventResultProcessor<Component> processor = new ComponentInstanceResultProcessor(
-                cache, factory, log);
+                cache, factory, logger);
 
         processor.processComponentEvent(value, source, METHOD_DESCRIPTION).sendClientResponse(
                 response);

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentInstantiatorSourceImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentInstantiatorSourceImplTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentInstantiatorSourceImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentInstantiatorSourceImplTest.java Sun Aug 26 15:23:55 2007
@@ -29,7 +29,6 @@
 import javassist.LoaderClassPath;
 import javassist.NotFoundException;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.internal.InternalComponentResources;
 import org.apache.tapestry.internal.InternalConstants;
 import org.apache.tapestry.internal.SingleKeySymbolProvider;
@@ -46,6 +45,7 @@
 import org.apache.tapestry.ioc.services.SymbolProvider;
 import org.apache.tapestry.runtime.Component;
 import org.apache.tapestry.services.TapestryModule;
+import org.slf4j.Logger;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
@@ -78,12 +78,12 @@
     public void controlled_packages() throws Exception
     {
         ComponentClassTransformer transformer = newMock(ComponentClassTransformer.class);
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         ComponentInstantiatorSourceImpl e = new ComponentInstantiatorSourceImpl(_contextLoader,
-                transformer, log);
+                transformer, logger);
 
         assertEquals(e.inControlledPackage("foo.bar.Baz"), false);
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/InternalClassTransformationImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/InternalClassTransformationImplTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/InternalClassTransformationImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/InternalClassTransformationImplTest.java Sun Aug 26 15:23:55 2007
@@ -32,7 +32,6 @@
 import javassist.LoaderClassPath;
 import javassist.NotFoundException;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.annotations.Meta;
 import org.apache.tapestry.annotations.OnEvent;
 import org.apache.tapestry.annotations.Retain;
@@ -58,6 +57,7 @@
 import org.apache.tapestry.services.ClassTransformation;
 import org.apache.tapestry.services.MethodFilter;
 import org.apache.tapestry.services.MethodSignature;
+import org.slf4j.Logger;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
@@ -121,11 +121,11 @@
     @Test
     public void new_member_name() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ParentClass.class, log);
+        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);
 
         assertEquals(ct.newMemberName("fred"), "_$fred");
         assertEquals(ct.newMemberName("fred"), "_$fred_0");
@@ -150,11 +150,11 @@
     @Test
     public void new_member_name_with_prefix() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ParentClass.class, log);
+        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);
 
         assertEquals(ct.newMemberName("prefix", "fred"), "_$prefix_fred");
         assertEquals(ct.newMemberName("prefix", "fred"), "_$prefix_fred_0");
@@ -169,22 +169,22 @@
         verify();
     }
 
-    private InternalClassTransformation createClassTransformation(Class targetClass, Log log)
+    private InternalClassTransformation createClassTransformation(Class targetClass, Logger logger)
             throws NotFoundException
     {
         CtClass ctClass = findCtClass(targetClass);
 
-        return new InternalClassTransformationImpl(ctClass, _contextClassLoader, log, null);
+        return new InternalClassTransformationImpl(ctClass, _contextClassLoader, logger, null);
     }
 
     @Test
     public void find_annotation_on_unknown_field() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ParentClass.class, log);
+        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);
 
         try
         {
@@ -204,11 +204,11 @@
     @Test
     public void find_field_annotation() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ParentClass.class, log);
+        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);
 
         Retain retain = ct.getFieldAnnotation("_annotatedField", Retain.class);
 
@@ -220,11 +220,11 @@
     @Test
     public void field_does_not_contain_requested_annotation() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ParentClass.class, log);
+        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);
 
         // Field with annotations, but not that annotation
         assertNull(ct.getFieldAnnotation("_annotatedField", Override.class));
@@ -238,11 +238,11 @@
     @Test
     public void find_fields_with_annotation() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ParentClass.class, log);
+        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);
 
         List<String> fields = ct.findFieldsWithAnnotation(Retain.class);
 
@@ -255,11 +255,11 @@
     @Test
     public void find_fields_of_type() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(FindFieldClass.class, log);
+        ClassTransformation ct = createClassTransformation(FindFieldClass.class, logger);
 
         checkFindFields(ct, "boolean", "_booleanValue");
         checkFindFields(ct, "int[]", "_intArrayValue");
@@ -272,11 +272,11 @@
     @Test
     public void get_field_modifiers() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(CheckFieldType.class, log);
+        ClassTransformation ct = createClassTransformation(CheckFieldType.class, logger);
 
         assertEquals(ct.getFieldModifiers("_privateField"), Modifier.PRIVATE);
         assertEquals(ct.getFieldModifiers("_map"), Modifier.PRIVATE + Modifier.FINAL);
@@ -285,11 +285,11 @@
     @Test
     public void get_field_exists() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(CheckFieldType.class, log);
+        ClassTransformation ct = createClassTransformation(CheckFieldType.class, logger);
 
         assertTrue(ct.isField("_privateField"));
         assertFalse(ct.isField("_doesNotExist"));
@@ -300,11 +300,11 @@
     @Test
     public void find_fields_of_type_excludes_claimed_fields() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(FindFieldClass.class, log);
+        ClassTransformation ct = createClassTransformation(FindFieldClass.class, logger);
 
         ct.claimField("_booleanValue", this);
 
@@ -323,11 +323,11 @@
     @Test
     public void find_fields_with_annotation_excludes_claimed_files() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ParentClass.class, log);
+        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);
 
         ct.claimField("_annotatedField", this);
 
@@ -341,11 +341,11 @@
     @Test
     public void no_fields_contain_requested_annotation() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ParentClass.class, log);
+        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);
 
         List<String> fields = ct.findFieldsWithAnnotation(Documented.class);
 
@@ -357,11 +357,11 @@
     @Test
     public void claim_fields() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ClaimedFields.class, log);
+        ClassTransformation ct = createClassTransformation(ClaimedFields.class, logger);
 
         List<String> unclaimed = ct.findUnclaimedFields();
 
@@ -391,11 +391,11 @@
     @Test
     public void added_fields_are_not_listed_as_unclaimed_fields() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ClaimedFields.class, log);
+        ClassTransformation ct = createClassTransformation(ClaimedFields.class, logger);
 
         ct.addField(Modifier.PRIVATE, "int", "newField");
 
@@ -409,11 +409,11 @@
     @Test
     public void find_class_annotations() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ParentClass.class, log);
+        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);
 
         Meta meta = ct.getAnnotation(Meta.class);
 
@@ -440,11 +440,13 @@
         // The Java runtime does honor @Inherited
         assertNotNull(ChildClassInheritsAnnotation.class.getAnnotation(InheritedAnnotation.class));
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ChildClassInheritsAnnotation.class, log);
+        ClassTransformation ct = createClassTransformation(
+                ChildClassInheritsAnnotation.class,
+                logger);
 
         InheritedAnnotation ia = ct.getAnnotation(InheritedAnnotation.class);
 
@@ -524,12 +526,12 @@
 
         CtClass targetObjectCtClass = findCtClass(TargetObject.class);
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         InternalClassTransformation ct = new InternalClassTransformationImpl(targetObjectCtClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         // Default behavior is to add an injected field for the InternalComponentResources object,
         // so we'll just check that.
@@ -556,12 +558,12 @@
 
         CtClass targetObjectCtClass = findCtClass(TargetObject.class);
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         InternalClassTransformation ct = new InternalClassTransformationImpl(targetObjectCtClass,
-                _loader, log, null);
+                _loader, logger, null);
 
         String parentFieldName = ct.addInjectedField(String.class, "_value", value);
 
@@ -579,7 +581,7 @@
 
         CtClass subclassCtClass = findCtClass(TargetObjectSubclass.class);
 
-        ct = new InternalClassTransformationImpl(subclassCtClass, ct, _loader, log, null);
+        ct = new InternalClassTransformationImpl(subclassCtClass, ct, _loader, logger, null);
 
         String subclassFieldName = ct.addInjectedField(String.class, "_childValue", value);
 
@@ -612,12 +614,12 @@
     {
         CtClass ctClass = findCtClass(BasicComponent.class);
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         InternalClassTransformation ct = new InternalClassTransformationImpl(ctClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         _classPool.toClass(ctClass, _loader);
 
@@ -643,12 +645,12 @@
 
         CtClass targetObjectCtClass = findCtClass(TargetObject.class);
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         InternalClassTransformation ct = new InternalClassTransformationImpl(targetObjectCtClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         ct.addImplementedInterface(FooInterface.class);
         ct.addImplementedInterface(GetterMethodsInterface.class);
@@ -689,14 +691,14 @@
     {
         InternalComponentResources resources = mockInternalComponentResources();
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         CtClass targetObjectCtClass = findCtClass(ReadOnlyBean.class);
 
         InternalClassTransformation ct = new InternalClassTransformationImpl(targetObjectCtClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         ct.makeReadOnly("_value");
 
@@ -728,14 +730,14 @@
     @Test
     public void removed_fields_should_not_show_up_as_unclaimed() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         CtClass targetObjectCtClass = findCtClass(RemoveFieldBean.class);
 
         InternalClassTransformation ct = new InternalClassTransformationImpl(targetObjectCtClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         ct.removeField("_barney");
 
@@ -749,14 +751,14 @@
     {
         InternalComponentResources resources = mockInternalComponentResources();
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         CtClass targetObjectCtClass = findCtClass(ReadOnlyBean.class);
 
         InternalClassTransformation ct = new InternalClassTransformationImpl(targetObjectCtClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         ct.extendConstructor("_value = \"from constructor\";");
 
@@ -778,14 +780,14 @@
     {
         InternalComponentResources resources = mockInternalComponentResources();
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         CtClass targetObjectCtClass = findCtClass(ReadOnlyBean.class);
 
         InternalClassTransformation ct = new InternalClassTransformationImpl(targetObjectCtClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         ct.injectField("_value", "Tapestry");
 
@@ -825,14 +827,14 @@
     {
         InternalComponentResources resources = mockInternalComponentResources();
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         CtClass targetObjectCtClass = findCtClass(FieldAccessBean.class);
 
         InternalClassTransformation ct = new InternalClassTransformationImpl(targetObjectCtClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         replaceAccessToField(ct, "foo");
         replaceAccessToField(ct, "bar");
@@ -911,11 +913,11 @@
     @Test
     public void find_methods_with_annotation() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(AnnotatedPage.class, log);
+        ClassTransformation ct = createClassTransformation(AnnotatedPage.class, logger);
 
         List<MethodSignature> l = ct.findMethodsWithAnnotation(SetupRender.class);
 
@@ -939,11 +941,11 @@
     @Test
     public void find_methods_using_filter() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        final ClassTransformation ct = createClassTransformation(AnnotatedPage.class, log);
+        final ClassTransformation ct = createClassTransformation(AnnotatedPage.class, logger);
 
         // Duplicates, somewhat less efficiently, the logic in find_methods_with_annotation().
 
@@ -977,11 +979,11 @@
     @Test
     public void to_class_with_primitive_type() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(AnnotatedPage.class, log);
+        ClassTransformation ct = createClassTransformation(AnnotatedPage.class, logger);
 
         assertSame(ct.toClass("float"), Float.class);
 
@@ -991,11 +993,11 @@
     @Test
     public void to_class_with_object_type() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(AnnotatedPage.class, log);
+        ClassTransformation ct = createClassTransformation(AnnotatedPage.class, logger);
 
         assertSame(ct.toClass("java.util.Map"), Map.class);
 
@@ -1005,16 +1007,14 @@
     @Test
     public void non_private_fields_log_an_error() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
-        log.error(ServicesMessages.nonPrivateFields(VisibilityBean.class.getName(), Arrays.asList(
-                "_$myPackagePrivate",
-                "_$myProtected",
-                "_$myPublic")));
+        logger.error(ServicesMessages.nonPrivateFields(VisibilityBean.class.getName(), Arrays
+                .asList("_$myPackagePrivate", "_$myProtected", "_$myPublic")));
 
         replay();
 
-        InternalClassTransformation ct = createClassTransformation(VisibilityBean.class, log);
+        InternalClassTransformation ct = createClassTransformation(VisibilityBean.class, logger);
 
         List<String> names = ct.findFieldsWithAnnotation(Retain.class);
 
@@ -1039,11 +1039,11 @@
     @Test
     public void find_annotation_in_method() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(EventHandlerTarget.class, log);
+        ClassTransformation ct = createClassTransformation(EventHandlerTarget.class, logger);
 
         OnEvent annotation = ct.getMethodAnnotation(new MethodSignature("handler"), OnEvent.class);
 
@@ -1058,11 +1058,11 @@
     @Test
     public void find_annotation_in_unknown_method() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(ParentClass.class, log);
+        ClassTransformation ct = createClassTransformation(ParentClass.class, logger);
 
         try
         {
@@ -1082,14 +1082,14 @@
     @Test
     public void remove_field() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
         CtClass targetObjectCtClass = findCtClass(FieldRemoval.class);
 
         InternalClassTransformation ct = new InternalClassTransformationImpl(targetObjectCtClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         ct.removeField("_fieldToRemove");
 
@@ -1109,11 +1109,11 @@
     @Test
     public void get_method_identifier() throws Exception
     {
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         replay();
 
-        ClassTransformation ct = createClassTransformation(MethodIdentifier.class, log);
+        ClassTransformation ct = createClassTransformation(MethodIdentifier.class, logger);
 
         List<MethodSignature> sigs = ct.findMethodsWithAnnotation(OnEvent.class);
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageLoaderImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageLoaderImplTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageLoaderImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageLoaderImplTest.java Sun Aug 26 15:23:55 2007
@@ -17,7 +17,6 @@
 import java.util.Arrays;
 import java.util.Locale;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.internal.InternalComponentResources;
 import org.apache.tapestry.internal.parser.ComponentTemplate;
 import org.apache.tapestry.internal.parser.EndElementToken;
@@ -30,6 +29,7 @@
 import org.apache.tapestry.model.ComponentModel;
 import org.apache.tapestry.model.EmbeddedComponentModel;
 import org.apache.tapestry.services.ComponentClassResolver;
+import org.slf4j.Logger;
 import org.testng.annotations.Test;
 
 public class PageLoaderImplTest extends InternalBaseTestCase
@@ -51,7 +51,7 @@
         InternalComponentResources resources = mockInternalComponentResources();
         ComponentModel model = mockComponentModel();
         ComponentTemplate template = mockComponentTemplate();
-        Log log = mockLog();
+        Logger logger = mockLogger();
         ComponentClassResolver resolver = mockComponentClassResolver();
 
         train_resolvePageNameToClassName(resolver, LOGICAL_PAGE_NAME, PAGE_CLASS_NAME);
@@ -67,13 +67,13 @@
 
         train_isMissing(template, false);
 
-        train_getLog(model, log);
+        train_getLogger(model, logger);
 
         train_getEmbeddedIds(model, "foo", "bar", "baz");
 
         train_getComponentIds(template, "baz", "biff");
 
-        log.error(ServicesMessages.embeddedComponentsNotInTemplate(
+        logger.error(ServicesMessages.embeddedComponentsNotInTemplate(
                 Arrays.asList("foo", "bar"),
                 PAGE_CLASS_NAME));
 
@@ -100,7 +100,7 @@
         ComponentModel model = mockComponentModel();
         ComponentModel childModel = mockComponentModel();
         ComponentTemplate template = mockComponentTemplate();
-        Log log = mockLog();
+        Logger logger = mockLogger();
         EmbeddedComponentModel emodel = mockEmbeddedComponentModel();
         ComponentPageElement childElement = mockComponentPageElement();
         InternalComponentResources childResources = mockInternalComponentResources();
@@ -121,7 +121,7 @@
 
         train_isMissing(template, false);
 
-        train_getLog(model, log);
+        train_getLogger(model, logger);
 
         train_getEmbeddedIds(model, "foo");
 
@@ -138,7 +138,7 @@
 
         train_getMixinClassNames(emodel);
 
-        log.error(ServicesMessages.compTypeConflict("foo", "Fred", "Barney"));
+        logger.error(ServicesMessages.compTypeConflict("foo", "Fred", "Barney"));
 
         train_getComponentClassName(emodel, "foo.components.Barney");
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PagePoolImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PagePoolImplTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PagePoolImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PagePoolImplTest.java Sun Aug 26 15:23:55 2007
@@ -14,14 +14,15 @@
 
 package org.apache.tapestry.internal.services;
 
+import static org.easymock.EasyMock.contains;
+
 import java.util.Locale;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.internal.structure.Page;
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.ioc.services.ThreadLocale;
 import org.apache.tapestry.services.ComponentClassResolver;
-import org.easymock.EasyMock;
+import org.slf4j.Logger;
 import org.testng.annotations.Test;
 
 public class PagePoolImplTest extends InternalBaseTestCase
@@ -30,8 +31,6 @@
 
     private static final String LOGICAL_PAGE_NAME = "MyPage";
 
-    private static final String PAGE_NAME = "com.foo.pages.MyPage";
-
     // This will change once we start supporting application localization.
 
     private final Locale _locale = Locale.getDefault();
@@ -43,7 +42,7 @@
         Page page = mockPage();
         ThreadLocale tl = mockThreadLocale();
         ComponentClassResolver resolver = mockComponentClassResolver();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         train_canonicalizePageName(resolver, INPUT_PAGE_NAME, LOGICAL_PAGE_NAME);
 
@@ -53,7 +52,7 @@
 
         replay();
 
-        PagePool pool = new PagePoolImpl(log, loader, tl, resolver);
+        PagePool pool = new PagePoolImpl(logger, loader, tl, resolver);
 
         assertSame(page, pool.checkout(INPUT_PAGE_NAME));
 
@@ -66,7 +65,7 @@
         Page page1 = mockPage();
         Page page2 = mockPage();
         PageLoader loader = mockPageLoader();
-        Log log = mockLog();
+        Logger logger = mockLogger();
         ThreadLocale tl = mockThreadLocale();
         ComponentClassResolver resolver = mockComponentClassResolver();
 
@@ -78,7 +77,7 @@
 
         replay();
 
-        PagePool pool = new PagePoolImpl(log, loader, tl, resolver);
+        PagePool pool = new PagePoolImpl(logger, loader, tl, resolver);
 
         assertSame(pool.checkout(INPUT_PAGE_NAME), page1);
 
@@ -116,18 +115,18 @@
     {
         PageLoader loader = mockPageLoader();
         Page page = mockPage();
-        Log log = mockLog();
+        Logger logger = mockLogger();
 
         train_detached(page, true);
 
-        log.error(EasyMock.contains("is dirty, and will be discarded"));
+        logger.error(contains("is dirty, and will be discarded"));
 
         // The fact that we don't ask
         // the page for its name is our clue that it is not being cached.
 
         replay();
 
-        PagePool pool = new PagePoolImpl(log, loader, null, null);
+        PagePool pool = new PagePoolImpl(logger, loader, null, null);
 
         pool.release(page);
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ParameterWorkerTest.java Sun Aug 26 15:23:55 2007
@@ -19,7 +19,6 @@
 import javassist.Loader;
 import javassist.LoaderClassPath;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.Binding;
 import org.apache.tapestry.TapestryConstants;
 import org.apache.tapestry.internal.InternalComponentResources;
@@ -29,6 +28,7 @@
 import org.apache.tapestry.model.MutableComponentModel;
 import org.apache.tapestry.runtime.Component;
 import org.apache.tapestry.services.BindingSource;
+import org.slf4j.Logger;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.Test;
 
@@ -488,7 +488,7 @@
 
         Component component = setupForIntegrationTest(
                 resources,
-                mockLog(),
+                mockLogger(),
                 DefaultParameterComponent.class.getName(),
                 model,
                 source,
@@ -533,7 +533,7 @@
 
         Component component = setupForIntegrationTest(
                 resources,
-                mockLog(),
+                mockLogger(),
                 DefaultParameterBindingMethodComponent.class.getName(),
                 model,
                 source,
@@ -583,14 +583,14 @@
 
         return setupForIntegrationTest(
                 resources,
-                mockLog(),
+                mockLogger(),
                 ParameterComponent.class.getName(),
                 model,
                 mockBindingSource(),
                 phaseTwoTraining);
     }
 
-    private Component setupForIntegrationTest(InternalComponentResources resources, Log log,
+    private Component setupForIntegrationTest(InternalComponentResources resources, Logger logger,
             String componentClassName, MutableComponentModel model, BindingSource source,
             Runnable phaseTwoTraining) throws Exception
     {
@@ -604,7 +604,7 @@
 
         CtClass ctClass = pool.get(componentClassName);
         InternalClassTransformation transformation = new InternalClassTransformationImpl(ctClass,
-                _contextClassLoader, log, null);
+                _contextClassLoader, logger, null);
 
         replay();
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RenderQueueImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RenderQueueImplTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RenderQueueImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RenderQueueImplTest.java Sun Aug 26 15:23:55 2007
@@ -14,11 +14,11 @@
 
 package org.apache.tapestry.internal.services;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.MarkupWriter;
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.runtime.RenderCommand;
 import org.apache.tapestry.runtime.RenderQueue;
+import org.slf4j.Logger;
 import org.testng.annotations.Test;
 
 public class RenderQueueImplTest extends InternalBaseTestCase
@@ -35,11 +35,12 @@
             }
         };
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
         MarkupWriter writer = mockMarkupWriter();
-        RenderQueueImpl queue = new RenderQueueImpl(log);
+        RenderQueueImpl queue = new RenderQueueImpl(logger);
 
-        expect(log.isDebugEnabled()).andReturn(false).atLeastOnce();
+        train_isDebugEnabled(logger, false);
+        train_isDebugEnabled(logger, false);
 
         command2.render(writer, queue);
 
@@ -71,16 +72,16 @@
             }
         };
 
-        Log log = mockLog();
+        Logger logger = mockLogger();
         MarkupWriter writer = mockMarkupWriter();
 
-        expect(log.isDebugEnabled()).andReturn(false).atLeastOnce();
+        train_isDebugEnabled(logger, false);
 
-        log.error("Render queue error in FailedCommand: Oops.", t);
+        logger.error("Render queue error in FailedCommand: Oops.", t);
 
         replay();
 
-        RenderQueueImpl queue = new RenderQueueImpl(log);
+        RenderQueueImpl queue = new RenderQueueImpl(logger);
 
         queue.push(rc);
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RequestImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RequestImplTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RequestImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/RequestImplTest.java Sun Aug 26 15:23:55 2007
@@ -22,6 +22,7 @@
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.services.Request;
 import org.apache.tapestry.services.Session;
+import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 public class RequestImplTest extends InternalBaseTestCase
@@ -102,6 +103,32 @@
         }
 
         verify();
+    }
+
+    @Test(dataProvider = "xhr_inputs")
+    public void is_xhr_request(String headerValue, boolean expected)
+    {
+        HttpServletRequest sr = mockHttpServletRequest();
 
+        expect(sr.getHeader(RequestImpl.REQUESTED_WITH_HEADER)).andReturn(headerValue);
+
+        replay();
+
+        Request request = new RequestImpl(sr);
+
+        assertEquals(request.isXHR(), expected);
+
+        verify();
+    }
+
+    @DataProvider(name = "xhr_inputs")
+    public Object[][] xhr_inputs()
+    {
+        return new Object[][]
+        {
+        { null, false },
+        { "", false },
+        { "some other value", false },
+        { "XmlHttpRequest", true } };
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/structure/PageImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/structure/PageImplTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/structure/PageImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/structure/PageImplTest.java Sun Aug 26 15:23:55 2007
@@ -19,9 +19,9 @@
 
 import java.util.Locale;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.internal.test.InternalBaseTestCase;
 import org.apache.tapestry.runtime.PageLifecycleListener;
+import org.slf4j.Logger;
 import org.testng.annotations.Test;
 
 public class PageImplTest extends InternalBaseTestCase
@@ -99,17 +99,17 @@
     public void detach_dirty_if_listener_throws_exception()
     {
         ComponentPageElement element = mockComponentPageElement();
-        Log log = mockLog();
+        Logger logger = mockLogger();
         PageLifecycleListener listener1 = newPageLifecycle();
         PageLifecycleListener listener2 = newPageLifecycle();
         RuntimeException t = new RuntimeException("Listener detach exception.");
 
-        train_getLog(element, log);
+        train_getLogger(element, logger);
 
         listener1.containingPageDidDetach();
         setThrowable(t);
 
-        log.error(contains("failed during page detach"), same(t));
+        logger.error(contains("failed during page detach"), same(t));
 
         listener2.containingPageDidDetach();
 
@@ -127,9 +127,9 @@
 
     }
 
-    protected final void train_getLog(ComponentPageElement element, Log log)
+    protected final void train_getLogger(ComponentPageElement element, Logger logger)
     {
-        expect(element.getLog()).andReturn(log);
+        expect(element.getLogger()).andReturn(logger);
     }
 
     @Test

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/json/JSONObjectTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/json/JSONObjectTest.java?rev=569893&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/json/JSONObjectTest.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/json/JSONObjectTest.java Sun Aug 26 15:23:55 2007
@@ -0,0 +1,397 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.json;
+
+import java.util.Arrays;
+
+import org.testng.Assert;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+/**
+ * Tests JSONObject, particularily in terms of parsing and writing JSON streams.
+ */
+public class JSONObjectTest extends Assert
+{
+    @Test
+    public void copy_from_object_constructor()
+    {
+        JSONObject master = new JSONObject().put("fred", "flintstone").put("barney", "rubble");
+
+        JSONObject emptyCopy = new JSONObject(master);
+
+        assertTrue(emptyCopy.keys().isEmpty(), "No properties should have been copied.");
+
+        JSONObject limitedCopy = new JSONObject(master, "fred");
+
+        assertEquals(limitedCopy.keys().size(), 1);
+        assertEquals(limitedCopy.get("fred").toString(), "flintstone");
+
+        JSONObject fullCopy = new JSONObject(master, "fred", "barney");
+
+        assertEquals(fullCopy.toString(), "{\"fred\":\"flintstone\",\"barney\":\"rubble\"}");
+
+        JSONObject limitedCopy2 = new JSONObject(master, "fred", "wilma");
+        assertEquals(limitedCopy2.keys().size(), 1);
+    }
+
+    private void unreachable()
+    {
+        throw new AssertionError("This code should not be reachable.");
+    }
+
+    @Test
+    public void get_not_found()
+    {
+        JSONObject master = new JSONObject().put("fred", "flintstone");
+
+        assertEquals(master.get("fred"), "flintstone");
+
+        try
+        {
+            master.get("barney");
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(ex.getMessage(), "JSONObject[\"barney\"] not found.");
+        }
+    }
+
+    @Test(dataProvider = "boolean_inputs")
+    public void get_boolean(Object value, boolean expected)
+    {
+        JSONObject object = new JSONObject().put("mykey", value);
+
+        assertEquals(object.getBoolean("mykey"), expected);
+    }
+
+    @DataProvider(name = "boolean_inputs")
+    public Object[][] boolean_inputs()
+    {
+        return new Object[][]
+        {
+        { "true", true },
+        { "TRUE", true },
+        { "false", false },
+        { "FALSE", false },
+        { Boolean.TRUE, true },
+        { Boolean.FALSE, false } };
+    }
+
+    @Test
+    public void not_a_boolean_value()
+    {
+        JSONObject object = new JSONObject().put("somekey", 37);
+
+        try
+        {
+            object.getBoolean("somekey");
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(ex.getMessage(), "JSONObject[\"somekey\"] is not a Boolean.");
+        }
+    }
+
+    @Test
+    public void accumulate_simple_values()
+    {
+        JSONObject object = new JSONObject();
+
+        String key = "key";
+
+        object.accumulate(key, "alpha");
+        object.accumulate(key, "beta");
+        object.accumulate(key, "gamma");
+
+        assertEquals(object.toString(), "{\"key\":[\"alpha\",\"beta\",\"gamma\"]}");
+
+        JSONArray array = object.getJSONArray(key);
+
+        assertEquals(array.length(), 3);
+    }
+
+    @Test
+    public void accumulate_with_initial_array()
+    {
+        JSONArray array = new JSONArray();
+
+        array.put("alpha");
+
+        String key = "key";
+
+        JSONObject object = new JSONObject();
+
+        object.accumulate(key, array);
+        object.accumulate(key, "beta");
+
+        array.put("gamma");
+
+        assertEquals(object.toString(), "{\"key\":[\"alpha\",\"beta\",\"gamma\"]}");
+    }
+
+    @Test
+    public void object_from_string()
+    {
+        JSONObject object = new JSONObject(
+                "{ fred: \"flintstone\", caveman: true, friends: [\"barney\"] }");
+
+        assertEquals(object.get("fred"), "flintstone");
+        assertEquals(object.getBoolean("caveman"), true);
+
+        JSONArray array = object.getJSONArray("friends");
+
+        assertEquals(array.length(), 1);
+        assertEquals(array.get(0), "barney");
+    }
+
+    @Test
+    public void append()
+    {
+        JSONObject object = new JSONObject();
+        String key = "fubar";
+
+        object.append(key, "alpha");
+
+        assertEquals(object.toString(), "{\"fubar\":[\"alpha\"]}");
+
+        object.append(key, "beta");
+
+        assertEquals(object.toString(), "{\"fubar\":[\"alpha\",\"beta\"]}");
+    }
+
+    @Test
+    public void append_existng_key_not_an_array()
+    {
+        JSONObject object = new JSONObject();
+        String key = "fubar";
+
+        object.put(key, "existing");
+
+        try
+        {
+            object.append(key, "additional");
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(ex.getMessage(), "JSONObject[\"fubar\"] is not a JSONArray.");
+        }
+    }
+
+    @Test(dataProvider = "double_inputs")
+    public void double_to_string(double input, String expected)
+    {
+        String actual = JSONObject.doubleToString(input);
+
+        assertEquals(actual, expected);
+    }
+
+    @DataProvider(name = "double_inputs")
+    public Object[][] double_inputs()
+    {
+        return new Object[][]
+        {
+        { 3d, "3" },
+        { -22.5d, "-22.5" },
+        { 0d, "0" },
+        { Double.NEGATIVE_INFINITY, "null" },
+        { Double.POSITIVE_INFINITY, "null" },
+        { Double.NaN, "null" }, };
+    }
+
+    @Test(dataProvider = "get_double_inputs")
+    public void get_double(Object value, double expected)
+    {
+        JSONObject object = new JSONObject();
+
+        object.put("key", value);
+
+        assertEquals(object.getDouble("key"), expected);
+    }
+
+    @DataProvider(name = "get_double_inputs")
+    public Object[][] getDoubleInputs()
+    {
+        return new Object[][]
+        {
+        { new Double(3.5), 3.5d },
+        { new Long(1000), 1000d },
+        { "-101.7", -101.7d } };
+    }
+
+    @Test
+    public void get_double_not_a_string()
+    {
+        JSONObject object = new JSONObject();
+
+        object.put("notstring", Boolean.FALSE);
+
+        try
+        {
+            object.getDouble("notstring");
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(ex.getMessage(), "JSONObject[\"notstring\"] is not a number.");
+        }
+    }
+
+    @Test
+    public void get_double_string_invalid_format()
+    {
+        JSONObject object = new JSONObject();
+
+        object.put("badstring", "google");
+
+        try
+        {
+            object.getDouble("badstring");
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(ex.getMessage(), "JSONObject[\"badstring\"] is not a number.");
+        }
+    }
+
+    @Test(dataProvider = "get_int_inputs")
+    public void get_int(Object value, int expected)
+    {
+        JSONObject object = new JSONObject();
+
+        object.put("intkey", value);
+
+        assertEquals(object.getInt("intkey"), expected);
+    }
+
+    @DataProvider(name = "get_int_inputs")
+    public Object[][] get_int_inputs()
+    {
+        return new Object[][]
+        {
+        { "3", 3 },
+        { new Long(97), 97 },
+        { "-8.76", -8 } };
+    }
+
+    @Test
+    public void has()
+    {
+        JSONObject object = new JSONObject();
+
+        object.put("fred", "flintstone");
+
+        assertTrue(object.has("fred"));
+        assertFalse(object.has("barney"));
+    }
+
+    @Test
+    public void get_json_array()
+    {
+        JSONArray array = new JSONArray();
+
+        JSONObject object = new JSONObject();
+
+        object.put("arraykey", array);
+        object.put("boolkey", true);
+
+        assertSame(object.getJSONArray("arraykey"), array);
+
+        try
+        {
+            object.getJSONArray("boolkey");
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(ex.getMessage(), "JSONObject[\"boolkey\"] is not a JSONArray.");
+        }
+
+    }
+
+    @Test
+    public void get_json_object()
+    {
+        JSONObject child = new JSONObject();
+        JSONObject root = new JSONObject();
+
+        root.put("child", child);
+        root.put("boolkey", false);
+
+        assertSame(root.getJSONObject("child"), child);
+
+        try
+        {
+            root.getJSONObject("boolkey");
+            unreachable();
+        }
+        catch (RuntimeException ex)
+        {
+            assertEquals(ex.getMessage(), "JSONObject[\"boolkey\"] is not a JSONObject.");
+        }
+    }
+
+    @Test
+    public void length()
+    {
+        JSONObject object = new JSONObject();
+
+        assertEquals(object.length(), 0);
+
+        object.put("key", "fred");
+
+        assertEquals(object.length(), 1);
+
+        object.accumulate("key", "barney");
+        assertEquals(object.length(), 1);
+
+        object.put("key2", "wilma");
+
+        assertEquals(object.length(), 2);
+    }
+
+    @Test
+    public void names_is_null_if_no_properties()
+    {
+        JSONObject object = new JSONObject();
+
+        assertNull(object.names());
+    }
+
+    @Test
+    public void names()
+    {
+        JSONObject object = new JSONObject();
+
+        object.put("fred", "flintstone");
+        object.put("barney", "rubble");
+
+        JSONArray array = object.names();
+
+        assertEquals(array.length(), 2);
+
+        Object[] names = array.toArray();
+
+        Arrays.sort(names);
+
+        assertEquals(names, new String[]
+        { "barney", "fred" });
+
+    }
+}

Modified: tapestry/tapestry5/trunk/tapestry-hibernate/src/main/java/org/apache/tapestry/internal/hibernate/HibernateSessionSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-hibernate/src/main/java/org/apache/tapestry/internal/hibernate/HibernateSessionSourceImpl.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-hibernate/src/main/java/org/apache/tapestry/internal/hibernate/HibernateSessionSourceImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-hibernate/src/main/java/org/apache/tapestry/internal/hibernate/HibernateSessionSourceImpl.java Sun Aug 26 15:23:55 2007
@@ -16,19 +16,19 @@
 
 import java.util.Collection;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.hibernate.HibernateSessionSource;
 import org.apache.tapestry.internal.services.ClassNameLocator;
 import org.apache.tapestry.ioc.annotations.InjectService;
 import org.hibernate.Session;
 import org.hibernate.SessionFactory;
 import org.hibernate.cfg.AnnotationConfiguration;
+import org.slf4j.Logger;
 
 public class HibernateSessionSourceImpl implements HibernateSessionSource
 {
     private SessionFactory _sessionFactory;
 
-    public HibernateSessionSourceImpl(Log log, Collection<String> packageNames,
+    public HibernateSessionSourceImpl(Logger logger, Collection<String> packageNames,
 
     @InjectService("ClassNameLocator")
     ClassNameLocator classNameLocator)
@@ -67,10 +67,13 @@
 
         long factoryCreated = System.currentTimeMillis();
 
-        log.info(HibernateMessages.startupTiming(configurationComplete - startTime, factoryCreated
-                - startTime));
-
-        log.info(HibernateMessages.entityCatalog(_sessionFactory.getAllClassMetadata().keySet()));
+        logger.info(HibernateMessages.startupTiming(
+                configurationComplete - startTime,
+                factoryCreated - startTime));
+
+        logger
+                .info(HibernateMessages.entityCatalog(_sessionFactory.getAllClassMetadata()
+                        .keySet()));
 
     }
 

Modified: tapestry/tapestry5/trunk/tapestry-hibernate/src/test/java/org/apache/tapestry/internal/hibernate/HibernateSessionSourceImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-hibernate/src/test/java/org/apache/tapestry/internal/hibernate/HibernateSessionSourceImplTest.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-hibernate/src/test/java/org/apache/tapestry/internal/hibernate/HibernateSessionSourceImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-hibernate/src/test/java/org/apache/tapestry/internal/hibernate/HibernateSessionSourceImplTest.java Sun Aug 26 15:23:55 2007
@@ -16,17 +16,18 @@
 
 import java.util.Collection;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.tapestry.hibernate.HibernateSessionSource;
 import org.apache.tapestry.internal.services.ClassNameLocatorImpl;
 import org.apache.tapestry.ioc.internal.util.CollectionFactory;
 import org.apache.tapestry.test.TapestryTestCase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.testng.annotations.Test;
 
 public class HibernateSessionSourceImplTest extends TapestryTestCase
 {
-    private final Log _log = LogFactory.getLog("tapestry.hibernate.HibernateSessionSourceTest");
+    private final Logger _log = LoggerFactory
+            .getLogger("tapestry.hibernate.HibernateSessionSourceTest");
 
     @Test
     public void startup_without_packages()

Modified: tapestry/tapestry5/trunk/tapestry-ioc/pom.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/pom.xml?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/pom.xml (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/pom.xml Sun Aug 26 15:23:55 2007
@@ -19,10 +19,35 @@
       <groupId>jboss</groupId>
       <artifactId>javassist</artifactId>
     </dependency>
+
+    
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.4.3</version>
     </dependency>
+    
+    <!-- 0.00001% of applications will need to override this dependency to not use Log4J. -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>1.4.3</version>
+      <exclusions>
+        <!-- Exclude log4j to make sure we use the latest Log4J version. -->
+        <exclusion>
+          <artifactId>log4j</artifactId>
+          <groupId>log4j</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.14</version>
+    </dependency>
+    
+
     <!-- Override parent pom: needed at compile time. -->
     <dependency>
       <groupId>org.easymock</groupId>
@@ -38,10 +63,6 @@
       <version>5.1</version>
       <classifier>jdk15</classifier>
       <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
     </dependency>
   </dependencies>
   <build>

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/LogSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/LogSource.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/LogSource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/LogSource.java Sun Aug 26 15:23:55 2007
@@ -1,4 +1,4 @@
-// Copyright 2006 The Apache Software Foundation
+// Copyright 2006, 2007 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -12,21 +12,19 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.ioc;
-
-import org.apache.commons.logging.Log;
-
-/**
- * A wrapper around commons-logging's LogFactory that exists to allow particular projects to "hook"
- * the creation of Log instances.
- * 
- * 
- */
-public interface LogSource
-{
-    /** Creates or retrieves a log based on Class. This is rarely used in Tapestry IOC. */
-    Log getLog(Class clazz);
-
-    /** Creates or retrieves a log based on name. Typically, the name will be a service id. */
-    Log getLog(String name);
-}
+package org.apache.tapestry.ioc;
+
+import org.slf4j.Logger;
+
+/**
+ * A wrapper around SLF4J's LoggerFactory that exists to allow particular projects to "hook" the
+ * creation of Loggeer instances.
+ */
+public interface LogSource
+{
+    /** Creates or retrieves a log based on Class. This is rarely used in Tapestry IOC. */
+    Logger getLogger(Class clazz);
+
+    /** Creates or retrieves a log based on name. Typically, the name will be a service id. */
+    Logger getLogger(String name);
+}

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/RegistryBuilder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/RegistryBuilder.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/RegistryBuilder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/RegistryBuilder.java Sun Aug 26 15:23:55 2007
@@ -20,7 +20,6 @@
 import java.util.Arrays;
 import java.util.List;
 
-import org.apache.commons.logging.Log;
 import org.apache.tapestry.ioc.annotations.SubModule;
 import org.apache.tapestry.ioc.def.ModuleDef;
 import org.apache.tapestry.ioc.internal.DefaultModuleDefImpl;
@@ -31,6 +30,7 @@
 import org.apache.tapestry.ioc.internal.util.OneShotLock;
 import org.apache.tapestry.ioc.services.ClassFactory;
 import org.apache.tapestry.ioc.services.TapestryIOCModule;
+import org.slf4j.Logger;
 
 /**
  * Used to construct the IoC {@link org.apache.tapestry.ioc.Registry}. This class is <em>not</em>
@@ -45,7 +45,7 @@
 
     private final ClassLoader _classLoader;
 
-    private final Log _log;
+    private final Logger _logger;
 
     private final LogSource _logSource;
 
@@ -65,12 +65,12 @@
     {
         _classLoader = classLoader;
         _logSource = logSource;
-        _log = logSource.getLog(RegistryBuilder.class);
+        _logger = logSource.getLogger(RegistryBuilder.class);
 
         // Make the ClassFactory appear to be a service inside TapestryIOCModule, even before that
         // module exists.
 
-        Log classFactoryLog = logSource.getLog(TapestryIOCModule.class.getName() + ".ClassFactory");
+        Logger classFactoryLog = logSource.getLogger(TapestryIOCModule.class.getName() + ".ClassFactory");
 
         _classFactory = new ClassFactoryImpl(_classLoader, classFactoryLog);
 
@@ -96,7 +96,7 @@
         {
             Class c = queue.remove(0);
 
-            ModuleDef def = new DefaultModuleDefImpl(c, _log, _classFactory);
+            ModuleDef def = new DefaultModuleDefImpl(c, _logger, _classFactory);
             add(def);
 
             SubModule annotation = ((AnnotatedElement) c).getAnnotation(SubModule.class);
@@ -140,10 +140,10 @@
         return _classLoader;
     }
 
-    public Log getLog()
+    public Logger getLogger()
     {
         _lock.check();
 
-        return _log;
+        return _logger;
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/ServiceResources.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/ServiceResources.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/ServiceResources.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/ServiceResources.java Sun Aug 26 15:23:55 2007
@@ -14,7 +14,7 @@
 
 package org.apache.tapestry.ioc;
 
-import org.apache.commons.logging.Log;
+import org.slf4j.Logger;
 
 /**
  * Contains resources that may be provided to a service when it initializes, which includes other
@@ -30,10 +30,10 @@
     Class getServiceInterface();
 
     /**
-     * Returns a Log object appropriate for logging messages. This includes debug level messages
-     * about the creation and configuration of the underlying service, as well as debug, warning, or
-     * error level messages from the service itself. Often service interceptors will make use of the
-     * service's log.
+     * Returns a Logger appropriate for logging messages. This includes debug level messages about
+     * the creation and configuration of the underlying service, as well as debug, warning, or error
+     * level messages from the service itself. Often service interceptors will make use of the
+     * service's logger.
      */
-    Log getServiceLog();
+    Logger getLogger();
 }

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/def/ModuleDef.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/def/ModuleDef.java?rev=569893&r1=569892&r2=569893&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/def/ModuleDef.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/def/ModuleDef.java Sun Aug 26 15:23:55 2007
@@ -16,7 +16,7 @@
 
 import java.util.Set;
 
-import org.apache.commons.logging.Log;
+import org.slf4j.Logger;
 
 /**
  * Defines the contents of a module. In the default case, this is information about the services
@@ -54,8 +54,8 @@
     Class getBuilderClass();
 
     /**
-     * Returns the name used to create a {@link Log} instance. This is typically the builder class
+     * Returns the name used to create a {@link Logger} instance. This is typically the builder class
      * name.
      */
-    String getLogName();
+    String getLoggerName();
 }



Mime
View raw message