You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2012/03/07 20:55:05 UTC

svn commit: r1298076 - in /myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main: java/org/apache/myfaces/tobago/example/test/ webapp/WEB-INF/ webapp/image/wait/ webapp/test/ webapp/test/resource/

Author: lofwyr
Date: Wed Mar  7 19:55:05 2012
New Revision: 1298076

URL: http://svn.apache.org/viewvc?rev=1298076&view=rev
Log:
TOBAGO-694: Unresponsive image url blocks Tobago
 - test

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/WaitFilter.java
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/image/wait/
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/image/wait/cat.jpg   (with props)
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/resource/
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/resource/tobago-694.xhtml
Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml

Added: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/WaitFilter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/WaitFilter.java?rev=1298076&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/WaitFilter.java (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/java/org/apache/myfaces/tobago/example/test/WaitFilter.java Wed Mar  7 19:55:05 2012
@@ -0,0 +1,55 @@
+package org.apache.myfaces.tobago.example.test;
+
+/*
+ * 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.
+ */
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import java.io.IOException;
+
+/**
+ * This filter waits for 10 seconds to emulate network or application problems.
+ */
+public class WaitFilter implements Filter {
+
+  private static final Logger LOG = LoggerFactory.getLogger(WaitFilter.class);
+
+  public void init(FilterConfig filterConfig) throws ServletException {
+  }
+
+  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+      throws IOException, ServletException {
+
+    try {
+      Thread.sleep(10000L);
+    } catch (InterruptedException e) {
+      LOG.error("can't sleep 10000", e);
+    }
+
+    chain.doFilter(request, response);
+  }
+
+  public void destroy() {
+  }
+}

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml?rev=1298076&r1=1298075&r2=1298076&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml Wed Mar  7 19:55:05 2012
@@ -118,4 +118,14 @@
     <env-entry-value>Development</env-entry-value>
   </env-entry>
 
+  <filter>
+    <filter-name>WaitFilter</filter-name>
+    <filter-class>org.apache.myfaces.tobago.example.test.WaitFilter</filter-class>
+  </filter>
+
+  <filter-mapping>
+      <filter-name>WaitFilter</filter-name>
+      <url-pattern>/image/wait/*</url-pattern>
+  </filter-mapping>
+
 </web-app>

Added: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/image/wait/cat.jpg
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/image/wait/cat.jpg?rev=1298076&view=auto
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/image/wait/cat.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/resource/tobago-694.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/resource/tobago-694.xhtml?rev=1298076&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/resource/tobago-694.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/test/resource/tobago-694.xhtml Wed Mar  7 19:55:05 2012
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+
+<f:view
+    xmlns:tc="http://myfaces.apache.org/tobago/component"
+    xmlns:tx="http://myfaces.apache.org/tobago/extension"
+    xmlns:ui="http://java.sun.com/jsf/facelets"
+    xmlns:f="http://java.sun.com/jsf/core">
+
+  <tc:page>
+    <f:facet name="layout">
+      <tc:gridLayout rows="auto;auto;auto;auto;*" columns="auto"/>
+    </f:facet>
+    <tc:gridLayoutConstraint width="600px" height="300px"/>
+
+    <tc:messages/>
+
+    <tc:image value="image/wait/cat.jpg">
+      <tc:gridLayoutConstraint width="100px" height="106px"/>
+    </tc:image>
+
+    <tx:in label="Counter:" value="#{reload.counter}" readonly="true"/>
+
+    <tc:button label="submit" action="#{reload.isReload}"/>
+
+    <tc:cell/>
+
+  </tc:page>
+</f:view>