Author: remy.maucherat(a)jboss.com
Date: 2008-03-22 17:31:36 -0400 (Sat, 22 Mar 2008)
New Revision: 536
Added:
trunk/java/org/jboss/web/cluster/
trunk/java/org/jboss/web/cluster/ClusterListener.java
trunk/java/org/jboss/web/cluster/Constants.java
trunk/test/java/
trunk/test/webapps/
trunk/test/webapps/reader/
trunk/test/webapps/reader/META-INF/
trunk/test/webapps/reader/META-INF/MANIFEST.MF
trunk/test/webapps/reader/WEB-INF/
trunk/test/webapps/reader/WEB-INF/web.xml
trunk/test/webapps/reader/index.jsp
trunk/test/webapps/reader/indexAscii.jsp
trunk/test/webapps/reader/read.jsp
trunk/test/webapps/reader/readCharB.jsp
trunk/test/webapps/reader/readLine.jsp
Removed:
trunk/test/org/
Log:
- Reorganize tests.
- Add input test (will remove if it's useless).
Added: trunk/java/org/jboss/web/cluster/ClusterListener.java
===================================================================
--- trunk/java/org/jboss/web/cluster/ClusterListener.java (rev 0)
+++ trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-03-22 21:31:36 UTC (rev
536)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.jboss.web.cluster;
+
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.util.StringManager;
+import org.apache.tomcat.jni.Library;
+import org.jboss.logging.Logger;
+import org.jboss.logging.Logger;
+
+
+
+/**
+ * Implementation of <code>LifecycleListener</code> that will init and
+ * and destroy APR.
+ *
+ * @author Remy Maucherat
+ * @author Filip Hanik
+ * @version $Revision: 515 $ $Date: 2008-03-17 22:02:23 +0100 (Mon, 17 Mar 2008) $
+ * @since 4.1
+ */
+
+public class ClusterListener
+ implements LifecycleListener {
+
+ private static Logger log = Logger.getLogger(ClusterListener.class);
+
+ /**
+ * The string manager for this package.
+ */
+ protected StringManager sm =
+ StringManager.getManager(Constants.Package);
+
+
+ // ---------------------------------------------- Constants
+
+
+ // ---------------------------------------------- Properties
+
+
+ // ---------------------------------------------- LifecycleListener Methods
+
+ /**
+ * Primary entry point for startup and shutdown events.
+ *
+ * @param event The event that has occurred
+ */
+ public void lifecycleEvent(LifecycleEvent event) {
+
+ if (Lifecycle.START_EVENT.equals(event.getType())) {
+
+ } else if (Lifecycle.STOP_EVENT.equals(event.getType())) {
+
+ }
+
+ }
+
+}
Property changes on: trunk/java/org/jboss/web/cluster/ClusterListener.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/java/org/jboss/web/cluster/Constants.java
===================================================================
--- trunk/java/org/jboss/web/cluster/Constants.java (rev 0)
+++ trunk/java/org/jboss/web/cluster/Constants.java 2008-03-22 21:31:36 UTC (rev 536)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+
+package org.jboss.web.cluster;
+
+
+public class Constants {
+
+ public static final String Package = "org.jboss.web.cluster";
+
+}
Property changes on: trunk/java/org/jboss/web/cluster/Constants.java
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/test/webapps/reader/META-INF/MANIFEST.MF
===================================================================
--- trunk/test/webapps/reader/META-INF/MANIFEST.MF (rev 0)
+++ trunk/test/webapps/reader/META-INF/MANIFEST.MF 2008-03-22 21:31:36 UTC (rev 536)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Created-By: 1.5.0_11 (Sun Microsystems Inc.)
+
Added: trunk/test/webapps/reader/WEB-INF/web.xml
===================================================================
--- trunk/test/webapps/reader/WEB-INF/web.xml (rev 0)
+++ trunk/test/webapps/reader/WEB-INF/web.xml 2008-03-22 21:31:36 UTC (rev 536)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+</web-app>
Added: trunk/test/webapps/reader/index.jsp
===================================================================
--- trunk/test/webapps/reader/index.jsp (rev 0)
+++ trunk/test/webapps/reader/index.jsp 2008-03-22 21:31:36 UTC (rev 536)
@@ -0,0 +1,42 @@
+<%@ page pageEncoding="UTF-8"%>
+<%@ page import="java.io.*"%>
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html;
charset=UTF-8">
+<TITLE>request#getReader test.</TITLE>
+</HEAD>
+<BODY>
+
+<%!
+ int charSize = 8193;
+ char character = 'あ';
+%>
+
+<%
+response.setContentType("text/html; charset=UTF-8");
+StringBuffer sb = new StringBuffer(charSize);
+for(int i=0 ; i < charSize ; i++){
+ sb.append(character);
+}
+%>
+
+<FORM method="POST" action="readLine.jsp"
enctype="text/plain">
+request#getReader()#readLine test<BR>
+<input type="text" name="thetext" value="<%=
sb.toString()+sb.toString()+sb.toString() %>"/>
+<input type="submit" value="send" />
+</FORM>
+
+<FORM method="POST" action="read.jsp"
enctype="text/plain">
+request#getReader()#read() test<BR>
+<input type="text" name="thetext" value="<%= sb.toString()
%>"/>
+<input type="submit" value="send" />
+</FORM>
+
+<FORM method="POST" action="readCharB.jsp"
enctype="text/plain">
+request#getReader()#read(char[1]) test<BR>
+<input type="text" name="thetext" value="<%= sb.toString()
%>"/>
+<input type="submit" value="send" />
+</FORM>
+
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/test/webapps/reader/indexAscii.jsp
===================================================================
--- trunk/test/webapps/reader/indexAscii.jsp (rev 0)
+++ trunk/test/webapps/reader/indexAscii.jsp 2008-03-22 21:31:36 UTC (rev 536)
@@ -0,0 +1,42 @@
+<%@ page pageEncoding="UTF-8"%>
+<%@ page import="java.io.*"%>
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html;
charset=UTF-8">
+<TITLE>request#getReader test.</TITLE>
+</HEAD>
+<BODY>
+
+<%!
+ int charSize = 8193;
+ char character = 'a';
+%>
+
+<%
+response.setContentType("text/html; charset=UTF-8");
+StringBuffer sb = new StringBuffer(charSize);
+for(int i=0 ; i < charSize ; i++){
+ sb.append(character);
+}
+%>
+
+<FORM method="POST" action="readLine.jsp"
enctype="text/plain">
+request#getReader()#readLine test<BR>
+<input type="text" name="thetext" value="<%=
sb.toString()+sb.toString()+sb.toString() %>"/>
+<input type="submit" value="send" />
+</FORM>
+
+<FORM method="POST" action="read.jsp"
enctype="text/plain">
+request#getReader()#read() test<BR>
+<input type="text" name="thetext" value="<%= sb.toString()
%>"/>
+<input type="submit" value="send" />
+</FORM>
+
+<FORM method="POST" action="readCharB.jsp"
enctype="text/plain">
+request#getReader()#read(char[1]) test<BR>
+<input type="text" name="thetext" value="<%= sb.toString()
%>"/>
+<input type="submit" value="send" />
+</FORM>
+
+</BODY>
+</HTML>
\ No newline at end of file
Added: trunk/test/webapps/reader/read.jsp
===================================================================
--- trunk/test/webapps/reader/read.jsp (rev 0)
+++ trunk/test/webapps/reader/read.jsp 2008-03-22 21:31:36 UTC (rev 536)
@@ -0,0 +1,43 @@
+<%@ page pageEncoding="UTF-8"%>
+<%@ page import="java.io.*"%>
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html;
charset=UTF-8">
+<TITLE>request#getReader test.</TITLE>
+</HEAD>
+<BODY>
+read.jsp is called.
+<HR>
+
+<%
+ request.setCharacterEncoding("UTF-8");
+ response.setContentType("text/html; charset=UTF-8");
+ BufferedReader reader = request.getReader();
+ StringBuffer sb = new StringBuffer();
+
+ read(reader, sb);
+
+ // TODO check if the read data is correct.
+ //outln(out,sb.toString());
+ outln(out,"Content-Type:" + request.getContentType());
+ outln(out,"Character Encoding:" + request.getCharacterEncoding());
+ outln(out, "Content-Length:"+ request.getContentLength());
+ outln(out, "read:" + sb.length()); // includes form text area name
"thetext="
+
+%>
+
+</BODY>
+</HTML>
+<%!
+ void read(BufferedReader br, StringBuffer sb) throws IOException{
+ int read = 0;
+ while((read = br.read())!= -1){
+ sb.append((char)read);
+ }
+ }
+
+ void outln(JspWriter out, String str) throws IOException{
+ out.println(str+"<BR>");
+ System.out.println(str);
+ }
+%>
\ No newline at end of file
Added: trunk/test/webapps/reader/readCharB.jsp
===================================================================
--- trunk/test/webapps/reader/readCharB.jsp (rev 0)
+++ trunk/test/webapps/reader/readCharB.jsp 2008-03-22 21:31:36 UTC (rev 536)
@@ -0,0 +1,46 @@
+<%@ page pageEncoding="UTF-8"%>
+<%@ page import="java.io.*"%>
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html;
charset=UTF-8">
+<TITLE>request#getReader test.</TITLE>
+</HEAD>
+<BODY>
+readCharb.jsp is called.
+<HR>
+
+<%
+ request.setCharacterEncoding("UTF-8");
+ response.setContentType("text/html; charset=UTF-8");
+ BufferedReader reader = request.getReader();
+ StringBuffer sb = new StringBuffer();
+
+ readCharB(reader, sb, 1);
+
+ // TODO check if the read data is correct.
+
+ //outln(out,sb.toString());
+ outln(out,"Content-Type:" + request.getContentType());
+ outln(out,"Character Encoding:" + request.getCharacterEncoding());
+ outln(out, "Content-Length:"+ request.getContentLength());
+ outln(out, "read:" + sb.length()); // includes form text area name
"thetext=" and last CR/LF
+
+%>
+
+</BODY>
+</HTML>
+<%!
+
+ void readCharB(BufferedReader br, StringBuffer sb, int bufferSize) throws IOException{
+ char[] buf = new char[bufferSize];
+ int read = 0;
+ while((read = br.read(buf))!= -1){
+ sb.append(buf, 0, read);
+ }
+ }
+
+ void outln(JspWriter out, String str) throws IOException{
+ out.println(str+"<BR>");
+ System.out.println(str);
+ }
+%>
\ No newline at end of file
Added: trunk/test/webapps/reader/readLine.jsp
===================================================================
--- trunk/test/webapps/reader/readLine.jsp (rev 0)
+++ trunk/test/webapps/reader/readLine.jsp 2008-03-22 21:31:36 UTC (rev 536)
@@ -0,0 +1,45 @@
+<%@ page pageEncoding="UTF-8"%>
+<%@ page import="java.io.*"%>
+<HTML>
+<HEAD>
+<META http-equiv="Content-Type" content="text/html;
charset=UTF-8">
+<TITLE>request#getReader test.</TITLE>
+</HEAD>
+<BODY>
+readLine.jsp is called.
+<HR>
+
+<%
+ request.setCharacterEncoding("UTF-8");
+ response.setContentType("text/html; charset=UTF-8");
+ BufferedReader reader = request.getReader();
+ StringBuffer sb = new StringBuffer();
+
+ readLine(reader, sb);
+
+ // TODO check if the read data is correct.
+
+ //outln(out,sb.toString());
+ outln(out,"Content-Type:" + request.getContentType());
+ outln(out,"Character Encoding:" + request.getCharacterEncoding());
+ outln(out, "Content-Length:"+ request.getContentLength());
+ outln(out, "read:" + sb.length()); // includes form text area name
"thetext=" and last CR/LF
+
+%>
+
+</BODY>
+</HTML>
+<%!
+
+ void readLine(BufferedReader br, StringBuffer sb) throws IOException{
+ String read = null;
+ while((read = br.readLine())!=null){
+ sb.append(read);// CR/LF lost.
+ }
+ }
+
+ void outln(JspWriter out, String str) throws IOException{
+ out.println(str+"<BR>");
+ System.out.println(str);
+ }
+%>
\ No newline at end of file