You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2006/08/07 12:37:29 UTC

svn commit: r429295 [2/2] - in /tapestry/tapestry5/tapestry-core/trunk: ./ src/main/java/org/apache/tapestry/internal/annotations/ src/main/java/org/apache/tapestry/internal/ioc/ src/main/java/org/apache/tapestry/internal/ioc/services/ src/main/java/or...

Added: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/StringTransformer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/StringTransformer.java?rev=429295&view=auto
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/StringTransformer.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/ioc/StringTransformer.java Mon Aug  7 03:37:27 2006
@@ -0,0 +1,25 @@
+// Copyright 2006 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.ioc;
+
+/**
+ * Used by {@link org.apache.tapestry.ioc.IntegrationTest}.
+ * 
+ * @author Howard M. Lewis Ship
+ */
+public interface StringTransformer
+{
+    String transform(String input);
+}

Added: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/InfrastructureContributionTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/InfrastructureContributionTest.java?rev=429295&view=auto
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/InfrastructureContributionTest.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/services/InfrastructureContributionTest.java Mon Aug  7 03:37:27 2006
@@ -0,0 +1,56 @@
+// Copyright 2006 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.services;
+
+import org.apache.tapestry.test.TestBase;
+import org.testng.annotations.Test;
+
+/**
+ * @author Howard M. Lewis Ship
+ */
+public class InfrastructureContributionTest extends TestBase
+{
+    @Test
+    public void default_for_mode()
+    {
+        InfrastructureContribution ic = new InfrastructureContribution("fred", this);
+
+        assertEquals("fred", ic.getName());
+        assertEquals("", ic.getMode());
+        assertSame(ic.getObject(), this);
+    }
+
+    @Test
+    public void specific_mode()
+    {
+        InfrastructureContribution ic = new InfrastructureContribution("fred", "mode", this);
+
+        assertEquals("fred", ic.getName());
+        assertEquals("mode", ic.getMode());
+        assertSame(ic.getObject(), this);
+    }
+
+    @Test
+    public void to_string()
+    {
+        InfrastructureContribution ic = new InfrastructureContribution("fred", "FRED");
+
+        assertEquals(ic.toString(), "<InfrastructureContribution: fred FRED>");
+
+        ic = new InfrastructureContribution("fred", "servlet", "FRED");
+
+        assertEquals(ic.toString(), "<InfrastructureContribution: fred mode:servlet FRED>");
+    }
+}