You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2011/02/23 09:13:10 UTC

svn commit: r1073630 - in /wicket/trunk: wicket-core/src/test/java/org/apache/wicket/util/template/ wicket-util/src/main/java/org/apache/wicket/util/resource/

Author: mgrigorov
Date: Wed Feb 23 08:13:09 2011
New Revision: 1073630

URL: http://svn.apache.org/viewvc?rev=1073630&view=rev
Log:
WICKET-3187 StringResourceStream has null lastModified time

Simplify the initialization of 'lastModified' property of all string resource streams.


Added:
    wicket/trunk/wicket-core/src/test/java/org/apache/wicket/util/template/
    wicket/trunk/wicket-core/src/test/java/org/apache/wicket/util/template/CssTemplateTest.java
Modified:
    wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/resource/AbstractStringResourceStream.java

Added: wicket/trunk/wicket-core/src/test/java/org/apache/wicket/util/template/CssTemplateTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/test/java/org/apache/wicket/util/template/CssTemplateTest.java?rev=1073630&view=auto
==============================================================================
--- wicket/trunk/wicket-core/src/test/java/org/apache/wicket/util/template/CssTemplateTest.java (added)
+++ wicket/trunk/wicket-core/src/test/java/org/apache/wicket/util/template/CssTemplateTest.java Wed Feb 23 08:13:09 2011
@@ -0,0 +1,55 @@
+/*
+ * 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.util.template;
+
+import java.util.Map;
+
+import org.junit.Test;
+
+
+/**
+ * Test of {@link CssTemplate}
+ */
+public class CssTemplateTest
+{
+
+	/**
+	 * Test that a {@link CssTemplate} can be constructed without problems.
+	 * 
+	 * @see <a href="https://issues.apache.org/jira/browse/WICKET-3187">WICKET-3187</a>
+	 */
+	@Test
+	public void testSimpleConstructor()
+	{
+		new CssTemplate(new TextTemplate()
+		{
+			private static final long serialVersionUID = 1L;
+
+			@Override
+			public TextTemplate interpolate(Map<String, ?> variables)
+			{
+				return this;
+			}
+
+			@Override
+			public String getString()
+			{
+				return "";
+			}
+		});
+	}
+}

Modified: wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/resource/AbstractStringResourceStream.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/resource/AbstractStringResourceStream.java?rev=1073630&r1=1073629&r2=1073630&view=diff
==============================================================================
--- wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/resource/AbstractStringResourceStream.java (original)
+++ wicket/trunk/wicket-util/src/main/java/org/apache/wicket/util/resource/AbstractStringResourceStream.java Wed Feb 23 08:13:09 2011
@@ -73,7 +73,7 @@ public abstract class AbstractStringReso
 		// TODO null for contentType is allowed? or should the default be applied instead?
 		this.contentType = contentType;
 
-		setLastModified(Time.now());
+		lastModified = Time.now();
 	}
 
 	/**