Author: jdonnerstag
Date: Thu Dec 10 21:52:17 2009
New Revision: 889434

URL: http://svn.apache.org/viewvc?rev=889434&view=rev
Log:
fixed: Inheritance layout excludes XML header from output
Issue: WICKET-2569

Added:
    
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/MergedMarkupTest.java
    
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithMarkup.html
    
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithMarkup.java
    
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithoutMarkup.java
    
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SuperPage.html
    
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SuperPage.java
Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java

Modified: 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java?rev=889434&r1=889433&r2=889434&view=diff
==============================================================================
--- 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java 
(original)
+++ 
wicket/trunk/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java 
Thu Dec 10 21:52:17 2009
@@ -63,6 +63,12 @@
 
                getMarkupResourceStream().setBaseMarkup(baseMarkup);
 
+               // Copy settings from derived markup
+               MarkupResourceStream baseResourceStream = 
baseMarkup.getMarkupResourceStream();
+               
getMarkupResourceStream().setXmlDeclaration(baseResourceStream.getXmlDeclaration());
+               
getMarkupResourceStream().setEncoding(baseResourceStream.getEncoding());
+               
getMarkupResourceStream().setWicketNamespace(baseResourceStream.getWicketNamespace());
+
                if (log.isDebugEnabled())
                {
                        String derivedResource = 
Strings.afterLast(markup.getMarkupResourceStream()

Added: 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/MergedMarkupTest.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/MergedMarkupTest.java?rev=889434&view=auto
==============================================================================
--- 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/MergedMarkupTest.java
 (added)
+++ 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/MergedMarkupTest.java
 Thu Dec 10 21:52:17 2009
@@ -0,0 +1,51 @@
+/*
+ * 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.markup.parser;
+
+import junit.framework.TestCase;
+
+import org.apache.wicket.Page;
+import org.apache.wicket.markup.MarkupStream;
+import org.apache.wicket.util.tester.WicketTester;
+
+/**
+ * 
+ */
+public class MergedMarkupTest extends TestCase
+{
+       public void test1()
+       {
+               WicketTester tester = new WicketTester();
+
+               Page page = new SubPageWithoutMarkup();
+               MarkupStream markup = page.getAssociatedMarkupStream(true);
+               assertEquals("<?xml version=\"1.0\" encoding=\"utf-8\"?>", 
markup.getXmlDeclaration());
+               assertEquals("utf-8", markup.getEncoding());
+               assertEquals("wicket", markup.getWicketNamespace());
+       }
+
+       public void test2()
+       {
+               WicketTester tester = new WicketTester();
+
+               Page page = new SubPageWithMarkup();
+               MarkupStream markup = page.getAssociatedMarkupStream(true);
+               assertEquals("<?xml version=\"1.0\" encoding=\"utf-8\"?>", 
markup.getXmlDeclaration());
+               assertEquals("utf-8", markup.getEncoding());
+               assertEquals("wicket", markup.getWicketNamespace());
+       }
+}

Added: 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithMarkup.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithMarkup.html?rev=889434&view=auto
==============================================================================
--- 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithMarkup.html
 (added)
+++ 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithMarkup.html
 Thu Dec 10 21:52:17 2009
@@ -0,0 +1,4 @@
+<?xml version="2.0" encoding="iso-8859-1"?>
+<wicket:extend>
+  This is the content!
+</wicket:extend>
\ No newline at end of file

Added: 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithMarkup.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithMarkup.java?rev=889434&view=auto
==============================================================================
--- 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithMarkup.java
 (added)
+++ 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithMarkup.java
 Thu Dec 10 21:52:17 2009
@@ -0,0 +1,21 @@
+/*
+ * 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.markup.parser;
+
+public class SubPageWithMarkup extends SuperPage
+{
+}

Added: 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithoutMarkup.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithoutMarkup.java?rev=889434&view=auto
==============================================================================
--- 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithoutMarkup.java
 (added)
+++ 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SubPageWithoutMarkup.java
 Thu Dec 10 21:52:17 2009
@@ -0,0 +1,21 @@
+/*
+ * 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.markup.parser;
+
+public class SubPageWithoutMarkup extends SuperPage
+{
+}

Added: 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SuperPage.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SuperPage.html?rev=889434&view=auto
==============================================================================
--- 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SuperPage.html
 (added)
+++ 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SuperPage.html
 Thu Dec 10 21:52:17 2009
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+<html>
+<body>
+Layout begin<p>
+<wicket:child></wicket:child>
+  </p>
+Layout end
+</body>
+</html>
\ No newline at end of file

Added: 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SuperPage.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SuperPage.java?rev=889434&view=auto
==============================================================================
--- 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SuperPage.java
 (added)
+++ 
wicket/trunk/wicket/src/test/java/org/apache/wicket/markup/parser/SuperPage.java
 Thu Dec 10 21:52:17 2009
@@ -0,0 +1,23 @@
+/*
+ * 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.markup.parser;
+
+import org.apache.wicket.markup.html.WebPage;
+
+public class SuperPage extends WebPage
+{
+}


Reply via email to