Repository: wicket
Updated Branches:
  refs/heads/wicket-8.x 5f52a24e5 -> 86f92fc8c


WICKET-6608 added test case

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/86f92fc8
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/86f92fc8
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/86f92fc8

Branch: refs/heads/wicket-8.x
Commit: 86f92fc8cfaf4ec15409908455d049f9466c542e
Parents: 5f52a24
Author: Andrea Del Bene <[email protected]>
Authored: Thu Nov 8 17:04:47 2018 +0100
Committer: Andrea Del Bene <[email protected]>
Committed: Thu Nov 8 17:05:15 2018 +0100

----------------------------------------------------------------------
 .../handler/PageAndComponentProviderTest.java   | 36 ++++++++++++
 .../StatelessPageWithQueuedComponents.html      | 14 +++++
 .../StatelessPageWithQueuedComponents.java      | 58 ++++++++++++++++++++
 3 files changed, 108 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/86f92fc8/wicket-core/src/test/java/org/apache/wicket/core/request/handler/PageAndComponentProviderTest.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/core/request/handler/PageAndComponentProviderTest.java
 
b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/PageAndComponentProviderTest.java
new file mode 100644
index 0000000..27e6793
--- /dev/null
+++ 
b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/PageAndComponentProviderTest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.core.request.handler;
+
+import 
org.apache.wicket.core.request.handler.StatelessPageWithQueuedComponents.CustomLabel;
+import org.apache.wicket.util.tester.WicketTestCase;
+import org.junit.Test;
+
+public class PageAndComponentProviderTest extends WicketTestCase
+{
+       
+       @Test
+       public void statelessComponentQueued() throws Exception
+       {       
+               PageAndComponentProvider provider = new 
PageAndComponentProvider(StatelessPageWithQueuedComponents.class, 
"container:label");
+               
+               CustomLabel component = (CustomLabel)provider.getComponent();
+               
+               assertFalse(component.hasBeenConfigured());
+                                       
+       }
+}

http://git-wip-us.apache.org/repos/asf/wicket/blob/86f92fc8/wicket-core/src/test/java/org/apache/wicket/core/request/handler/StatelessPageWithQueuedComponents.html
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/core/request/handler/StatelessPageWithQueuedComponents.html
 
b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/StatelessPageWithQueuedComponents.html
new file mode 100644
index 0000000..4e6bf9f
--- /dev/null
+++ 
b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/StatelessPageWithQueuedComponents.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html xmlns:wicket="http://wicket.apache.org";>
+       <head>
+               <meta charset="utf-8" />
+               <title>Apache Wicket Quickstart</title>
+               <link 
href='https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:regular,bold' 
rel='stylesheet' type='text/css' />
+               <link rel="stylesheet" href="style.css" type="text/css" 
media="screen" title="Stylesheet" />
+       </head>
+       <body>
+               <div wicket:id="container">
+                       <span wicket:id="label"></span>
+               </div>
+       </body>
+</html>

http://git-wip-us.apache.org/repos/asf/wicket/blob/86f92fc8/wicket-core/src/test/java/org/apache/wicket/core/request/handler/StatelessPageWithQueuedComponents.java
----------------------------------------------------------------------
diff --git 
a/wicket-core/src/test/java/org/apache/wicket/core/request/handler/StatelessPageWithQueuedComponents.java
 
b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/StatelessPageWithQueuedComponents.java
new file mode 100644
index 0000000..e1facca
--- /dev/null
+++ 
b/wicket-core/src/test/java/org/apache/wicket/core/request/handler/StatelessPageWithQueuedComponents.java
@@ -0,0 +1,58 @@
+/*
+ * 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.core.request.handler;
+
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.request.mapper.parameter.PageParameters;
+
+public class StatelessPageWithQueuedComponents extends WebPage {
+       private static final long serialVersionUID = 1L;
+
+       public StatelessPageWithQueuedComponents(final PageParameters 
parameters) {
+               super(parameters);
+               
+               setStatelessHint(true);
+               setVersioned(false);
+               
+               WebMarkupContainer container = new 
WebMarkupContainer("container");             
+               container.queue(new CustomLabel("label"));
+               
+               add(container);
+       }
+       
+       public static class CustomLabel extends Label
+       {
+
+               /**
+                * @param id
+                */
+               public CustomLabel(String id)
+               {
+                       super(id);
+               }
+               
+               /**
+                * 
+                */
+               public boolean hasBeenConfigured()
+               {
+                       return getRequestFlag((short)0x10);
+               }
+       }
+}

Reply via email to