Author: pnedonosko
Date: 2010-02-15 11:56:01 -0500 (Mon, 15 Feb 2010)
New Revision: 1827
Added:
junit.framework/tags/1.2.1-CR2/
junit.framework/tags/1.2.1-CR2/pom.xml
junit.framework/tags/1.2.1-CR2/src/
junit.framework/tags/1.2.1-CR2/src/main/
junit.framework/tags/1.2.1-CR2/src/main/java/
junit.framework/tags/1.2.1-CR2/src/main/java/org/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/BasicTestCase.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionRequest.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionResponse.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletConfig.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletContext.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletPreferences.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletRequest.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletResponse.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletSession.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderRequest.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderResponse.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/EmptyResponse.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockFilterConfig.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpServletResponse.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpSession.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockPrincipal.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletContext.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletRequest.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletResponse.java
junit.framework/tags/1.2.1-CR2/src/test/
junit.framework/tags/1.2.1-CR2/src/test/java/
junit.framework/tags/1.2.1-CR2/src/test/java/org/
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/Dummy.java
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/TestMemthodInvokation.java
Removed:
junit.framework/tags/1.2.1-CR2/pom.xml
junit.framework/tags/1.2.1-CR2/src/
junit.framework/tags/1.2.1-CR2/src/main/
junit.framework/tags/1.2.1-CR2/src/main/java/
junit.framework/tags/1.2.1-CR2/src/main/java/org/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/BasicTestCase.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionRequest.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionResponse.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletConfig.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletContext.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletPreferences.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletRequest.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletResponse.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletSession.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderRequest.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderResponse.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/EmptyResponse.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockFilterConfig.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpServletResponse.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpSession.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockPrincipal.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletContext.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletRequest.java
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletResponse.java
junit.framework/tags/1.2.1-CR2/src/test/
junit.framework/tags/1.2.1-CR2/src/test/java/
junit.framework/tags/1.2.1-CR2/src/test/java/org/
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/Dummy.java
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/TestMemthodInvokation.java
Log:
EXOJCR-469 revert of junit.framework CR2 delete
Copied: junit.framework/tags/1.2.1-CR2 (from rev 1786, junit.framework/tags/1.2.1-CR2)
Deleted: junit.framework/tags/1.2.1-CR2/pom.xml
===================================================================
--- junit.framework/tags/1.2.1-CR2/pom.xml 2010-02-12 16:44:20 UTC (rev 1786)
+++ junit.framework/tags/1.2.1-CR2/pom.xml 2010-02-15 16:56:01 UTC (rev 1827)
@@ -1,79 +0,0 @@
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- 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.
-
--->
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.exoplatform</groupId>
- <artifactId>foundation-parent</artifactId>
- <version>4</version>
- </parent>
-
- <groupId>org.exoplatform.tool</groupId>
- <artifactId>exo.tool.framework.junit</artifactId>
- <version>1.2.1-CR2</version>
-
- <name>eXo Mock Objects framework</name>
- <description>eXo Mock Objects framework</description>
-
- <properties>
- <exo.product.name>exo-mock-objects</exo.product.name>
- <exo.product.specification>1.0.0</exo.product.specification>
- </properties>
-
- <scm>
-
<
connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/junit.framew...
-
<
developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/junit....
-
<
url>http://fisheye.jboss.org/browse/exo-jcr/junit.framework/tags/1.2.1...
- </scm>
-
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
-
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.portlet</groupId>
- <artifactId>portlet-api</artifactId>
- <version>2.0</version>
- </dependency>
-
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_13</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- </dependency>
- </dependencies>
-</project>
Copied: junit.framework/tags/1.2.1-CR2/pom.xml (from rev 1786,
junit.framework/tags/1.2.1-CR2/pom.xml)
===================================================================
--- junit.framework/tags/1.2.1-CR2/pom.xml (rev 0)
+++ junit.framework/tags/1.2.1-CR2/pom.xml 2010-02-15 16:56:01 UTC (rev 1827)
@@ -0,0 +1,79 @@
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.exoplatform</groupId>
+ <artifactId>foundation-parent</artifactId>
+ <version>4</version>
+ </parent>
+
+ <groupId>org.exoplatform.tool</groupId>
+ <artifactId>exo.tool.framework.junit</artifactId>
+ <version>1.2.1-CR2</version>
+
+ <name>eXo Mock Objects framework</name>
+ <description>eXo Mock Objects framework</description>
+
+ <properties>
+ <exo.product.name>exo-mock-objects</exo.product.name>
+ <exo.product.specification>1.0.0</exo.product.specification>
+ </properties>
+
+ <scm>
+
<
connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/junit.framew...
+
<
developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/junit....
+
<
url>http://fisheye.jboss.org/browse/exo-jcr/junit.framework/tags/1.2.1...
+ </scm>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_13</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ </dependencies>
+</project>
Copied: junit.framework/tags/1.2.1-CR2/src (from rev 1786,
junit.framework/tags/1.2.1-CR2/src)
Copied: junit.framework/tags/1.2.1-CR2/src/main (from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main)
Copied: junit.framework/tags/1.2.1-CR2/src/main/java (from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java)
Copied: junit.framework/tags/1.2.1-CR2/src/main/java/org (from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org)
Copied: junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform (from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform)
Copied: junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test (from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test)
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/BasicTestCase.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/BasicTestCase.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/BasicTestCase.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,124 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test;
-
-import junit.framework.TestCase;
-
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-
-public class BasicTestCase extends TestCase
-{
- private static int testNumber_ = 1;
-
- protected int counter_;
-
- public BasicTestCase()
- {
- }
-
- public BasicTestCase(String name)
- {
- super(name);
- }
-
- protected int getTestNumber()
- {
- return testNumber_;
- }
-
- protected void setTestNumber(int num)
- {
- testNumber_ = num;
- }
-
- protected int getCounter()
- {
- return counter_ + 1;
- }
-
- protected void runTest() throws Throwable
- {
- long t = System.currentTimeMillis();
- long firstRun = 0;
- int testNum = getTestNumber();
- System.out.println(getDescription());
-
System.out.println("\n********************************************************\n"
- + " BEGIN TEST CASE \n" +
"\t\t" + getName() + "\n"
- + "********************************************************\n");
- for (counter_ = 0; counter_ < testNum; counter_++)
- {
- super.runTest();
- if (counter_ == 0)
- {
- firstRun = System.currentTimeMillis() - t;
- }
- }
- t = System.currentTimeMillis() - t;
- System.out.println("\n\n\n=====> TEST CASE: run " + getName() +
"() " + getTestNumber() + " time in " + t
- + "ms, first run: " + firstRun + "ms, " + "average:
" + t / testNum + "ms <==============\n\n\n");
- }
-
- protected static void info(String s)
- {
- System.out.println(" INFO: " + s);
- }
-
- protected static void error(String s)
- {
- System.out.println("ERROR: " + s);
- }
-
- protected String getDescription()
- {
- return "Run test " + getClass().getName();
- }
-
- protected static void hasObjectInCollection(Object obj, Collection c, Comparator
comparator) throws Exception
- {
- Iterator iter = c.iterator();
- while (iter.hasNext())
- {
- Object o = iter.next();
- if (comparator.compare(obj, o) == 0)
- return;
- }
- throw new Exception("Object " + obj + " hasn't in collection
" + c);
- }
-
- protected static void assertCollection(Collection c1, Collection c2, Comparator
comparator) throws Exception
- {
- if (c1.size() != c2.size())
- {
- throw new Exception("Size of collection_1:" + c1.size() + " is
not equals to collection_2:" + c2.size());
- }
-
- for (Object o : c1)
- hasObjectInCollection(o, c2, comparator);
- }
-
- protected void assertObject(Object o1, Object o2, Comparator comparator) throws
Exception
- {
- if (comparator.compare(o1, o2) != 0)
- {
- throw new Exception("Object " + o1 + "not equals to" + o2);
- }
- }
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/BasicTestCase.java (from
rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/BasicTestCase.java)
===================================================================
--- junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/BasicTestCase.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/BasicTestCase.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test;
+
+import junit.framework.TestCase;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.Iterator;
+
+public class BasicTestCase extends TestCase
+{
+ private static int testNumber_ = 1;
+
+ protected int counter_;
+
+ public BasicTestCase()
+ {
+ }
+
+ public BasicTestCase(String name)
+ {
+ super(name);
+ }
+
+ protected int getTestNumber()
+ {
+ return testNumber_;
+ }
+
+ protected void setTestNumber(int num)
+ {
+ testNumber_ = num;
+ }
+
+ protected int getCounter()
+ {
+ return counter_ + 1;
+ }
+
+ protected void runTest() throws Throwable
+ {
+ long t = System.currentTimeMillis();
+ long firstRun = 0;
+ int testNum = getTestNumber();
+ System.out.println(getDescription());
+
System.out.println("\n********************************************************\n"
+ + " BEGIN TEST CASE \n" +
"\t\t" + getName() + "\n"
+ + "********************************************************\n");
+ for (counter_ = 0; counter_ < testNum; counter_++)
+ {
+ super.runTest();
+ if (counter_ == 0)
+ {
+ firstRun = System.currentTimeMillis() - t;
+ }
+ }
+ t = System.currentTimeMillis() - t;
+ System.out.println("\n\n\n=====> TEST CASE: run " + getName() +
"() " + getTestNumber() + " time in " + t
+ + "ms, first run: " + firstRun + "ms, " + "average:
" + t / testNum + "ms <==============\n\n\n");
+ }
+
+ protected static void info(String s)
+ {
+ System.out.println(" INFO: " + s);
+ }
+
+ protected static void error(String s)
+ {
+ System.out.println("ERROR: " + s);
+ }
+
+ protected String getDescription()
+ {
+ return "Run test " + getClass().getName();
+ }
+
+ protected static void hasObjectInCollection(Object obj, Collection c, Comparator
comparator) throws Exception
+ {
+ Iterator iter = c.iterator();
+ while (iter.hasNext())
+ {
+ Object o = iter.next();
+ if (comparator.compare(obj, o) == 0)
+ return;
+ }
+ throw new Exception("Object " + obj + " hasn't in collection
" + c);
+ }
+
+ protected static void assertCollection(Collection c1, Collection c2, Comparator
comparator) throws Exception
+ {
+ if (c1.size() != c2.size())
+ {
+ throw new Exception("Size of collection_1:" + c1.size() + " is
not equals to collection_2:" + c2.size());
+ }
+
+ for (Object o : c1)
+ hasObjectInCollection(o, c2, comparator);
+ }
+
+ protected void assertObject(Object o1, Object o2, Comparator comparator) throws
Exception
+ {
+ if (comparator.compare(o1, o2) != 0)
+ {
+ throw new Exception("Object " + o1 + "not equals to" + o2);
+ }
+ }
+}
Copied: junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks (from rev
1786, junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks)
Copied: junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet)
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionRequest.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionRequest.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionRequest.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.portlet;
-
-import javax.portlet.ActionRequest;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Tuan Nguyen
- * tuan08(a)users.sourceforge.net
- * Date: Jul 27, 2003
- * Time: 2:13:09 AM
- */
-public class MockActionRequest extends MockPortletRequest implements ActionRequest
-{
-
- public MockActionRequest()
- {
- super();
- }
-
- public java.io.InputStream getPortletInputStream() throws java.io.IOException
- {
- return null;
- }
-
- public void setCharacterEncoding(String enc) throws
java.io.UnsupportedEncodingException
- {
-
- }
-
- public java.io.BufferedReader getReader() throws java.io.UnsupportedEncodingException,
java.io.IOException
- {
- return null;
- }
-
- public java.lang.String getCharacterEncoding()
- {
- return "default";
- }
-
- public java.lang.String getContentType()
- {
- return "text/html";
- }
-
- public int getContentLength()
- {
- return 0;
- }
-
- public String getMethod()
- {
- return "POST";
- }
-
-}
\ No newline at end of file
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionRequest.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionRequest.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionRequest.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionRequest.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.portlet;
+
+import javax.portlet.ActionRequest;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tuan Nguyen
+ * tuan08(a)users.sourceforge.net
+ * Date: Jul 27, 2003
+ * Time: 2:13:09 AM
+ */
+public class MockActionRequest extends MockPortletRequest implements ActionRequest
+{
+
+ public MockActionRequest()
+ {
+ super();
+ }
+
+ public java.io.InputStream getPortletInputStream() throws java.io.IOException
+ {
+ return null;
+ }
+
+ public void setCharacterEncoding(String enc) throws
java.io.UnsupportedEncodingException
+ {
+
+ }
+
+ public java.io.BufferedReader getReader() throws java.io.UnsupportedEncodingException,
java.io.IOException
+ {
+ return null;
+ }
+
+ public java.lang.String getCharacterEncoding()
+ {
+ return "default";
+ }
+
+ public java.lang.String getContentType()
+ {
+ return "text/html";
+ }
+
+ public int getContentLength()
+ {
+ return 0;
+ }
+
+ public String getMethod()
+ {
+ return "POST";
+ }
+
+}
\ No newline at end of file
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionResponse.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionResponse.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.portlet;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Map;
-
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletModeException;
-import javax.portlet.WindowState;
-import javax.portlet.WindowStateException;
-import javax.xml.namespace.QName;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Mestrallet Benjamin
- * benjmestrallet(a)users.sourceforge.net
- * Date: Sep 11, 2003
- * Time: 8:26:13 PM
- */
-public class MockActionResponse extends MockPortletResponse implements ActionResponse
-{
-
- public void setWindowState(WindowState windowState) throws WindowStateException
- {
- }
-
- public void setPortletMode(PortletMode portletMode) throws PortletModeException
- {
- }
-
- public void sendRedirect(String s) throws IOException
- {
- }
-
- public void sendRedirect(String location, String renderUrlParamName) throws
IOException
- {
- }
-
- public void setRenderParameters(Map map)
- {
- }
-
- public void setRenderParameter(String s, String s1)
- {
- }
-
- public void setRenderParameter(String s, String[] strings)
- {
- }
-
- public PortletMode getPortletMode()
- {
- return null;
- }
-
- public Map<String, String[]> getRenderParameterMap()
- {
- return null;
- }
-
- public WindowState getWindowState()
- {
- return null;
- }
-
- public void removePublicRenderParameter(String arg0)
- {
- }
-
- public void setEvent(QName arg0, Serializable arg1)
- {
- }
-
- public void setEvent(String arg0, Serializable arg1)
- {
- }
-
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionResponse.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionResponse.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionResponse.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockActionResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.portlet;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Map;
+
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletModeException;
+import javax.portlet.WindowState;
+import javax.portlet.WindowStateException;
+import javax.xml.namespace.QName;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Mestrallet Benjamin
+ * benjmestrallet(a)users.sourceforge.net
+ * Date: Sep 11, 2003
+ * Time: 8:26:13 PM
+ */
+public class MockActionResponse extends MockPortletResponse implements ActionResponse
+{
+
+ public void setWindowState(WindowState windowState) throws WindowStateException
+ {
+ }
+
+ public void setPortletMode(PortletMode portletMode) throws PortletModeException
+ {
+ }
+
+ public void sendRedirect(String s) throws IOException
+ {
+ }
+
+ public void sendRedirect(String location, String renderUrlParamName) throws
IOException
+ {
+ }
+
+ public void setRenderParameters(Map map)
+ {
+ }
+
+ public void setRenderParameter(String s, String s1)
+ {
+ }
+
+ public void setRenderParameter(String s, String[] strings)
+ {
+ }
+
+ public PortletMode getPortletMode()
+ {
+ return null;
+ }
+
+ public Map<String, String[]> getRenderParameterMap()
+ {
+ return null;
+ }
+
+ public WindowState getWindowState()
+ {
+ return null;
+ }
+
+ public void removePublicRenderParameter(String arg0)
+ {
+ }
+
+ public void setEvent(QName arg0, Serializable arg1)
+ {
+ }
+
+ public void setEvent(String arg0, Serializable arg1)
+ {
+ }
+
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletConfig.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletConfig.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletConfig.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.portlet;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.xml.namespace.QName;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Tuan Nguyen
- * tuan08(a)users.sourceforge.net
- * Date: Jul 27, 2003
- * Time: 2:13:09 AM
- */
-public class MockPortletConfig implements PortletConfig
-{
-
- String portletName_;
-
- PortletContext context_ = null;
-
- Hashtable parameters_ = new Hashtable();
-
- ResourceBundle res_;
-
- public MockPortletConfig(PortletContext context)
- {
- parameters_ = new Hashtable();
- context_ = context;
- parameters_.put("template-location",
"/WEB-INF/templates/html");
- }
-
- public String getPortletName()
- {
- return portletName_;
- }
-
- public void setPortletName(String name)
- {
- portletName_ = name;
- }
-
- public PortletContext getPortletContext()
- {
- return context_;
- }
-
- public void setResourceBundle(ResourceBundle res)
- {
- res_ = res;
- }
-
- public java.util.ResourceBundle getResourceBundle(java.util.Locale locale)
- {
- return res_;
- }
-
- public String getInitParameter(java.lang.String name)
- {
- return (String)parameters_.get(name);
- }
-
- public void setInitParameter(String name, String value)
- {
- parameters_.put(name, value);
- }
-
- public java.util.Enumeration getInitParameterNames()
- {
- return null;
- }
-
- public java.util.Enumeration getSupportedLocales()
- {
- return Collections.enumeration(Arrays.asList(new Locale("en")));
- }
-
- public String getDefaultNamespace()
- {
- return null;
- }
-
- public Enumeration<QName> getProcessingEventQNames()
- {
- return null;
- }
-
- public Enumeration<String> getPublicRenderParameterNames()
- {
- return null;
- }
-
- public Enumeration<QName> getPublishingEventQNames()
- {
- return null;
- }
-
- public java.util.Map<String, String[]> getContainerRuntimeOptions()
- {
- return java.util.Collections.emptyMap();
- }
-
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletConfig.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletConfig.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletConfig.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletConfig.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.portlet;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.xml.namespace.QName;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tuan Nguyen
+ * tuan08(a)users.sourceforge.net
+ * Date: Jul 27, 2003
+ * Time: 2:13:09 AM
+ */
+public class MockPortletConfig implements PortletConfig
+{
+
+ String portletName_;
+
+ PortletContext context_ = null;
+
+ Hashtable parameters_ = new Hashtable();
+
+ ResourceBundle res_;
+
+ public MockPortletConfig(PortletContext context)
+ {
+ parameters_ = new Hashtable();
+ context_ = context;
+ parameters_.put("template-location",
"/WEB-INF/templates/html");
+ }
+
+ public String getPortletName()
+ {
+ return portletName_;
+ }
+
+ public void setPortletName(String name)
+ {
+ portletName_ = name;
+ }
+
+ public PortletContext getPortletContext()
+ {
+ return context_;
+ }
+
+ public void setResourceBundle(ResourceBundle res)
+ {
+ res_ = res;
+ }
+
+ public java.util.ResourceBundle getResourceBundle(java.util.Locale locale)
+ {
+ return res_;
+ }
+
+ public String getInitParameter(java.lang.String name)
+ {
+ return (String)parameters_.get(name);
+ }
+
+ public void setInitParameter(String name, String value)
+ {
+ parameters_.put(name, value);
+ }
+
+ public java.util.Enumeration getInitParameterNames()
+ {
+ return null;
+ }
+
+ public java.util.Enumeration getSupportedLocales()
+ {
+ return Collections.enumeration(Arrays.asList(new Locale("en")));
+ }
+
+ public String getDefaultNamespace()
+ {
+ return null;
+ }
+
+ public Enumeration<QName> getProcessingEventQNames()
+ {
+ return null;
+ }
+
+ public Enumeration<String> getPublicRenderParameterNames()
+ {
+ return null;
+ }
+
+ public Enumeration<QName> getPublishingEventQNames()
+ {
+ return null;
+ }
+
+ public java.util.Map<String, String[]> getContainerRuntimeOptions()
+ {
+ return java.util.Collections.emptyMap();
+ }
+
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletContext.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletContext.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletContext.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,149 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.portlet;
-
-import org.exoplatform.test.mocks.servlet.MockServletContext;
-
-import javax.portlet.PortletContext;
-import javax.portlet.PortletRequestDispatcher;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Tuan Nguyen
- * tuan08(a)users.sourceforge.net
- * Date: Jul 27, 2003
- * Time: 2:13:09 AM
- */
-public class MockPortletContext implements PortletContext
-{
-
- private String realPath_ = "./";
-
- private String contextName_;
-
- public String getServerInfo()
- {
- return null;
- }
-
- public PortletRequestDispatcher getRequestDispatcher(String path)
- {
- return null;
- }
-
- public PortletRequestDispatcher getNamedDispatcher(String name)
- {
- return null;
- }
-
- public java.io.InputStream getResourceAsStream(String path)
- {
- return null;
- }
-
- public int getMajorVersion()
- {
- return 1;
- }
-
- public int getMinorVersion()
- {
- return 0;
- }
-
- public String getMimeType(String file)
- {
- return null;
- }
-
- public String getRealPath(String path)
- {
- return realPath_;
- }
-
- public java.util.Set getResourcePaths(String path)
- {
- return null;
- }
-
- public java.net.URL getResource(String path) throws java.net.MalformedURLException
- {
- return null;
- }
-
- public java.lang.Object getAttribute(java.lang.String name)
- {
- return null;
- }
-
- public java.util.Enumeration getAttributeNames()
- {
- return null;
- }
-
- public java.lang.String getInitParameter(java.lang.String name)
- {
- return null;
- }
-
- public java.util.Enumeration getInitParameterNames()
- {
- return null;
- }
-
- public void log(java.lang.String msg)
- {
- System.out.println(msg);
- }
-
- public void log(java.lang.String message, java.lang.Throwable throwable)
- {
- System.out.println(message);
- throwable.printStackTrace();
- }
-
- public void removeAttribute(java.lang.String name)
- {
- }
-
- public void setAttribute(java.lang.String name, java.lang.Object object)
- {
- }
-
- public String getPortletContextName()
- {
- return contextName_;
- }
-
- public void setPortletContextName(String name)
- {
- contextName_ = name;
- }
-
- public MockServletContext getWrappedServletContext()
- {
- return new MockServletContext(contextName_);
- }
-
- public java.util.Enumeration<String> getContainerRuntimeOptions()
- {
- return java.util.Collections.enumeration(new
java.util.ArrayList<java.lang.String>());
- }
-
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletContext.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletContext.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletContext.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletContext.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.portlet;
+
+import org.exoplatform.test.mocks.servlet.MockServletContext;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletRequestDispatcher;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tuan Nguyen
+ * tuan08(a)users.sourceforge.net
+ * Date: Jul 27, 2003
+ * Time: 2:13:09 AM
+ */
+public class MockPortletContext implements PortletContext
+{
+
+ private String realPath_ = "./";
+
+ private String contextName_;
+
+ public String getServerInfo()
+ {
+ return null;
+ }
+
+ public PortletRequestDispatcher getRequestDispatcher(String path)
+ {
+ return null;
+ }
+
+ public PortletRequestDispatcher getNamedDispatcher(String name)
+ {
+ return null;
+ }
+
+ public java.io.InputStream getResourceAsStream(String path)
+ {
+ return null;
+ }
+
+ public int getMajorVersion()
+ {
+ return 1;
+ }
+
+ public int getMinorVersion()
+ {
+ return 0;
+ }
+
+ public String getMimeType(String file)
+ {
+ return null;
+ }
+
+ public String getRealPath(String path)
+ {
+ return realPath_;
+ }
+
+ public java.util.Set getResourcePaths(String path)
+ {
+ return null;
+ }
+
+ public java.net.URL getResource(String path) throws java.net.MalformedURLException
+ {
+ return null;
+ }
+
+ public java.lang.Object getAttribute(java.lang.String name)
+ {
+ return null;
+ }
+
+ public java.util.Enumeration getAttributeNames()
+ {
+ return null;
+ }
+
+ public java.lang.String getInitParameter(java.lang.String name)
+ {
+ return null;
+ }
+
+ public java.util.Enumeration getInitParameterNames()
+ {
+ return null;
+ }
+
+ public void log(java.lang.String msg)
+ {
+ System.out.println(msg);
+ }
+
+ public void log(java.lang.String message, java.lang.Throwable throwable)
+ {
+ System.out.println(message);
+ throwable.printStackTrace();
+ }
+
+ public void removeAttribute(java.lang.String name)
+ {
+ }
+
+ public void setAttribute(java.lang.String name, java.lang.Object object)
+ {
+ }
+
+ public String getPortletContextName()
+ {
+ return contextName_;
+ }
+
+ public void setPortletContextName(String name)
+ {
+ contextName_ = name;
+ }
+
+ public MockServletContext getWrappedServletContext()
+ {
+ return new MockServletContext(contextName_);
+ }
+
+ public java.util.Enumeration<String> getContainerRuntimeOptions()
+ {
+ return java.util.Collections.enumeration(new
java.util.ArrayList<java.lang.String>());
+ }
+
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletPreferences.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletPreferences.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletPreferences.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.portlet;
-
-import java.util.Hashtable;
-
-import javax.portlet.PortletPreferences;
-import javax.portlet.ReadOnlyException;
-import javax.portlet.ValidatorException;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Tuan Nguyen
- * tuan08(a)users.sourceforge.net
- * Date: Jul 27, 2003
- * Time: 2:13:09 AM
- */
-public class MockPortletPreferences implements PortletPreferences
-{
- private Hashtable map_;
-
- public MockPortletPreferences()
- {
- map_ = new Hashtable();
- }
-
- public boolean isReadOnly(String key)
- {
- return true;
- }
-
- public String getValue(String key, String def)
- {
- String value = (String)map_.get(key);
- if (value == null)
- value = def;
- return value;
- }
-
- public String[] getValues(String key, String[] def)
- {
- String[] values = (String[])map_.get(key);
- if (values == null)
- values = def;
- return values;
- }
-
- public void setValue(String key, String value) throws ReadOnlyException
- {
- map_.put(key, value);
- }
-
- public void setValues(String key, String[] values) throws ReadOnlyException
- {
- map_.put(key, values);
- }
-
- public java.util.Enumeration getNames()
- {
- return map_.keys();
- }
-
- public java.util.Map getMap()
- {
- return map_;
- }
-
- public void reset(String key) throws ReadOnlyException
- {
- map_.remove(key);
- }
-
- public void store() throws java.io.IOException, ValidatorException
- {
-
- }
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletPreferences.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletPreferences.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletPreferences.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletPreferences.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.portlet;
+
+import java.util.Hashtable;
+
+import javax.portlet.PortletPreferences;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.ValidatorException;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tuan Nguyen
+ * tuan08(a)users.sourceforge.net
+ * Date: Jul 27, 2003
+ * Time: 2:13:09 AM
+ */
+public class MockPortletPreferences implements PortletPreferences
+{
+ private Hashtable map_;
+
+ public MockPortletPreferences()
+ {
+ map_ = new Hashtable();
+ }
+
+ public boolean isReadOnly(String key)
+ {
+ return true;
+ }
+
+ public String getValue(String key, String def)
+ {
+ String value = (String)map_.get(key);
+ if (value == null)
+ value = def;
+ return value;
+ }
+
+ public String[] getValues(String key, String[] def)
+ {
+ String[] values = (String[])map_.get(key);
+ if (values == null)
+ values = def;
+ return values;
+ }
+
+ public void setValue(String key, String value) throws ReadOnlyException
+ {
+ map_.put(key, value);
+ }
+
+ public void setValues(String key, String[] values) throws ReadOnlyException
+ {
+ map_.put(key, values);
+ }
+
+ public java.util.Enumeration getNames()
+ {
+ return map_.keys();
+ }
+
+ public java.util.Map getMap()
+ {
+ return map_;
+ }
+
+ public void reset(String key) throws ReadOnlyException
+ {
+ map_.remove(key);
+ }
+
+ public void store() throws java.io.IOException, ValidatorException
+ {
+
+ }
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletRequest.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletRequest.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletRequest.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,273 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.portlet;
-
-import java.util.Hashtable;
-import java.util.Locale;
-import java.util.Map;
-
-import javax.portlet.PortalContext;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletSession;
-import javax.portlet.WindowState;
-import javax.servlet.http.Cookie;
-
-public class MockPortletRequest implements PortletRequest
-{
- private Map parameters_;
-
- private Map attributes_;
-
- private PortletSession session_;
-
- private PortletMode portletMode_;
-
- private String role_ = "none";
-
- private String remoteUser_;
-
- private PortletPreferences prefs_;
-
- public MockPortletRequest()
- {
- parameters_ = new Hashtable();
- attributes_ = new Hashtable();
- session_ = new MockPortletSession();
- portletMode_ = PortletMode.VIEW;
- prefs_ = new MockPortletPreferences();
-
- }
-
- public boolean isWindowStateAllowed(WindowState state)
- {
- return true;
- }
-
- public boolean isPortletModeAllowed(PortletMode mode)
- {
- return true;
- }
-
- public PortletMode getPortletMode()
- {
- return portletMode_;
- }
-
- public void setPortletMode(PortletMode mode)
- {
- portletMode_ = mode;
- }
-
- public WindowState getWindowState()
- {
- return WindowState.NORMAL;
- }
-
- public void setPreferences(PortletPreferences prefs)
- {
- prefs_ = prefs;
- }
-
- public PortletPreferences getPreferences()
- {
- return prefs_;
- }
-
- public PortletSession getPortletSession()
- {
- return session_;
- }
-
- public PortletSession getPortletSession(boolean create)
- {
- return session_;
- }
-
- public String getProperty(String name)
- {
- return "not support";
- }
-
- public java.util.Enumeration getProperties(String name)
- {
- return null;
- }
-
- public java.util.Enumeration getPropertyNames()
- {
- return null;
- }
-
- public PortalContext getPortalContext()
- {
- return null;
- }
-
- public java.lang.String getAuthType()
- {
- return null;
- }
-
- public String getContextPath()
- {
- return null;
- }
-
- public void setRemoteUser(String user)
- {
- remoteUser_ = user;
- }
-
- public java.lang.String getRemoteUser()
- {
- return remoteUser_;
- }
-
- public java.security.Principal getUserPrincipal()
- {
- return null;
- }
-
- public void setUserInRole(String role)
- {
- role_ = role;
- }
-
- public boolean isUserInRole(java.lang.String role)
- {
- return role_.equals(role);
- }
-
- public Object getAttribute(String name)
- {
- return attributes_.get(name);
- }
-
- public java.util.Enumeration getAttributeNames()
- {
- return null;
- }
-
- public String getParameter(String name)
- {
- return (String)parameters_.get(name);
- }
-
- public void setParameter(String name, Object value)
- {
- parameters_.put(name, value);
- }
-
- public java.util.Enumeration getParameterNames()
- {
- return null;
- }
-
- public String[] getParameterValues(String name)
- {
- return (String[])parameters_.get(name);
- }
-
- public java.util.Map getParameterMap()
- {
- return parameters_;
- }
-
- public java.util.Map getPublicParameterMap()
- {
- return parameters_;
- }
-
- public boolean isSecure()
- {
- return false;
- }
-
- public void setAttribute(String name, Object o)
- {
- attributes_.put(name, o);
- }
-
- public void removeAttribute(String name)
- {
- attributes_.remove(name);
- }
-
- public String getRequestedSessionId()
- {
- return session_.getId();
- }
-
- public boolean isRequestedSessionIdValid()
- {
- return true;
- }
-
- public String getResponseContentType()
- {
- return "txt/html";
- }
-
- public java.util.Enumeration getResponseContentTypes()
- {
- return null;
- }
-
- public java.util.Locale getLocale()
- {
- return Locale.US;
- }
-
- public java.util.Enumeration getLocales()
- {
- return null;
- }
-
- public String getScheme()
- {
- return "http://";
- }
-
- public String getServerName()
- {
- return "localhost";
- }
-
- public int getServerPort()
- {
- return 8080;
- }
-
- public Cookie[] getCookies()
- {
- return null;
- }
-
- public Map<String, String[]> getPrivateParameterMap()
- {
- return null;
- }
-
- public String getWindowID()
- {
- return null;
- }
-}
\ No newline at end of file
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletRequest.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletRequest.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletRequest.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletRequest.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,273 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.portlet;
+
+import java.util.Hashtable;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.portlet.PortalContext;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
+import javax.portlet.WindowState;
+import javax.servlet.http.Cookie;
+
+public class MockPortletRequest implements PortletRequest
+{
+ private Map parameters_;
+
+ private Map attributes_;
+
+ private PortletSession session_;
+
+ private PortletMode portletMode_;
+
+ private String role_ = "none";
+
+ private String remoteUser_;
+
+ private PortletPreferences prefs_;
+
+ public MockPortletRequest()
+ {
+ parameters_ = new Hashtable();
+ attributes_ = new Hashtable();
+ session_ = new MockPortletSession();
+ portletMode_ = PortletMode.VIEW;
+ prefs_ = new MockPortletPreferences();
+
+ }
+
+ public boolean isWindowStateAllowed(WindowState state)
+ {
+ return true;
+ }
+
+ public boolean isPortletModeAllowed(PortletMode mode)
+ {
+ return true;
+ }
+
+ public PortletMode getPortletMode()
+ {
+ return portletMode_;
+ }
+
+ public void setPortletMode(PortletMode mode)
+ {
+ portletMode_ = mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return WindowState.NORMAL;
+ }
+
+ public void setPreferences(PortletPreferences prefs)
+ {
+ prefs_ = prefs;
+ }
+
+ public PortletPreferences getPreferences()
+ {
+ return prefs_;
+ }
+
+ public PortletSession getPortletSession()
+ {
+ return session_;
+ }
+
+ public PortletSession getPortletSession(boolean create)
+ {
+ return session_;
+ }
+
+ public String getProperty(String name)
+ {
+ return "not support";
+ }
+
+ public java.util.Enumeration getProperties(String name)
+ {
+ return null;
+ }
+
+ public java.util.Enumeration getPropertyNames()
+ {
+ return null;
+ }
+
+ public PortalContext getPortalContext()
+ {
+ return null;
+ }
+
+ public java.lang.String getAuthType()
+ {
+ return null;
+ }
+
+ public String getContextPath()
+ {
+ return null;
+ }
+
+ public void setRemoteUser(String user)
+ {
+ remoteUser_ = user;
+ }
+
+ public java.lang.String getRemoteUser()
+ {
+ return remoteUser_;
+ }
+
+ public java.security.Principal getUserPrincipal()
+ {
+ return null;
+ }
+
+ public void setUserInRole(String role)
+ {
+ role_ = role;
+ }
+
+ public boolean isUserInRole(java.lang.String role)
+ {
+ return role_.equals(role);
+ }
+
+ public Object getAttribute(String name)
+ {
+ return attributes_.get(name);
+ }
+
+ public java.util.Enumeration getAttributeNames()
+ {
+ return null;
+ }
+
+ public String getParameter(String name)
+ {
+ return (String)parameters_.get(name);
+ }
+
+ public void setParameter(String name, Object value)
+ {
+ parameters_.put(name, value);
+ }
+
+ public java.util.Enumeration getParameterNames()
+ {
+ return null;
+ }
+
+ public String[] getParameterValues(String name)
+ {
+ return (String[])parameters_.get(name);
+ }
+
+ public java.util.Map getParameterMap()
+ {
+ return parameters_;
+ }
+
+ public java.util.Map getPublicParameterMap()
+ {
+ return parameters_;
+ }
+
+ public boolean isSecure()
+ {
+ return false;
+ }
+
+ public void setAttribute(String name, Object o)
+ {
+ attributes_.put(name, o);
+ }
+
+ public void removeAttribute(String name)
+ {
+ attributes_.remove(name);
+ }
+
+ public String getRequestedSessionId()
+ {
+ return session_.getId();
+ }
+
+ public boolean isRequestedSessionIdValid()
+ {
+ return true;
+ }
+
+ public String getResponseContentType()
+ {
+ return "txt/html";
+ }
+
+ public java.util.Enumeration getResponseContentTypes()
+ {
+ return null;
+ }
+
+ public java.util.Locale getLocale()
+ {
+ return Locale.US;
+ }
+
+ public java.util.Enumeration getLocales()
+ {
+ return null;
+ }
+
+ public String getScheme()
+ {
+ return "http://";
+ }
+
+ public String getServerName()
+ {
+ return "localhost";
+ }
+
+ public int getServerPort()
+ {
+ return 8080;
+ }
+
+ public Cookie[] getCookies()
+ {
+ return null;
+ }
+
+ public Map<String, String[]> getPrivateParameterMap()
+ {
+ return null;
+ }
+
+ public String getWindowID()
+ {
+ return null;
+ }
+}
\ No newline at end of file
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletResponse.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletResponse.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.portlet;
-
-import javax.portlet.PortletResponse;
-import javax.servlet.http.Cookie;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Tuan Nguyen
- * tuan08(a)users.sourceforge.net
- * Date: Jul 27, 2003
- * Time: 2:13:09 AM
- */
-public class MockPortletResponse implements PortletResponse
-{
-
- public void addProperty(String key, String value)
- {
- }
-
- public void setProperty(String key, String value)
- {
- }
-
- public String encodeURL(String path)
- {
- return path;
- }
-
- public void addProperty(String key, org.w3c.dom.Element element)
- {
- }
-
- public void addProperty(Cookie arg0)
- {
- }
-
- public String getNamespace()
- {
- return null;
- }
-
- public org.w3c.dom.Element createElement(String tagName) throws
org.w3c.dom.DOMException
- {
- return null;
- }
-
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletResponse.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletResponse.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletResponse.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.portlet;
+
+import javax.portlet.PortletResponse;
+import javax.servlet.http.Cookie;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tuan Nguyen
+ * tuan08(a)users.sourceforge.net
+ * Date: Jul 27, 2003
+ * Time: 2:13:09 AM
+ */
+public class MockPortletResponse implements PortletResponse
+{
+
+ public void addProperty(String key, String value)
+ {
+ }
+
+ public void setProperty(String key, String value)
+ {
+ }
+
+ public String encodeURL(String path)
+ {
+ return path;
+ }
+
+ public void addProperty(String key, org.w3c.dom.Element element)
+ {
+ }
+
+ public void addProperty(Cookie arg0)
+ {
+ }
+
+ public String getNamespace()
+ {
+ return null;
+ }
+
+ public org.w3c.dom.Element createElement(String tagName) throws
org.w3c.dom.DOMException
+ {
+ return null;
+ }
+
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletSession.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletSession.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletSession.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.portlet;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.portlet.PortletContext;
-import javax.portlet.PortletSession;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Tuan Nguyen
- * tuan08(a)users.sourceforge.net
- * Date: Jul 27, 2003
- * Time: 2:13:09 AM
- */
-public class MockPortletSession implements PortletSession
-{
- HashMap attributes_;
-
- HashMap appAttributes_;
-
- public MockPortletSession()
- {
- super();
- attributes_ = new HashMap();
- appAttributes_ = new HashMap();
- }
-
- public Object getAttribute(String name)
- {
- return attributes_.get(name);
- }
-
- public Object getAttribute(String name, int scope)
- {
- if (scope == PortletSession.APPLICATION_SCOPE)
- {
- return appAttributes_.get(name);
- }
- else
- {
- return attributes_.get(name);
- }
- }
-
- public void setAttribute(String name, Object obj)
- {
- attributes_.put(name, obj);
- }
-
- public void setAttribute(String name, Object obj, int scope)
- {
- if (scope == PortletSession.APPLICATION_SCOPE)
- {
- appAttributes_.put(name, obj);
- }
- else
- {
- attributes_.put(name, obj);
- }
- }
-
- public void removeAttribute(String name)
- {
- attributes_.remove(name);
- }
-
- public void removeAttribute(String name, int scope)
- {
- if (scope == PortletSession.APPLICATION_SCOPE)
- {
- appAttributes_.remove(name);
- }
- else
- {
- attributes_.remove(name);
- }
- }
-
- public Map getAttributeMap()
- {
- return getAttributeMap(PortletSession.PORTLET_SCOPE);
- }
-
- public Map getAttributeMap(int scope)
- {
- if (scope == PortletSession.APPLICATION_SCOPE)
- {
- return Collections.unmodifiableMap(appAttributes_);
- }
- else
- {
- return Collections.unmodifiableMap(attributes_);
- }
- }
-
- public java.util.Enumeration getAttributeNames()
- {
- return null;
- }
-
- public java.util.Enumeration getAttributeNames(int scope)
- {
- return null;
- }
-
- public long getCreationTime()
- {
- return 0;
- }
-
- public java.lang.String getId()
- {
- return new String(Integer.toString(this.hashCode()));
- }
-
- public long getLastAccessedTime()
- {
- return 0;
- }
-
- public int getMaxInactiveInterval()
- {
- return 0;
- }
-
- public void invalidate()
- {
- }
-
- public boolean isNew()
- {
- return false;
- }
-
- public void setMaxInactiveInterval(int interval)
- {
-
- }
-
- public PortletContext getPortletContext()
- {
- return null;
- }
-
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletSession.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletSession.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletSession.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockPortletSession.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.portlet;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.portlet.PortletContext;
+import javax.portlet.PortletSession;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Tuan Nguyen
+ * tuan08(a)users.sourceforge.net
+ * Date: Jul 27, 2003
+ * Time: 2:13:09 AM
+ */
+public class MockPortletSession implements PortletSession
+{
+ HashMap attributes_;
+
+ HashMap appAttributes_;
+
+ public MockPortletSession()
+ {
+ super();
+ attributes_ = new HashMap();
+ appAttributes_ = new HashMap();
+ }
+
+ public Object getAttribute(String name)
+ {
+ return attributes_.get(name);
+ }
+
+ public Object getAttribute(String name, int scope)
+ {
+ if (scope == PortletSession.APPLICATION_SCOPE)
+ {
+ return appAttributes_.get(name);
+ }
+ else
+ {
+ return attributes_.get(name);
+ }
+ }
+
+ public void setAttribute(String name, Object obj)
+ {
+ attributes_.put(name, obj);
+ }
+
+ public void setAttribute(String name, Object obj, int scope)
+ {
+ if (scope == PortletSession.APPLICATION_SCOPE)
+ {
+ appAttributes_.put(name, obj);
+ }
+ else
+ {
+ attributes_.put(name, obj);
+ }
+ }
+
+ public void removeAttribute(String name)
+ {
+ attributes_.remove(name);
+ }
+
+ public void removeAttribute(String name, int scope)
+ {
+ if (scope == PortletSession.APPLICATION_SCOPE)
+ {
+ appAttributes_.remove(name);
+ }
+ else
+ {
+ attributes_.remove(name);
+ }
+ }
+
+ public Map getAttributeMap()
+ {
+ return getAttributeMap(PortletSession.PORTLET_SCOPE);
+ }
+
+ public Map getAttributeMap(int scope)
+ {
+ if (scope == PortletSession.APPLICATION_SCOPE)
+ {
+ return Collections.unmodifiableMap(appAttributes_);
+ }
+ else
+ {
+ return Collections.unmodifiableMap(attributes_);
+ }
+ }
+
+ public java.util.Enumeration getAttributeNames()
+ {
+ return null;
+ }
+
+ public java.util.Enumeration getAttributeNames(int scope)
+ {
+ return null;
+ }
+
+ public long getCreationTime()
+ {
+ return 0;
+ }
+
+ public java.lang.String getId()
+ {
+ return new String(Integer.toString(this.hashCode()));
+ }
+
+ public long getLastAccessedTime()
+ {
+ return 0;
+ }
+
+ public int getMaxInactiveInterval()
+ {
+ return 0;
+ }
+
+ public void invalidate()
+ {
+ }
+
+ public boolean isNew()
+ {
+ return false;
+ }
+
+ public void setMaxInactiveInterval(int interval)
+ {
+
+ }
+
+ public PortletContext getPortletContext()
+ {
+ return null;
+ }
+
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderRequest.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderRequest.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderRequest.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.portlet;
-
-import javax.portlet.RenderRequest;
-
-/**
- * @author Mestrallet Benjamin
- * benjmestrallet(a)users.sourceforge.net
- * Date: 10 fev. 2004
- * Time: 19:57:18
- */
-public class MockRenderRequest extends MockPortletRequest implements RenderRequest
-{
-
- public String getETag()
- {
- return null;
- }
-
-}
\ No newline at end of file
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderRequest.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderRequest.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderRequest.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderRequest.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.portlet;
+
+import javax.portlet.RenderRequest;
+
+/**
+ * @author Mestrallet Benjamin
+ * benjmestrallet(a)users.sourceforge.net
+ * Date: 10 fev. 2004
+ * Time: 19:57:18
+ */
+public class MockRenderRequest extends MockPortletRequest implements RenderRequest
+{
+
+ public String getETag()
+ {
+ return null;
+ }
+
+}
\ No newline at end of file
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderResponse.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderResponse.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,137 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.portlet;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.Locale;
-
-import javax.portlet.CacheControl;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceURL;
-
-/**
- * @author Mestrallet Benjamin
- * benjmestrallet(a)users.sourceforge.net
- * Date: 10 feb. 2004
- * Time: 19:58:17
- */
-public class MockRenderResponse extends MockPortletResponse implements RenderResponse
-{
-
- public String getContentType()
- {
- return null; //To change body of implemented methods use File | Settings | File
Templates.
- }
-
- public PortletURL createRenderURL()
- {
- return null; //To change body of implemented methods use File | Settings | File
Templates.
- }
-
- public PortletURL createActionURL()
- {
- return null; //To change body of implemented methods use File | Settings | File
Templates.
- }
-
- public String getNamespace()
- {
- return null; //To change body of implemented methods use File | Settings | File
Templates.
- }
-
- public void setTitle(String string)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setContentType(String string)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public String getCharacterEncoding()
- {
- return null; //To change body of implemented methods use File | Settings | File
Templates.
- }
-
- public PrintWriter getWriter() throws IOException
- {
- return null; //To change body of implemented methods use File | Settings | File
Templates.
- }
-
- public Locale getLocale()
- {
- return null; //To change body of implemented methods use File | Settings | File
Templates.
- }
-
- public void setBufferSize(int i)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getBufferSize()
- {
- return 0; //To change body of implemented methods use File | Settings | File
Templates.
- }
-
- public void flushBuffer() throws IOException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void resetBuffer()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isCommitted()
- {
- return false; //To change body of implemented methods use File | Settings | File
Templates.
- }
-
- public void reset()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public OutputStream getPortletOutputStream() throws IOException
- {
- return null; //To change body of implemented methods use File | Settings | File
Templates.
- }
-
- public void setNextPossiblePortletModes(java.util.Collection<PortletMode>
portletModes)
- {
- }
-
- public ResourceURL createResourceURL() throws IllegalStateException
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public CacheControl getCacheControl()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
\ No newline at end of file
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderResponse.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderResponse.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderResponse.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/portlet/MockRenderResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.portlet;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+import javax.portlet.CacheControl;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceURL;
+
+/**
+ * @author Mestrallet Benjamin
+ * benjmestrallet(a)users.sourceforge.net
+ * Date: 10 feb. 2004
+ * Time: 19:58:17
+ */
+public class MockRenderResponse extends MockPortletResponse implements RenderResponse
+{
+
+ public String getContentType()
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public PortletURL createRenderURL()
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public PortletURL createActionURL()
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public String getNamespace()
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public void setTitle(String string)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void setContentType(String string)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getCharacterEncoding()
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public PrintWriter getWriter() throws IOException
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public Locale getLocale()
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public void setBufferSize(int i)
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public int getBufferSize()
+ {
+ return 0; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public void flushBuffer() throws IOException
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void resetBuffer()
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean isCommitted()
+ {
+ return false; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public void reset()
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public OutputStream getPortletOutputStream() throws IOException
+ {
+ return null; //To change body of implemented methods use File | Settings | File
Templates.
+ }
+
+ public void setNextPossiblePortletModes(java.util.Collection<PortletMode>
portletModes)
+ {
+ }
+
+ public ResourceURL createResourceURL() throws IllegalStateException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public CacheControl getCacheControl()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
\ No newline at end of file
Copied: junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet)
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/EmptyResponse.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/EmptyResponse.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/EmptyResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,178 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.servlet;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Locale;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Mestrallet Benjamin
- * benjmestrallet(a)users.sourceforge.net
- * Date: Jul 29, 2003
- * Time: 5:44:28 PM
- */
-public class EmptyResponse implements HttpServletResponse
-{
-
- public void addCookie(Cookie cookie)
- {
- }
-
- public boolean containsHeader(String s)
- {
- return false;
- }
-
- public String encodeURL(String s)
- {
- return null;
- }
-
- public String encodeRedirectURL(String s)
- {
- return null;
- }
-
- public String encodeUrl(String s)
- {
- return null;
- }
-
- public String encodeRedirectUrl(String s)
- {
- return null;
- }
-
- public void sendError(int i, String s) throws IOException
- {
- }
-
- public void sendError(int i) throws IOException
- {
- }
-
- public void sendRedirect(String s) throws IOException
- {
- }
-
- public void setDateHeader(String s, long l)
- {
- }
-
- public void addDateHeader(String s, long l)
- {
- }
-
- public void setHeader(String s, String s1)
- {
- }
-
- public void addHeader(String s, String s1)
- {
- }
-
- public void setIntHeader(String s, int i)
- {
- }
-
- public void addIntHeader(String s, int i)
- {
- }
-
- public void setStatus(int i)
- {
- }
-
- public void setStatus(int i, String s)
- {
- }
-
- public String getCharacterEncoding()
- {
- return null;
- }
-
- public ServletOutputStream getOutputStream() throws IOException
- {
- return null;
- }
-
- public PrintWriter getWriter() throws IOException
- {
- return null;
- }
-
- public void setContentLength(int i)
- {
- }
-
- public void setContentType(String s)
- {
- }
-
- public void setBufferSize(int i)
- {
- }
-
- public int getBufferSize()
- {
- return 0;
- }
-
- public void flushBuffer() throws IOException
- {
- }
-
- public void resetBuffer()
- {
- }
-
- public boolean isCommitted()
- {
- return false;
- }
-
- public void reset()
- {
- }
-
- public void setLocale(Locale locale)
- {
- }
-
- public Locale getLocale()
- {
- return null;
- }
-
- public void setCharacterEncoding(String charset)
- {
- }
-
- public String getContentType()
- {
- return null;
- }
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/EmptyResponse.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/EmptyResponse.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/EmptyResponse.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/EmptyResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.servlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Mestrallet Benjamin
+ * benjmestrallet(a)users.sourceforge.net
+ * Date: Jul 29, 2003
+ * Time: 5:44:28 PM
+ */
+public class EmptyResponse implements HttpServletResponse
+{
+
+ public void addCookie(Cookie cookie)
+ {
+ }
+
+ public boolean containsHeader(String s)
+ {
+ return false;
+ }
+
+ public String encodeURL(String s)
+ {
+ return null;
+ }
+
+ public String encodeRedirectURL(String s)
+ {
+ return null;
+ }
+
+ public String encodeUrl(String s)
+ {
+ return null;
+ }
+
+ public String encodeRedirectUrl(String s)
+ {
+ return null;
+ }
+
+ public void sendError(int i, String s) throws IOException
+ {
+ }
+
+ public void sendError(int i) throws IOException
+ {
+ }
+
+ public void sendRedirect(String s) throws IOException
+ {
+ }
+
+ public void setDateHeader(String s, long l)
+ {
+ }
+
+ public void addDateHeader(String s, long l)
+ {
+ }
+
+ public void setHeader(String s, String s1)
+ {
+ }
+
+ public void addHeader(String s, String s1)
+ {
+ }
+
+ public void setIntHeader(String s, int i)
+ {
+ }
+
+ public void addIntHeader(String s, int i)
+ {
+ }
+
+ public void setStatus(int i)
+ {
+ }
+
+ public void setStatus(int i, String s)
+ {
+ }
+
+ public String getCharacterEncoding()
+ {
+ return null;
+ }
+
+ public ServletOutputStream getOutputStream() throws IOException
+ {
+ return null;
+ }
+
+ public PrintWriter getWriter() throws IOException
+ {
+ return null;
+ }
+
+ public void setContentLength(int i)
+ {
+ }
+
+ public void setContentType(String s)
+ {
+ }
+
+ public void setBufferSize(int i)
+ {
+ }
+
+ public int getBufferSize()
+ {
+ return 0;
+ }
+
+ public void flushBuffer() throws IOException
+ {
+ }
+
+ public void resetBuffer()
+ {
+ }
+
+ public boolean isCommitted()
+ {
+ return false;
+ }
+
+ public void reset()
+ {
+ }
+
+ public void setLocale(Locale locale)
+ {
+ }
+
+ public Locale getLocale()
+ {
+ return null;
+ }
+
+ public void setCharacterEncoding(String charset)
+ {
+ }
+
+ public String getContentType()
+ {
+ return null;
+ }
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockFilterConfig.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockFilterConfig.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockFilterConfig.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.servlet;
-
-import java.util.Enumeration;
-
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletContext;
-
-/**
- * Created by The eXo Platform SAS .
- * @author Gennady Azarenkov
- * @version $Id: $
- */
-
-public class MockFilterConfig implements FilterConfig
-{
-
- private ServletContext servletContext;
-
- public MockFilterConfig(ServletContext servletContext)
- {
- super();
- this.servletContext = servletContext;
- }
-
- public String getFilterName()
- {
- return "mock-filter";
- }
-
- public String getInitParameter(String arg0)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Enumeration getInitParameterNames()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public ServletContext getServletContext()
- {
- return servletContext;
- }
-
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockFilterConfig.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockFilterConfig.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockFilterConfig.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockFilterConfig.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.servlet;
+
+import java.util.Enumeration;
+
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
+
+/**
+ * Created by The eXo Platform SAS .
+ * @author Gennady Azarenkov
+ * @version $Id: $
+ */
+
+public class MockFilterConfig implements FilterConfig
+{
+
+ private ServletContext servletContext;
+
+ public MockFilterConfig(ServletContext servletContext)
+ {
+ super();
+ this.servletContext = servletContext;
+ }
+
+ public String getFilterName()
+ {
+ return "mock-filter";
+ }
+
+ public String getInitParameter(String arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Enumeration getInitParameterNames()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpServletResponse.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpServletResponse.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpServletResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,260 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.servlet;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Locale;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * Created by The eXo Platform SAS .
- * @author Gennady Azarenkov
- * @version $Id: $
- */
-
-public class MockHttpServletResponse implements HttpServletResponse
-{
-
- private PrintWriter writer;
-
- private ByteArrayOutputStream stream;
-
- private ByteArrayServletOutputStream output;
-
- public MockHttpServletResponse()
- {
- stream = new ByteArrayOutputStream();
- writer = new PrintWriter(stream);
- output = new ByteArrayServletOutputStream(stream);
- }
-
- public String getOutputContent()
- {
- return new String(stream.toByteArray());
- }
-
- public void flushBuffer() throws IOException
- {
- // TODO Auto-generated method stub
-
- }
-
- public int getBufferSize()
- {
- // TODO Auto-generated method stub
- return 0;
- }
-
- public ServletOutputStream getOutputStream() throws IOException
- {
- return this.output;
- }
-
- public PrintWriter getWriter() throws IOException
- {
- return this.writer;
- }
-
- public boolean isCommitted()
- {
- return false;
- }
-
- public void reset()
- {
- // TODO Auto-generated method stub
-
- }
-
- public void resetBuffer()
- {
- // TODO Auto-generated method stub
-
- }
-
- public void addCookie(Cookie arg0)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void addDateHeader(String arg0, long arg1)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void addHeader(String arg0, String arg1)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void addIntHeader(String arg0, int arg1)
- {
- // TODO Auto-generated method stub
-
- }
-
- public boolean containsHeader(String arg0)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public String encodeRedirectURL(String arg0)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String encodeRedirectUrl(String arg0)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String encodeURL(String arg0)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String encodeUrl(String arg0)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void sendError(int arg0) throws IOException
- {
- // TODO Auto-generated method stub
-
- }
-
- public void sendError(int arg0, String arg1) throws IOException
- {
- // TODO Auto-generated method stub
-
- }
-
- public void sendRedirect(String arg0) throws IOException
- {
- // TODO Auto-generated method stub
-
- }
-
- public void setDateHeader(String arg0, long arg1)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void setHeader(String arg0, String arg1)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void setIntHeader(String arg0, int arg1)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void setStatus(int arg0)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void setStatus(int arg0, String arg1)
- {
- // TODO Auto-generated method stub
-
- }
-
- public String getCharacterEncoding()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Locale getLocale()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void setBufferSize(int arg0)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void setContentLength(int arg0)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void setContentType(String arg0)
- {
- // TODO Auto-generated method stub
-
- }
-
- public void setLocale(Locale arg0)
- {
- // TODO Auto-generated method stub
-
- }
-
- private static class ByteArrayServletOutputStream extends ServletOutputStream
- {
- ByteArrayOutputStream baos;
-
- public ByteArrayServletOutputStream(ByteArrayOutputStream baos)
- {
- this.baos = baos;
- }
-
- public void write(int i) throws IOException
- {
- baos.write(i);
- }
- }
-
- public String getContentType()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void setCharacterEncoding(String arg0)
- {
- // TODO Auto-generated method stub
-
- }
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpServletResponse.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpServletResponse.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpServletResponse.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpServletResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.servlet;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Created by The eXo Platform SAS .
+ * @author Gennady Azarenkov
+ * @version $Id: $
+ */
+
+public class MockHttpServletResponse implements HttpServletResponse
+{
+
+ private PrintWriter writer;
+
+ private ByteArrayOutputStream stream;
+
+ private ByteArrayServletOutputStream output;
+
+ public MockHttpServletResponse()
+ {
+ stream = new ByteArrayOutputStream();
+ writer = new PrintWriter(stream);
+ output = new ByteArrayServletOutputStream(stream);
+ }
+
+ public String getOutputContent()
+ {
+ return new String(stream.toByteArray());
+ }
+
+ public void flushBuffer() throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public int getBufferSize()
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public ServletOutputStream getOutputStream() throws IOException
+ {
+ return this.output;
+ }
+
+ public PrintWriter getWriter() throws IOException
+ {
+ return this.writer;
+ }
+
+ public boolean isCommitted()
+ {
+ return false;
+ }
+
+ public void reset()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void resetBuffer()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void addCookie(Cookie arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void addDateHeader(String arg0, long arg1)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void addHeader(String arg0, String arg1)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void addIntHeader(String arg0, int arg1)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean containsHeader(String arg0)
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public String encodeRedirectURL(String arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String encodeRedirectUrl(String arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String encodeURL(String arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String encodeUrl(String arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void sendError(int arg0) throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void sendError(int arg0, String arg1) throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void sendRedirect(String arg0) throws IOException
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setDateHeader(String arg0, long arg1)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setHeader(String arg0, String arg1)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setIntHeader(String arg0, int arg1)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setStatus(int arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setStatus(int arg0, String arg1)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public String getCharacterEncoding()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Locale getLocale()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setBufferSize(int arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setContentLength(int arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setContentType(String arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setLocale(Locale arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ private static class ByteArrayServletOutputStream extends ServletOutputStream
+ {
+ ByteArrayOutputStream baos;
+
+ public ByteArrayServletOutputStream(ByteArrayOutputStream baos)
+ {
+ this.baos = baos;
+ }
+
+ public void write(int i) throws IOException
+ {
+ baos.write(i);
+ }
+ }
+
+ public String getContentType()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setCharacterEncoding(String arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpSession.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpSession.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpSession.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.servlet;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionContext;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Mestrallet Benjamin
- * benjmestrallet(a)users.sourceforge.net
- * Date: Jul 27, 2003
- * Time: 2:13:09 AM
- */
-public class MockHttpSession implements HttpSession
-{
-
- private Map map = new HashMap();
-
- public long getCreationTime()
- {
- return 0;
- }
-
- public String getId()
- {
- return "MockSessionId";
- }
-
- public long getLastAccessedTime()
- {
- return 0;
- }
-
- public ServletContext getServletContext()
- {
- return null;
- }
-
- public void setMaxInactiveInterval(int i)
- {
- }
-
- public int getMaxInactiveInterval()
- {
- return 0;
- }
-
- public HttpSessionContext getSessionContext()
- {
- return null;
- }
-
- public Object getAttribute(String s)
- {
- return map.get(s);
- }
-
- public Object getValue(String s)
- {
- return null;
- }
-
- public Enumeration getAttributeNames()
- {
- return new Vector(map.keySet()).elements();
- }
-
- public String[] getValueNames()
- {
- return new String[0];
- }
-
- public void setAttribute(String s, Object o)
- {
- map.put(s, o);
- }
-
- public void putValue(String s, Object o)
- {
- }
-
- public void removeAttribute(String s)
- {
- map.remove(s);
- }
-
- public void removeValue(String s)
- {
- }
-
- public void invalidate()
- {
- }
-
- public boolean isNew()
- {
- return false;
- }
-
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpSession.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpSession.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpSession.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockHttpSession.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.servlet;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionContext;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Mestrallet Benjamin
+ * benjmestrallet(a)users.sourceforge.net
+ * Date: Jul 27, 2003
+ * Time: 2:13:09 AM
+ */
+public class MockHttpSession implements HttpSession
+{
+
+ private Map map = new HashMap();
+
+ public long getCreationTime()
+ {
+ return 0;
+ }
+
+ public String getId()
+ {
+ return "MockSessionId";
+ }
+
+ public long getLastAccessedTime()
+ {
+ return 0;
+ }
+
+ public ServletContext getServletContext()
+ {
+ return null;
+ }
+
+ public void setMaxInactiveInterval(int i)
+ {
+ }
+
+ public int getMaxInactiveInterval()
+ {
+ return 0;
+ }
+
+ public HttpSessionContext getSessionContext()
+ {
+ return null;
+ }
+
+ public Object getAttribute(String s)
+ {
+ return map.get(s);
+ }
+
+ public Object getValue(String s)
+ {
+ return null;
+ }
+
+ public Enumeration getAttributeNames()
+ {
+ return new Vector(map.keySet()).elements();
+ }
+
+ public String[] getValueNames()
+ {
+ return new String[0];
+ }
+
+ public void setAttribute(String s, Object o)
+ {
+ map.put(s, o);
+ }
+
+ public void putValue(String s, Object o)
+ {
+ }
+
+ public void removeAttribute(String s)
+ {
+ map.remove(s);
+ }
+
+ public void removeValue(String s)
+ {
+ }
+
+ public void invalidate()
+ {
+ }
+
+ public boolean isNew()
+ {
+ return false;
+ }
+
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockPrincipal.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockPrincipal.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockPrincipal.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.servlet;
-
-/**
- * @author Mestrallet Benjamin
- * benjmestrallet(a)users.sourceforge.net
- *
- */
-public class MockPrincipal implements java.security.Principal
-{
-
- /*
- * @see java.security.Principal#getName()
- */
- public String getName()
- {
- return "PrincipalMackName";
- }
-
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockPrincipal.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockPrincipal.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockPrincipal.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockPrincipal.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.servlet;
+
+/**
+ * @author Mestrallet Benjamin
+ * benjmestrallet(a)users.sourceforge.net
+ *
+ */
+public class MockPrincipal implements java.security.Principal
+{
+
+ /*
+ * @see java.security.Principal#getName()
+ */
+ public String getName()
+ {
+ return "PrincipalMackName";
+ }
+
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletContext.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletContext.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletContext.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,196 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.servlet;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-
-/**
- * Created by The eXo Platform SARL . Author : Mestrallet Benjamin
- * benjmestrallet(a)users.sourceforge.net Date: Jul 25, 2003 Time: 12:26:58 AM
- */
-public class MockServletContext implements ServletContext {
-
- private String name_;
-
- private HashMap initParams_;
-
- private HashMap attributes_;
-
- private String contextPath_;
-
- private StringBuffer logBuffer = new StringBuffer();
-
- public MockServletContext() {
- this("portlet_app_1");
- }
-
- public MockServletContext(String name) {
- name_ = name;
- initParams_ = new HashMap();
- attributes_ = new HashMap();
- }
-
- public MockServletContext(String name, String path) {
- this(name);
- contextPath_ = path;
- attributes_.put("javax.servlet.context.tempdir", path);
- }
-
- public void setName(String name) {
- name_ = name;
- }
-
- public String getLogBuffer() {
- try {
- return logBuffer.toString();
- } finally {
- logBuffer = new StringBuffer();
- }
- }
-
- public ServletContext getContext(String s) {
- return null;
- }
-
- public int getMajorVersion() {
- return 2;
- }
-
- public int getMinorVersion() {
- return 3;
- }
-
- public String getMimeType(String s) {
- return "text/html";
- }
-
- public Set getResourcePaths(String s) {
- Set set = new HashSet();
- set.add("/test1");
- set.add("/WEB-INF");
- set.add("/test2");
- return set;
- }
-
- public URL getResource(String s) throws MalformedURLException {
- String path = "file:" + contextPath_ + s;
- URL url = new URL(path);
- return url;
- }
-
- public InputStream getResourceAsStream(String s) {
- try {
- return getResource(s).openStream();
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- public RequestDispatcher getRequestDispatcher(String s) {
- return null;
- }
-
- public RequestDispatcher getNamedDispatcher(String s) {
- return null;
- }
-
- public Servlet getServlet(String s) throws ServletException {
- return null;
- }
-
- public Enumeration getServlets() {
- return null;
- }
-
- public Enumeration getServletNames() {
- return null;
- }
-
- public void log(String s) {
- logBuffer.append(s);
- }
-
- public void log(Exception e, String s) {
- logBuffer.append(s + e.getMessage());
- }
-
- public void log(String s, Throwable throwable) {
- logBuffer.append(s + throwable.getMessage());
- }
-
- public void setContextPath(String s) {
- contextPath_ = s;
- }
-
- public String getRealPath(String s) {
- return contextPath_ + s;
- }
-
- public String getServerInfo() {
- return null;
- }
-
- public void setInitParameter(String name, String value) {
- initParams_.put(name, value);
- }
-
- public String getInitParameter(String name) {
- return (String) initParams_.get(name);
- }
-
- public Enumeration getInitParameterNames() {
- Vector keys = new Vector(initParams_.keySet());
- return keys.elements();
- }
-
- public Object getAttribute(String name) {
- return attributes_.get(name);
- }
-
- public Enumeration getAttributeNames() {
- Vector keys = new Vector(attributes_.keySet());
- return keys.elements();
- }
-
- public void setAttribute(String name, Object value) {
- attributes_.put(name, value);
- }
-
- public void removeAttribute(String name) {
- attributes_.remove(name);
- }
-
- public String getServletContextName() {
- return name_;
- }
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletContext.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletContext.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletContext.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletContext.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,196 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.servlet;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+/**
+ * Created by The eXo Platform SARL . Author : Mestrallet Benjamin
+ * benjmestrallet(a)users.sourceforge.net Date: Jul 25, 2003 Time: 12:26:58 AM
+ */
+public class MockServletContext implements ServletContext {
+
+ private String name_;
+
+ private HashMap initParams_;
+
+ private HashMap attributes_;
+
+ private String contextPath_;
+
+ private StringBuffer logBuffer = new StringBuffer();
+
+ public MockServletContext() {
+ this("portlet_app_1");
+ }
+
+ public MockServletContext(String name) {
+ name_ = name;
+ initParams_ = new HashMap();
+ attributes_ = new HashMap();
+ }
+
+ public MockServletContext(String name, String path) {
+ this(name);
+ contextPath_ = path;
+ attributes_.put("javax.servlet.context.tempdir", path);
+ }
+
+ public void setName(String name) {
+ name_ = name;
+ }
+
+ public String getLogBuffer() {
+ try {
+ return logBuffer.toString();
+ } finally {
+ logBuffer = new StringBuffer();
+ }
+ }
+
+ public ServletContext getContext(String s) {
+ return null;
+ }
+
+ public int getMajorVersion() {
+ return 2;
+ }
+
+ public int getMinorVersion() {
+ return 3;
+ }
+
+ public String getMimeType(String s) {
+ return "text/html";
+ }
+
+ public Set getResourcePaths(String s) {
+ Set set = new HashSet();
+ set.add("/test1");
+ set.add("/WEB-INF");
+ set.add("/test2");
+ return set;
+ }
+
+ public URL getResource(String s) throws MalformedURLException {
+ String path = "file:" + contextPath_ + s;
+ URL url = new URL(path);
+ return url;
+ }
+
+ public InputStream getResourceAsStream(String s) {
+ try {
+ return getResource(s).openStream();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public RequestDispatcher getRequestDispatcher(String s) {
+ return null;
+ }
+
+ public RequestDispatcher getNamedDispatcher(String s) {
+ return null;
+ }
+
+ public Servlet getServlet(String s) throws ServletException {
+ return null;
+ }
+
+ public Enumeration getServlets() {
+ return null;
+ }
+
+ public Enumeration getServletNames() {
+ return null;
+ }
+
+ public void log(String s) {
+ logBuffer.append(s);
+ }
+
+ public void log(Exception e, String s) {
+ logBuffer.append(s + e.getMessage());
+ }
+
+ public void log(String s, Throwable throwable) {
+ logBuffer.append(s + throwable.getMessage());
+ }
+
+ public void setContextPath(String s) {
+ contextPath_ = s;
+ }
+
+ public String getRealPath(String s) {
+ return contextPath_ + s;
+ }
+
+ public String getServerInfo() {
+ return null;
+ }
+
+ public void setInitParameter(String name, String value) {
+ initParams_.put(name, value);
+ }
+
+ public String getInitParameter(String name) {
+ return (String) initParams_.get(name);
+ }
+
+ public Enumeration getInitParameterNames() {
+ Vector keys = new Vector(initParams_.keySet());
+ return keys.elements();
+ }
+
+ public Object getAttribute(String name) {
+ return attributes_.get(name);
+ }
+
+ public Enumeration getAttributeNames() {
+ Vector keys = new Vector(attributes_.keySet());
+ return keys.elements();
+ }
+
+ public void setAttribute(String name, Object value) {
+ attributes_.put(name, value);
+ }
+
+ public void removeAttribute(String name) {
+ attributes_.remove(name);
+ }
+
+ public String getServletContextName() {
+ return name_;
+ }
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletRequest.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletRequest.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletRequest.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,380 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.servlet;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Vector;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-/**
- * Created by The eXo Platform SARL Author : Mestrallet Benjamin
- * benjmestrallet(a)users.sourceforge.net Date: Jul 29, 2003 Time: 12:44:53 PM
- */
-
-public class MockServletRequest implements HttpServletRequest {
-
- private Map parameters;
-
- private Map attributes;
-
- private HttpSession session;
-
- private Locale locale;
-
- private boolean secure;
-
- private Map headers;
-
- private String enc = "ISO-8859-1";
-
- private String pathInfo_;
-
- private String requestURI_;
-
- private URL url;
-
- private String method = "GET";
-
- private String contextPath = "";
-
- private String remoteUser = "REMOTE USER FROM MOCK";
-
- public MockServletRequest(HttpSession session, Locale locale) {
-
- this(session, locale, false);
-
- }
-
- public MockServletRequest(HttpSession session, Locale locale, boolean secure) {
-
- this(session, null, null, locale, secure);
- }
-
- public MockServletRequest(HttpSession session,
- URL url,
- String contextPath,
- Locale locale,
- boolean secure) {
- this.session = session;
- this.locale = locale;
- headers = new HashMap();
- Collection headersMultiple = new ArrayList();
- headersMultiple.add("header-value3-1");
- headersMultiple.add("header-value3-2");
- headersMultiple.add("header-value3-3");
- headers.put("header1", "header-value1");
- headers.put("header2", "header-value2");
- headers.put("header3", headersMultiple);
- parameters = new HashMap();
- attributes = new HashMap();
- this.secure = secure;
- if (url == null) {
- try {
- this.url = new URL("http://exoplatform.com:80/context/path?q=v");
- this.contextPath = "/context";
- } catch (MalformedURLException e) {
- }
- } else {
- this.url = url;
- this.contextPath = contextPath;
- }
- }
-
- public void reset() {
- parameters = new HashMap();
- attributes = new HashMap();
- }
-
- public String getAuthType() {
- return DIGEST_AUTH;
- }
-
- public Cookie[] getCookies() {
- return new Cookie[0];
- }
-
- public long getDateHeader(String s) {
- return 0;
- }
-
- public String getHeader(String s) {
- return (String) headers.get(s);
- }
-
- public Enumeration getHeaders(String s) {
- if (headers.get(s) instanceof Collection)
- return Collections.enumeration((Collection) headers.get(s));
- else {
- Vector v = new Vector();
- v.add(headers.get(s));
- return v.elements();
- }
- }
-
- public Enumeration getHeaderNames() {
- return Collections.enumeration(headers.keySet());
- }
-
- public int getIntHeader(String s) {
- return 0;
- }
-
- public String getMethod() {
-
- return method;
- }
-
- public String getPathInfo() {
- return pathInfo_;
- }
-
- public void setPathInfo(String s) {
- pathInfo_ = s;
- }
-
- public String getPathTranslated() {
- return null;
- }
-
- public String getContextPath() {
- return contextPath;
- }
-
- public String getQueryString() {
- return url.getQuery();
- }
-
- public String getRemoteUser() {
- return remoteUser;
- }
-
- public void setRemoteUser(String remoteUser) {
- this.remoteUser = remoteUser;
- }
-
- public boolean isUserInRole(String s) {
- if ("auth-user".equals(s))
- return true;
- else
- return false;
- }
-
- public Principal getUserPrincipal() {
- return new MockPrincipal();
- }
-
- public String getRequestedSessionId() {
- return null;
- }
-
- public String getRequestURI() {
- if (this.requestURI_ == null)
- return url.getPath();
- else
- return requestURI_;
- }
-
- public void setRequestURI(String s) {
- this.requestURI_ = s;
- }
-
- public StringBuffer getRequestURL() {
- return new StringBuffer(url.toString());
- }
-
- public String getServletPath() {
- return url.getPath();
- }
-
- public HttpSession getSession(boolean b) {
- return session;
- }
-
- public HttpSession getSession() {
- return session;
- }
-
- public boolean isRequestedSessionIdValid() {
- return false;
- }
-
- public boolean isRequestedSessionIdFromCookie() {
- return false;
- }
-
- public boolean isRequestedSessionIdFromURL() {
- return false;
- }
-
- public boolean isRequestedSessionIdFromUrl() {
- return false;
- }
-
- public Object getAttribute(String s) {
- return attributes.get(s);
- }
-
- public Enumeration getAttributeNames() {
- return new Vector(attributes.keySet()).elements();
- }
-
- public String getCharacterEncoding() {
- return enc;
- }
-
- public void setCharacterEncoding(String s) throws UnsupportedEncodingException {
- enc = s;
- }
-
- public int getContentLength() {
- return 0;
- }
-
- public String getContentType() {
- return null;
- }
-
- public ServletInputStream getInputStream() throws IOException {
- return null;
- }
-
- public String getParameter(String s) {
- return (String) parameters.get(s);
- }
-
- public void setParameter(String s, Object value) {
- parameters.put(s, value);
- }
-
- public Enumeration getParameterNames() {
- return new Vector(parameters.keySet()).elements();
- }
-
- public String[] getParameterValues(String s) {
-
- ArrayList<String> arr = new ArrayList<String>();
- Iterator it = parameters.keySet().iterator();
- while (it.hasNext()) {
-
- String pname = (String) it.next();
- if (pname.equals(s))
- arr.add((String) parameters.get(s));
- }
- return arr.toArray(new String[arr.size()]);
-
- }
-
- public Map getParameterMap() {
- return parameters;
- }
-
- public String getProtocol() {
- return null;
- }
-
- public String getScheme() {
- return url.getProtocol();
- }
-
- public String getServerName() {
- return url.getHost();
- }
-
- public int getServerPort() {
- return url.getPort();
- }
-
- public BufferedReader getReader() throws IOException {
- return null;
- }
-
- public String getRemoteAddr() {
- return null;
- }
-
- public String getRemoteHost() {
- return null;
- }
-
- public void setAttribute(String s, Object o) {
- attributes.put(s, o);
- }
-
- public void removeAttribute(String s) {
- attributes.remove(s);
- }
-
- public Locale getLocale() {
- return locale;
- }
-
- public Enumeration getLocales() {
- System.out.println("MOCK get Locale : " + locale);
- Vector v = new Vector();
- v.add(locale);
- return v.elements();
- }
-
- public boolean isSecure() {
- return secure;
- }
-
- public RequestDispatcher getRequestDispatcher(String s) {
- return null;
- }
-
- public String getRealPath(String s) {
- return null;
- }
-
- // servlet 2.4 method
- public int getLocalPort() {
- return 0;
- }
-
- public String getLocalAddr() {
- return "127.0.0.1";
- }
-
- public String getLocalName() {
- return "localhost";
- }
-
- public int getRemotePort() {
- return 0;
- }
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletRequest.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletRequest.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletRequest.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletRequest.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,380 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.servlet;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+/**
+ * Created by The eXo Platform SARL Author : Mestrallet Benjamin
+ * benjmestrallet(a)users.sourceforge.net Date: Jul 29, 2003 Time: 12:44:53 PM
+ */
+
+public class MockServletRequest implements HttpServletRequest {
+
+ private Map parameters;
+
+ private Map attributes;
+
+ private HttpSession session;
+
+ private Locale locale;
+
+ private boolean secure;
+
+ private Map headers;
+
+ private String enc = "ISO-8859-1";
+
+ private String pathInfo_;
+
+ private String requestURI_;
+
+ private URL url;
+
+ private String method = "GET";
+
+ private String contextPath = "";
+
+ private String remoteUser = "REMOTE USER FROM MOCK";
+
+ public MockServletRequest(HttpSession session, Locale locale) {
+
+ this(session, locale, false);
+
+ }
+
+ public MockServletRequest(HttpSession session, Locale locale, boolean secure) {
+
+ this(session, null, null, locale, secure);
+ }
+
+ public MockServletRequest(HttpSession session,
+ URL url,
+ String contextPath,
+ Locale locale,
+ boolean secure) {
+ this.session = session;
+ this.locale = locale;
+ headers = new HashMap();
+ Collection headersMultiple = new ArrayList();
+ headersMultiple.add("header-value3-1");
+ headersMultiple.add("header-value3-2");
+ headersMultiple.add("header-value3-3");
+ headers.put("header1", "header-value1");
+ headers.put("header2", "header-value2");
+ headers.put("header3", headersMultiple);
+ parameters = new HashMap();
+ attributes = new HashMap();
+ this.secure = secure;
+ if (url == null) {
+ try {
+ this.url = new URL("http://exoplatform.com:80/context/path?q=v");
+ this.contextPath = "/context";
+ } catch (MalformedURLException e) {
+ }
+ } else {
+ this.url = url;
+ this.contextPath = contextPath;
+ }
+ }
+
+ public void reset() {
+ parameters = new HashMap();
+ attributes = new HashMap();
+ }
+
+ public String getAuthType() {
+ return DIGEST_AUTH;
+ }
+
+ public Cookie[] getCookies() {
+ return new Cookie[0];
+ }
+
+ public long getDateHeader(String s) {
+ return 0;
+ }
+
+ public String getHeader(String s) {
+ return (String) headers.get(s);
+ }
+
+ public Enumeration getHeaders(String s) {
+ if (headers.get(s) instanceof Collection)
+ return Collections.enumeration((Collection) headers.get(s));
+ else {
+ Vector v = new Vector();
+ v.add(headers.get(s));
+ return v.elements();
+ }
+ }
+
+ public Enumeration getHeaderNames() {
+ return Collections.enumeration(headers.keySet());
+ }
+
+ public int getIntHeader(String s) {
+ return 0;
+ }
+
+ public String getMethod() {
+
+ return method;
+ }
+
+ public String getPathInfo() {
+ return pathInfo_;
+ }
+
+ public void setPathInfo(String s) {
+ pathInfo_ = s;
+ }
+
+ public String getPathTranslated() {
+ return null;
+ }
+
+ public String getContextPath() {
+ return contextPath;
+ }
+
+ public String getQueryString() {
+ return url.getQuery();
+ }
+
+ public String getRemoteUser() {
+ return remoteUser;
+ }
+
+ public void setRemoteUser(String remoteUser) {
+ this.remoteUser = remoteUser;
+ }
+
+ public boolean isUserInRole(String s) {
+ if ("auth-user".equals(s))
+ return true;
+ else
+ return false;
+ }
+
+ public Principal getUserPrincipal() {
+ return new MockPrincipal();
+ }
+
+ public String getRequestedSessionId() {
+ return null;
+ }
+
+ public String getRequestURI() {
+ if (this.requestURI_ == null)
+ return url.getPath();
+ else
+ return requestURI_;
+ }
+
+ public void setRequestURI(String s) {
+ this.requestURI_ = s;
+ }
+
+ public StringBuffer getRequestURL() {
+ return new StringBuffer(url.toString());
+ }
+
+ public String getServletPath() {
+ return url.getPath();
+ }
+
+ public HttpSession getSession(boolean b) {
+ return session;
+ }
+
+ public HttpSession getSession() {
+ return session;
+ }
+
+ public boolean isRequestedSessionIdValid() {
+ return false;
+ }
+
+ public boolean isRequestedSessionIdFromCookie() {
+ return false;
+ }
+
+ public boolean isRequestedSessionIdFromURL() {
+ return false;
+ }
+
+ public boolean isRequestedSessionIdFromUrl() {
+ return false;
+ }
+
+ public Object getAttribute(String s) {
+ return attributes.get(s);
+ }
+
+ public Enumeration getAttributeNames() {
+ return new Vector(attributes.keySet()).elements();
+ }
+
+ public String getCharacterEncoding() {
+ return enc;
+ }
+
+ public void setCharacterEncoding(String s) throws UnsupportedEncodingException {
+ enc = s;
+ }
+
+ public int getContentLength() {
+ return 0;
+ }
+
+ public String getContentType() {
+ return null;
+ }
+
+ public ServletInputStream getInputStream() throws IOException {
+ return null;
+ }
+
+ public String getParameter(String s) {
+ return (String) parameters.get(s);
+ }
+
+ public void setParameter(String s, Object value) {
+ parameters.put(s, value);
+ }
+
+ public Enumeration getParameterNames() {
+ return new Vector(parameters.keySet()).elements();
+ }
+
+ public String[] getParameterValues(String s) {
+
+ ArrayList<String> arr = new ArrayList<String>();
+ Iterator it = parameters.keySet().iterator();
+ while (it.hasNext()) {
+
+ String pname = (String) it.next();
+ if (pname.equals(s))
+ arr.add((String) parameters.get(s));
+ }
+ return arr.toArray(new String[arr.size()]);
+
+ }
+
+ public Map getParameterMap() {
+ return parameters;
+ }
+
+ public String getProtocol() {
+ return null;
+ }
+
+ public String getScheme() {
+ return url.getProtocol();
+ }
+
+ public String getServerName() {
+ return url.getHost();
+ }
+
+ public int getServerPort() {
+ return url.getPort();
+ }
+
+ public BufferedReader getReader() throws IOException {
+ return null;
+ }
+
+ public String getRemoteAddr() {
+ return null;
+ }
+
+ public String getRemoteHost() {
+ return null;
+ }
+
+ public void setAttribute(String s, Object o) {
+ attributes.put(s, o);
+ }
+
+ public void removeAttribute(String s) {
+ attributes.remove(s);
+ }
+
+ public Locale getLocale() {
+ return locale;
+ }
+
+ public Enumeration getLocales() {
+ System.out.println("MOCK get Locale : " + locale);
+ Vector v = new Vector();
+ v.add(locale);
+ return v.elements();
+ }
+
+ public boolean isSecure() {
+ return secure;
+ }
+
+ public RequestDispatcher getRequestDispatcher(String s) {
+ return null;
+ }
+
+ public String getRealPath(String s) {
+ return null;
+ }
+
+ // servlet 2.4 method
+ public int getLocalPort() {
+ return 0;
+ }
+
+ public String getLocalAddr() {
+ return "127.0.0.1";
+ }
+
+ public String getLocalName() {
+ return "localhost";
+ }
+
+ public int getRemotePort() {
+ return 0;
+ }
+}
Deleted:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletResponse.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletResponse.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.mocks.servlet;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Locale;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-
-/**
- * Created by The eXo Platform SARL
- * Author : Mestrallet Benjamin
- * benjmestrallet(a)users.sourceforge.net
- * Date: Jul 29, 2003
- * Time: 6:54:45 PM
- */
-public class MockServletResponse extends HttpServletResponseWrapper
-{
-
- private PrintWriter tmpWriter;
-
- private ByteArrayOutputStream output;
-
- private ByteArrayServletOutputStream servletOutput;
-
- private Locale locale_;
-
- public MockServletResponse(HttpServletResponse httpServletResponse)
- {
- super(httpServletResponse);
- output = new ByteArrayOutputStream();
- tmpWriter = new PrintWriter(output);
- servletOutput = new ByteArrayServletOutputStream(output);
- }
-
- public void finalize() throws Throwable
- {
- super.finalize();
- servletOutput.close();
- output.close();
- tmpWriter.close();
- }
-
- public String getPortletContent()
- {
- String s = output.toString();
- reset();
- return s;
- }
-
- /*
- public PrintWriter getWriter() throws IOException {
- //return servletResponse.getWriter();
- return tmpWriter;
- }
-
- public ServletOutputStream getOutputStream() throws IOException {
- return servletOutput;
- }
- */
-
- public byte[] toByteArray()
- {
- return output.toByteArray();
- }
-
- public String getOutputContent()
- {
- return new String(output.toByteArray());
- }
-
- public void flushBuffer() throws IOException
- {
- tmpWriter.flush();
- servletOutput.flush();
- }
-
- public void reset()
- {
- output.reset();
- }
-
- public void close() throws IOException
- {
- tmpWriter.close();
- }
-
- private static class ByteArrayServletOutputStream extends ServletOutputStream
- {
- ByteArrayOutputStream baos;
-
- public ByteArrayServletOutputStream(ByteArrayOutputStream baos)
- {
- this.baos = baos;
- }
-
- public void write(int i) throws IOException
- {
- baos.write(i);
- }
- }
-
- public Locale getLocale()
- {
- return locale_;
- }
-
- public void setLocale(java.util.Locale loc)
- {
- locale_ = loc;
- }
-
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletResponse.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletResponse.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletResponse.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/main/java/org/exoplatform/test/mocks/servlet/MockServletResponse.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.mocks.servlet;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+
+/**
+ * Created by The eXo Platform SARL
+ * Author : Mestrallet Benjamin
+ * benjmestrallet(a)users.sourceforge.net
+ * Date: Jul 29, 2003
+ * Time: 6:54:45 PM
+ */
+public class MockServletResponse extends HttpServletResponseWrapper
+{
+
+ private PrintWriter tmpWriter;
+
+ private ByteArrayOutputStream output;
+
+ private ByteArrayServletOutputStream servletOutput;
+
+ private Locale locale_;
+
+ public MockServletResponse(HttpServletResponse httpServletResponse)
+ {
+ super(httpServletResponse);
+ output = new ByteArrayOutputStream();
+ tmpWriter = new PrintWriter(output);
+ servletOutput = new ByteArrayServletOutputStream(output);
+ }
+
+ public void finalize() throws Throwable
+ {
+ super.finalize();
+ servletOutput.close();
+ output.close();
+ tmpWriter.close();
+ }
+
+ public String getPortletContent()
+ {
+ String s = output.toString();
+ reset();
+ return s;
+ }
+
+ /*
+ public PrintWriter getWriter() throws IOException {
+ //return servletResponse.getWriter();
+ return tmpWriter;
+ }
+
+ public ServletOutputStream getOutputStream() throws IOException {
+ return servletOutput;
+ }
+ */
+
+ public byte[] toByteArray()
+ {
+ return output.toByteArray();
+ }
+
+ public String getOutputContent()
+ {
+ return new String(output.toByteArray());
+ }
+
+ public void flushBuffer() throws IOException
+ {
+ tmpWriter.flush();
+ servletOutput.flush();
+ }
+
+ public void reset()
+ {
+ output.reset();
+ }
+
+ public void close() throws IOException
+ {
+ tmpWriter.close();
+ }
+
+ private static class ByteArrayServletOutputStream extends ServletOutputStream
+ {
+ ByteArrayOutputStream baos;
+
+ public ByteArrayServletOutputStream(ByteArrayOutputStream baos)
+ {
+ this.baos = baos;
+ }
+
+ public void write(int i) throws IOException
+ {
+ baos.write(i);
+ }
+ }
+
+ public Locale getLocale()
+ {
+ return locale_;
+ }
+
+ public void setLocale(java.util.Locale loc)
+ {
+ locale_ = loc;
+ }
+
+}
Copied: junit.framework/tags/1.2.1-CR2/src/test (from rev 1786,
junit.framework/tags/1.2.1-CR2/src/test)
Copied: junit.framework/tags/1.2.1-CR2/src/test/java (from rev 1786,
junit.framework/tags/1.2.1-CR2/src/test/java)
Copied: junit.framework/tags/1.2.1-CR2/src/test/java/org (from rev 1786,
junit.framework/tags/1.2.1-CR2/src/test/java/org)
Copied: junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform (from rev 1786,
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform)
Copied: junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test (from rev 1786,
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test)
Copied: junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15 (from rev
1786, junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15)
Deleted:
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/Dummy.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/Dummy.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/Dummy.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.jvm15;
-
-/**
- * Apr 22, 2004
- * @author: Tuan Nguyen
- * @email: tuan08(a)users.sourceforge.net
- * @version: $Id: Dummy.java 5799 2006-05-28 17:55:42Z geaz $
- **/
-public class Dummy
-{
- private String str;
-
- public Dummy()
- {
- this.str = new String("test");
- }
-
- public void setter(String str)
- {
- this.str = str;
- }
-
- public String getter()
- {
- return this.str;
- }
-
- synchronized public String getterSynchronized()
- {
- return str;
- }
-
- synchronized public void setterSynchronized(String s)
- {
- str = s;
- }
-
- public void empty()
- {
- }
-}
\ No newline at end of file
Copied: junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/Dummy.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/Dummy.java)
===================================================================
--- junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/Dummy.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/Dummy.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.jvm15;
+
+/**
+ * Apr 22, 2004
+ * @author: Tuan Nguyen
+ * @email: tuan08(a)users.sourceforge.net
+ * @version: $Id: Dummy.java 5799 2006-05-28 17:55:42Z geaz $
+ **/
+public class Dummy
+{
+ private String str;
+
+ public Dummy()
+ {
+ this.str = new String("test");
+ }
+
+ public void setter(String str)
+ {
+ this.str = str;
+ }
+
+ public String getter()
+ {
+ return this.str;
+ }
+
+ synchronized public String getterSynchronized()
+ {
+ return str;
+ }
+
+ synchronized public void setterSynchronized(String s)
+ {
+ str = s;
+ }
+
+ public void empty()
+ {
+ }
+}
\ No newline at end of file
Deleted:
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/TestMemthodInvokation.java
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/TestMemthodInvokation.java 2010-02-12
16:44:20 UTC (rev 1786)
+++
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/TestMemthodInvokation.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -1,211 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.test.jvm15;
-
-import junit.framework.TestCase;
-import net.sf.cglib.reflect.FastClass;
-import net.sf.cglib.reflect.FastMethod;
-
-import java.lang.management.ManagementFactory;
-import java.lang.management.ThreadMXBean;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Apr 22, 2004
- * @author: Tuan Nguyen
- * @email: tuan08(a)users.sourceforge.net
- * @version: $Id: TestMemthodInvokation.java 5799 2006-05-28 17:55:42Z geaz $
- **/
-public class TestMemthodInvokation extends TestCase
-{
- private ThreadMXBean threadBean_;
-
- public TestMemthodInvokation()
- {
- threadBean_ = ManagementFactory.getThreadMXBean();
- }
-
- public void testBenchMark() throws Exception
- {
- for (int i = 0; i < 2; i++)
- {
- int loop = i * 5 + 10;
- singleInstruction(loop);
- emptyMethodCall(loop);
- directCall(loop);
- directSynchronizedCall(loop);
- newObject(loop);
- reflectionCall("setter", loop);
- reflectionCall("setterSynchronized", loop);
- reflectionMethodCall("setter", loop);
- reflectionMethodCall("setterSynchronized", loop);
- reflectionMethodCallCache("setter", loop);
- reflectionMethodCallCache("setterSynchronized", loop);
- reflectionMethodCallCGLIB("getter", loop);
- reflectionFastMethod("getter", loop);
-
System.out.println("===========================================================");
- }
- }
-
- private void singleInstruction(int numOfCall)
- {
- long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- for (int i = 0; i < numOfCall; i++)
- {
- int a = i;
- }
- long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- printInfo("singleInstruction()", numOfCall, start, end);
- }
-
- private void emptyMethodCall(int numOfCall)
- {
- Dummy dummy = new Dummy();
- long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- for (int i = 0; i < numOfCall; i++)
- {
- dummy.empty();
- }
- long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- printInfo("emptyMethodCall()", numOfCall, start, end);
- }
-
- private void directCall(int numOfCall)
- {
- Dummy dummy = new Dummy();
- long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- for (int i = 0; i < numOfCall; i++)
- {
- dummy.setter("dummy");
- }
- long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- printInfo("directCall()", numOfCall, start, end);
- }
-
- private void newObject(int numOfCall)
- {
- long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- for (int i = 0; i < numOfCall; i++)
- {
- Dummy dummy = new Dummy();
- }
- long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- printInfo("newObject()", numOfCall, start, end);
- }
-
- private void directSynchronizedCall(int numOfCall)
- {
- Dummy dummy = new Dummy();
- long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- for (int i = 0; i < numOfCall; i++)
- {
- dummy.setterSynchronized("dummy");
- }
- long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- printInfo("directSynchronizedCall()", numOfCall, start, end);
- }
-
- private void reflectionCall(String methodName, int numOfCall) throws Exception
- {
- Object dummy = new Dummy();
- long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- Class[] types = {String.class};
- Object[] args = {"dummy"};
- for (int i = 0; i < numOfCall; i++)
- {
- Method method = dummy.getClass().getMethod(methodName, types);
- method.invoke(dummy, args);
- }
- long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- printInfo("reflectionCall(), method: " + methodName, numOfCall, start,
end);
- }
-
- private void reflectionMethodCall(String methodName, int numOfCall) throws Exception
- {
- Dummy dummy = new Dummy();
- Method method = dummy.getClass().getMethod(methodName, new Class[]{String.class});
- Class[] types = {String.class};
- Object[] args = {"dummy"};
- long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- for (int i = 0; i < numOfCall; i++)
- {
- method.invoke(dummy, args);
- }
- long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- printInfo("reflectionMethodCall(), method: " + methodName, numOfCall,
start, end);
- }
-
- private void reflectionMethodCallCache(String methodName, int numOfCall) throws
Exception
- {
- Dummy dummy = new Dummy();
- Map map = new HashMap();
- Method method = dummy.getClass().getMethod(methodName, new Class[]{String.class});
- map.put(methodName, method);
- Object[] args = {"dummy"};
- long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- for (int i = 0; i < numOfCall; i++)
- {
- Method m = (Method)map.get(methodName);
- m.invoke(dummy, args);
- }
- long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- printInfo("reflectionCallMethodCache(), method: " + methodName,
numOfCall, start, end);
- }
-
- private void reflectionMethodCallCGLIB(String methodName, int numOfCall) throws
Exception
- {
- FastClass fc = FastClass.create(Dummy.class);
- Dummy dummy = new Dummy();
- Object[] args = {"dummy"};
- Class[] emptyType = {};
- Object[] emptyArgs = {};
- long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- for (int i = 0; i < numOfCall; i++)
- {
- fc.invoke(methodName, emptyType, dummy, emptyArgs);
- }
- long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- printInfo("reflectionCallMethodCGLIB(), method: " + methodName,
numOfCall, start, end);
- }
-
- private void reflectionFastMethod(String methodName, int numOfCall) throws Exception
- {
- Class[] emptyType = {};
- Object[] emptyArgs = {};
- FastClass fc = FastClass.create(Dummy.class);
- FastMethod fm = fc.getMethod(methodName, emptyType);
- Dummy dummy = new Dummy();
- Object[] args = {"dummy"};
- long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- for (int i = 0; i < numOfCall; i++)
- {
- Object o = fm.invoke(dummy, null);
- }
- long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
- printInfo("reflectionFastMethod(), method: " + methodName, numOfCall,
start, end);
- }
-
- private void printInfo(String method, int numOfCall, long start, long end)
- {
- System.out.println("Call method " + method + " " + numOfCall +
" times in " + ((double)(end - start))
- / (1000 * 1000) + "ms");
- }
-}
Copied:
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/TestMemthodInvokation.java
(from rev 1786,
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/TestMemthodInvokation.java)
===================================================================
---
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/TestMemthodInvokation.java
(rev 0)
+++
junit.framework/tags/1.2.1-CR2/src/test/java/org/exoplatform/test/jvm15/TestMemthodInvokation.java 2010-02-15
16:56:01 UTC (rev 1827)
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.test.jvm15;
+
+import junit.framework.TestCase;
+import net.sf.cglib.reflect.FastClass;
+import net.sf.cglib.reflect.FastMethod;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.ThreadMXBean;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Apr 22, 2004
+ * @author: Tuan Nguyen
+ * @email: tuan08(a)users.sourceforge.net
+ * @version: $Id: TestMemthodInvokation.java 5799 2006-05-28 17:55:42Z geaz $
+ **/
+public class TestMemthodInvokation extends TestCase
+{
+ private ThreadMXBean threadBean_;
+
+ public TestMemthodInvokation()
+ {
+ threadBean_ = ManagementFactory.getThreadMXBean();
+ }
+
+ public void testBenchMark() throws Exception
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ int loop = i * 5 + 10;
+ singleInstruction(loop);
+ emptyMethodCall(loop);
+ directCall(loop);
+ directSynchronizedCall(loop);
+ newObject(loop);
+ reflectionCall("setter", loop);
+ reflectionCall("setterSynchronized", loop);
+ reflectionMethodCall("setter", loop);
+ reflectionMethodCall("setterSynchronized", loop);
+ reflectionMethodCallCache("setter", loop);
+ reflectionMethodCallCache("setterSynchronized", loop);
+ reflectionMethodCallCGLIB("getter", loop);
+ reflectionFastMethod("getter", loop);
+
System.out.println("===========================================================");
+ }
+ }
+
+ private void singleInstruction(int numOfCall)
+ {
+ long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ for (int i = 0; i < numOfCall; i++)
+ {
+ int a = i;
+ }
+ long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ printInfo("singleInstruction()", numOfCall, start, end);
+ }
+
+ private void emptyMethodCall(int numOfCall)
+ {
+ Dummy dummy = new Dummy();
+ long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ for (int i = 0; i < numOfCall; i++)
+ {
+ dummy.empty();
+ }
+ long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ printInfo("emptyMethodCall()", numOfCall, start, end);
+ }
+
+ private void directCall(int numOfCall)
+ {
+ Dummy dummy = new Dummy();
+ long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ for (int i = 0; i < numOfCall; i++)
+ {
+ dummy.setter("dummy");
+ }
+ long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ printInfo("directCall()", numOfCall, start, end);
+ }
+
+ private void newObject(int numOfCall)
+ {
+ long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ for (int i = 0; i < numOfCall; i++)
+ {
+ Dummy dummy = new Dummy();
+ }
+ long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ printInfo("newObject()", numOfCall, start, end);
+ }
+
+ private void directSynchronizedCall(int numOfCall)
+ {
+ Dummy dummy = new Dummy();
+ long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ for (int i = 0; i < numOfCall; i++)
+ {
+ dummy.setterSynchronized("dummy");
+ }
+ long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ printInfo("directSynchronizedCall()", numOfCall, start, end);
+ }
+
+ private void reflectionCall(String methodName, int numOfCall) throws Exception
+ {
+ Object dummy = new Dummy();
+ long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ Class[] types = {String.class};
+ Object[] args = {"dummy"};
+ for (int i = 0; i < numOfCall; i++)
+ {
+ Method method = dummy.getClass().getMethod(methodName, types);
+ method.invoke(dummy, args);
+ }
+ long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ printInfo("reflectionCall(), method: " + methodName, numOfCall, start,
end);
+ }
+
+ private void reflectionMethodCall(String methodName, int numOfCall) throws Exception
+ {
+ Dummy dummy = new Dummy();
+ Method method = dummy.getClass().getMethod(methodName, new Class[]{String.class});
+ Class[] types = {String.class};
+ Object[] args = {"dummy"};
+ long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ for (int i = 0; i < numOfCall; i++)
+ {
+ method.invoke(dummy, args);
+ }
+ long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ printInfo("reflectionMethodCall(), method: " + methodName, numOfCall,
start, end);
+ }
+
+ private void reflectionMethodCallCache(String methodName, int numOfCall) throws
Exception
+ {
+ Dummy dummy = new Dummy();
+ Map map = new HashMap();
+ Method method = dummy.getClass().getMethod(methodName, new Class[]{String.class});
+ map.put(methodName, method);
+ Object[] args = {"dummy"};
+ long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ for (int i = 0; i < numOfCall; i++)
+ {
+ Method m = (Method)map.get(methodName);
+ m.invoke(dummy, args);
+ }
+ long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ printInfo("reflectionCallMethodCache(), method: " + methodName,
numOfCall, start, end);
+ }
+
+ private void reflectionMethodCallCGLIB(String methodName, int numOfCall) throws
Exception
+ {
+ FastClass fc = FastClass.create(Dummy.class);
+ Dummy dummy = new Dummy();
+ Object[] args = {"dummy"};
+ Class[] emptyType = {};
+ Object[] emptyArgs = {};
+ long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ for (int i = 0; i < numOfCall; i++)
+ {
+ fc.invoke(methodName, emptyType, dummy, emptyArgs);
+ }
+ long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ printInfo("reflectionCallMethodCGLIB(), method: " + methodName,
numOfCall, start, end);
+ }
+
+ private void reflectionFastMethod(String methodName, int numOfCall) throws Exception
+ {
+ Class[] emptyType = {};
+ Object[] emptyArgs = {};
+ FastClass fc = FastClass.create(Dummy.class);
+ FastMethod fm = fc.getMethod(methodName, emptyType);
+ Dummy dummy = new Dummy();
+ Object[] args = {"dummy"};
+ long start = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ for (int i = 0; i < numOfCall; i++)
+ {
+ Object o = fm.invoke(dummy, null);
+ }
+ long end = threadBean_.getThreadCpuTime(Thread.currentThread().getId());
+ printInfo("reflectionFastMethod(), method: " + methodName, numOfCall,
start, end);
+ }
+
+ private void printInfo(String method, int numOfCall, long start, long end)
+ {
+ System.out.println("Call method " + method + " " + numOfCall +
" times in " + ((double)(end - start))
+ / (1000 * 1000) + "ms");
+ }
+}