Author: ehillenius Date: Fri Oct 19 23:22:47 2007 New Revision: 586672 URL: http://svn.apache.org/viewvc?rev=586672&view=rev Log: added test for resource model that also tests that the model gets wrapped when you pass it into a component's constructor
Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage.html wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage.properties wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage_expected.html wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest.java Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage.html URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest%24TestPage.html?rev=586672&view=auto ============================================================================== --- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage.html (added) +++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage.html Fri Oct 19 23:22:47 2007 @@ -0,0 +1,5 @@ +<html> +<body> +<span wicket:id="testlabel">[a test]</span> +</body> +</html> \ No newline at end of file Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage.properties URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest%24TestPage.properties?rev=586672&view=auto ============================================================================== --- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage.properties (added) +++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage.properties Fri Oct 19 23:22:47 2007 @@ -0,0 +1 @@ +test.label=A test label from a resource bundle Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage_expected.html URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest%24TestPage_expected.html?rev=586672&view=auto ============================================================================== --- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage_expected.html (added) +++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest$TestPage_expected.html Fri Oct 19 23:22:47 2007 @@ -0,0 +1,5 @@ +<html> +<body> +<span wicket:id="testlabel">A test label from a resource bundle</span> +</body> +</html> \ No newline at end of file Added: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest.java URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest.java?rev=586672&view=auto ============================================================================== --- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest.java (added) +++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/model/ResourceModelTest.java Fri Oct 19 23:22:47 2007 @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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.wicket.model; + +import org.apache.wicket.WicketTestCase; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; + +/** + * Tests [EMAIL PROTECTED] ResourceModel}. + */ +public class ResourceModelTest extends WicketTestCase +{ + /** + * Test page. + */ + public static class TestPage extends WebPage + { + private static final long serialVersionUID = 1L; + + /** + * Construct. + */ + public TestPage() + { + add(new Label("testlabel", new ResourceModel("test.label"))); + } + } + + /** + * Construct. + */ + public ResourceModelTest() + { + } + + /** + * Construct. + * + * @param name + */ + public ResourceModelTest(String name) + { + super(name); + } + + /** + * Tests a simple [EMAIL PROTECTED] ResourceModel} on a test page. + * + * @throws Exception + */ + public void testResourceModel() throws Exception + { + executeTest(TestPage.class, "ResourceModelTest$TestPage_expected.html"); + } +}