[jboss-cvs] JBossAS SVN: r75572 - in branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src: main/org/jboss/test/cluster/web and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jul 9 22:31:43 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-07-09 22:31:43 -0400 (Wed, 09 Jul 2008)
New Revision: 75572
Added:
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/AttributeBasedMaxUnreplicatedIntervalTestCase.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/FieldBasedMaxUnreplicatedIntervalTestCase.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/JBossWebXmlParsingTestCase.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/SessionBasedMaxUnreplicatedIntervalTestCase.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/BasicRequestHandler.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/CacheConfigTestSetup.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockContainer.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockEngine.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockHost.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockLoader.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockRequest.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockValve.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MutableObject.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/RequestHandler.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/RequestHandlerValve.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/SetAttributesRequestHandler.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/WebSessionTestUtil.java
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/http-sr/
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/http-sr/WEB-INF/
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/http-sr/WEB-INF/jboss-web.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/http-sr/WEB-INF/web.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/jboss-web-test-service.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/version.jsp
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-attr.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-batch-false.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-bogus.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-default.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-empty.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-field.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-no-max.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-set-and-get.xml
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-set.xml
Removed:
branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/web.xml
Log:
[JBPAPP-947] Default maxUnreplicatedInterval to 60 secs; make configurable
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/AttributeBasedMaxUnreplicatedIntervalTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/AttributeBasedMaxUnreplicatedIntervalTestCase.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/AttributeBasedMaxUnreplicatedIntervalTestCase.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,143 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.test;
+
+import junit.framework.Test;
+
+import org.jboss.metadata.WebMetaData;
+import org.jboss.test.cluster.web.util.BasicRequestHandler;
+import org.jboss.test.cluster.web.util.CacheConfigTestSetup;
+import org.jboss.test.cluster.web.util.SetAttributesRequestHandler;
+import org.jboss.test.cluster.web.util.WebSessionTestUtil;
+import org.jboss.web.tomcat.service.session.JBossCacheManager;
+
+/**
+ * Tests of handling of ClusteredSession.maxUnreplicatedInterval. This version
+ * is run with ATTRIBUTE granularity.
+ *
+ * @author Brian Stansberry
+ *
+ */
+public class AttributeBasedMaxUnreplicatedIntervalTestCase
+ extends SessionBasedMaxUnreplicatedIntervalTestCase
+{
+ public AttributeBasedMaxUnreplicatedIntervalTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return CacheConfigTestSetup.getTestSetup(AttributeBasedMaxUnreplicatedIntervalTestCase.class, pojoCaches, false, !useBuddyRepl, false);
+ }
+
+ protected int getReplicationGranularity()
+ {
+ return WebMetaData.REPLICATION_GRANULARITY_ATTRIBUTE;
+ }
+
+ /**
+ * A test of the "grace period" that maxUnreplicatedInterval adds to the
+ * removal of overaged unloaded sessions in remote caches. Confirms that a
+ * session still in the "grace period" doesn't have its cache structure
+ * removed.
+ *
+ * @throws Exception
+ */
+ public void testMaxIntervalPreventsLossOfRemoteState() throws Exception
+ {
+ log.info("++++ Starting testMaxIntervalPreventsLossOfRemoteState ++++");
+
+ String warname = String.valueOf(++testId);
+
+ // A war with a maxInactive of 3 secs and a maxUnreplicated of 1
+ JBossCacheManager[] mgrs = getCacheManagers(warname, 3, 1);
+ JBossCacheManager jbcm0 = mgrs[0];
+ JBossCacheManager jbcm1 = mgrs[1];
+
+ SetAttributesRequestHandler setHandler = new SetAttributesRequestHandler(allAttributes, false);
+ WebSessionTestUtil.invokeRequest(jbcm0, setHandler, null);
+
+ validateNewSession(setHandler);
+
+ Thread.sleep(250);
+
+ // Now make a request that will not trigger replication but keeps the jbcm0 session alive
+ BasicRequestHandler getHandler = new BasicRequestHandler(immutables.keySet(), false);
+ WebSessionTestUtil.invokeRequest(jbcm0, getHandler, setHandler.getSessionId());
+
+ validateExpectedAttributes(immutables, getHandler);
+
+ // Sleep long enough that the session will be expired on other server
+ // if it doesn't have a maxUnreplicatedInterval grace period
+ Thread.sleep(2800);
+
+ // jbcm1 considers the session unmodified for > 3 sec maxInactiveInterval.
+ // Try to drive the session out of the jbcm1 cache
+ jbcm1.backgroundProcess();
+
+ // Replicate just one attribute; see if the other is still in jbcm1
+ SetAttributesRequestHandler modifyHandler = new SetAttributesRequestHandler(mutables, false);
+ WebSessionTestUtil.invokeRequest(jbcm0, modifyHandler, setHandler.getSessionId());
+
+ // Fail over and confirm all is well. If the session was removed,
+ // the last replication of just one attribute won't restore all
+ // attributes and we'll have a failure
+ getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
+ WebSessionTestUtil.invokeRequest(jbcm1, getHandler, setHandler.getSessionId());
+
+ validateExpectedAttributes(allAttributes, getHandler);
+ }
+
+ public void testDisabledMaxIntervalReplicatesOnDirtyAttribute() throws Exception
+ {
+ log.info("++++ Starting testDisabledMaxIntervalReplicatesOnDirtyAttribute ++++");
+
+ String warname = String.valueOf(++testId);
+
+ // A war with a maxInactive of 2 secs and a maxUnreplicated of -1
+ JBossCacheManager[] mgrs = getCacheManagers(warname, 2, -1);
+ JBossCacheManager jbcm0 = mgrs[0];
+ JBossCacheManager jbcm1 = mgrs[1];
+
+ SetAttributesRequestHandler setHandler = new SetAttributesRequestHandler(allAttributes, false);
+ WebSessionTestUtil.invokeRequest(jbcm0, setHandler, null);
+
+ validateNewSession(setHandler);
+
+ Thread.sleep(250);
+
+ SetAttributesRequestHandler modifyHandler = new SetAttributesRequestHandler(mutables, false);
+ WebSessionTestUtil.invokeRequest(jbcm0, modifyHandler, setHandler.getSessionId());
+
+ Thread.sleep(1760);
+
+ // Fail over and confirm all is well
+ BasicRequestHandler getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
+ WebSessionTestUtil.invokeRequest(jbcm1, getHandler, setHandler.getSessionId());
+
+ validateExpectedAttributes(allAttributes, getHandler);
+
+ }
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/FieldBasedMaxUnreplicatedIntervalTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/FieldBasedMaxUnreplicatedIntervalTestCase.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/FieldBasedMaxUnreplicatedIntervalTestCase.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.test;
+
+import junit.framework.Test;
+
+import org.jboss.metadata.WebMetaData;
+import org.jboss.test.cluster.web.util.CacheConfigTestSetup;
+
+/**
+ * Tests of handling of ClusteredSession.maxUnreplicatedInterval. This version
+ * is run with FIELD granularity.
+ *
+ * @author Brian Stansberry
+ */
+public class FieldBasedMaxUnreplicatedIntervalTestCase
+ extends AttributeBasedMaxUnreplicatedIntervalTestCase
+{
+ /**
+ * Create a new MaxUnreplicatedIntervalTestCase.
+ *
+ * @param name
+ */
+ public FieldBasedMaxUnreplicatedIntervalTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return CacheConfigTestSetup.getTestSetup(FieldBasedMaxUnreplicatedIntervalTestCase.class, pojoCaches, false, !useBuddyRepl, true);
+ }
+
+ protected int getReplicationGranularity()
+ {
+ return WebMetaData.REPLICATION_GRANULARITY_FIELD;
+ }
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/JBossWebXmlParsingTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/JBossWebXmlParsingTestCase.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/JBossWebXmlParsingTestCase.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,183 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.test;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.test.JBossTestCase;
+import org.w3c.dom.Document;
+
+/**
+ * Tests parsing of the replication-config elements in a jboss-web.xml.
+ *
+ * @author Brian Stansberry
+ */
+public class JBossWebXmlParsingTestCase extends JBossTestCase
+{
+ private static final String RESOURCE_ROOT = "cluster/http/xmlparsing/";
+ private static final String ATTRIBUTE = RESOURCE_ROOT + "jboss-web-attr.xml";
+ private static final String BATCH_FALSE = RESOURCE_ROOT + "jboss-web-batch-false.xml";
+ private static final String BOGUS = RESOURCE_ROOT + "jboss-web-bogus.xml";
+ private static final String DEFAULT = RESOURCE_ROOT + "jboss-web-default.xml";
+ private static final String EMPTY = RESOURCE_ROOT + "jboss-web-empty.xml";
+ private static final String FIELD = RESOURCE_ROOT + "jboss-web-field.xml";
+ private static final String NO_MAX = RESOURCE_ROOT + "jboss-web-no-max.xml";
+ private static final String SET = RESOURCE_ROOT + "jboss-web-set.xml";
+ private static final String SET_AND_GET = RESOURCE_ROOT + "jboss-web-set-and-get.xml";
+
+ private static enum Element { GRAN, TRIGGER, BATCH, MAX };
+
+ /**
+ * Create a new JBossWebXmlParsingTestCase.
+ *
+ * @param name
+ */
+ public JBossWebXmlParsingTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testDefault() throws Exception
+ {
+ WebMetaData metadata = getWebMetaData(DEFAULT);
+ assertEquals("Max unreplicated", new Integer(WebMetaData.DEFAULT_MAX_UNREPLICATED_INTERVAL), metadata.getMaxUnreplicatedInterval());
+ defaultCheck(metadata, Element.MAX);
+ }
+
+ public void testEmpty() throws Exception
+ {
+ WebMetaData metadata = getWebMetaData(EMPTY);
+ defaultCheck(metadata);
+ }
+
+ public void testBogus() throws Exception
+ {
+ try
+ {
+ getWebMetaData(BOGUS);
+ fail("Bogus config did not throw DeploymentException");
+ }
+ catch (DeploymentException expected) {}
+ }
+
+ public void testAttributeGranularity() throws Exception
+ {
+ WebMetaData metadata = getWebMetaData(ATTRIBUTE);
+ assertEquals("Granularity", WebMetaData.REPLICATION_GRANULARITY_ATTRIBUTE, metadata.getReplicationGranularity());
+ defaultCheck(metadata, Element.GRAN);
+ }
+
+ public void testFieldGranularity() throws Exception
+ {
+ WebMetaData metadata = getWebMetaData(FIELD);
+ assertEquals("Granularity", WebMetaData.REPLICATION_GRANULARITY_FIELD, metadata.getReplicationGranularity());
+ defaultCheck(metadata, Element.GRAN);
+ }
+
+ public void testSetTrigger() throws Exception
+ {
+ WebMetaData metadata = getWebMetaData(SET);
+ assertEquals("Trigger", WebMetaData.SESSION_INVALIDATE_SET, metadata.getInvalidateSessionPolicy());
+ defaultCheck(metadata, Element.TRIGGER);
+ }
+
+ public void testSetAndGetTrigger() throws Exception
+ {
+ WebMetaData metadata = getWebMetaData(SET_AND_GET);
+ assertEquals("Trigger", WebMetaData.SESSION_INVALIDATE_SET_AND_GET, metadata.getInvalidateSessionPolicy());
+ defaultCheck(metadata, Element.TRIGGER);
+ }
+
+ public void testBatchModeFalse() throws Exception
+ {
+ WebMetaData metadata = getWebMetaData(BATCH_FALSE);
+ assertFalse("Batch mode", metadata.getReplicationFieldBatchMode());
+ defaultCheck(metadata, Element.BATCH);
+ }
+
+ public void testMaxUnreplicatedInterval() throws Exception
+ {
+ WebMetaData metadata = getWebMetaData(NO_MAX);
+ assertEquals("Max unreplicated", new Integer(-1), metadata.getMaxUnreplicatedInterval());
+ defaultCheck(metadata, Element.MAX);
+ }
+
+ private WebMetaData getWebMetaData(String resourcePath)
+ throws Exception
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ URL webxml = cl.getResource(resourcePath);
+ assertNotNull("web.xml exists?", webxml);
+ return getWebMetaData(webxml.openStream());
+ }
+
+ private WebMetaData getWebMetaData(InputStream webxml)
+ throws Exception
+ {
+ WebMetaData wmd = new WebMetaData();
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ Document doc = factory.newDocumentBuilder().parse(webxml);
+ wmd.importXml(doc.getDocumentElement());
+ return wmd;
+ }
+
+ private void defaultCheck(WebMetaData metadata)
+ {
+ Set<Element> set = new HashSet<Element>();
+ defaultCheck(metadata, set);
+ }
+
+ private void defaultCheck(WebMetaData metadata, Element ignore)
+ {
+ Set<Element> set = new HashSet<Element>();
+ set.add(ignore);
+ defaultCheck(metadata, set);
+ }
+
+ private void defaultCheck(WebMetaData metadata, Set<Element> ignore)
+ {
+ if (!ignore.contains(Element.GRAN))
+ {
+ assertEquals("Granularity", WebMetaData.REPLICATION_GRANULARITY_SESSION, metadata.getReplicationGranularity());
+ }
+ if (!ignore.contains(Element.TRIGGER))
+ {
+ assertEquals("Trigger", WebMetaData.SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET, metadata.getInvalidateSessionPolicy());
+ }
+ if (!ignore.contains(Element.BATCH))
+ {
+ assertTrue("Batch mode", metadata.getReplicationFieldBatchMode());
+ }
+ if (!ignore.contains(Element.MAX))
+ {
+ assertEquals("Max unreplicated", null, metadata.getMaxUnreplicatedInterval());
+ }
+ }
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/SessionBasedMaxUnreplicatedIntervalTestCase.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/SessionBasedMaxUnreplicatedIntervalTestCase.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/test/SessionBasedMaxUnreplicatedIntervalTestCase.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,299 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.test;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import junit.framework.Test;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.aop.PojoCache;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.cluster.web.util.BasicRequestHandler;
+import org.jboss.test.cluster.web.util.CacheConfigTestSetup;
+import org.jboss.test.cluster.web.util.MutableObject;
+import org.jboss.test.cluster.web.util.SetAttributesRequestHandler;
+import org.jboss.test.cluster.web.util.WebSessionTestUtil;
+import org.jboss.web.tomcat.service.session.JBossCacheManager;
+import org.jboss.web.tomcat.service.session.JBossCacheService;
+
+/**
+ * Tests of handling of ClusteredSession.maxUnreplicatedInterval. This base
+ * test is run with SESSION granularity.
+ *
+ * @author Brian Stansberry
+ */
+public class SessionBasedMaxUnreplicatedIntervalTestCase extends JBossTestCase
+{
+ protected static PojoCache[] pojoCaches = new PojoCache[2];
+
+ protected static long testId = System.currentTimeMillis();
+
+ protected static boolean useBuddyRepl = Boolean.valueOf(System.getProperty("jbosstest.cluster.web.cache.br")).booleanValue();
+
+ protected Logger log = Logger.getLogger(getClass());
+
+ protected Set<JBossCacheManager> managers = new HashSet<JBossCacheManager>();
+
+ protected Map<String, Object> allAttributes;
+ protected Map<String, Object> immutables;
+ protected Map<String, Object> mutables;
+
+ public SessionBasedMaxUnreplicatedIntervalTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite() throws Exception
+ {
+ return CacheConfigTestSetup.getTestSetup(SessionBasedMaxUnreplicatedIntervalTestCase.class, pojoCaches, false, !useBuddyRepl, false);
+ }
+
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ allAttributes = new HashMap<String, Object>();
+ immutables = new HashMap<String, Object>();
+ mutables = new HashMap<String, Object>();
+
+ allAttributes.put("IMMUTABLE", "IMMUTABLE");
+ immutables.put("IMMUTABLE", "IMMUTABLE");
+
+ MutableObject mo = new MutableObject("MUTABLE");
+ allAttributes.put("MUTABLE", mo);
+ mutables.put("MUTABLE", mo);
+
+ allAttributes = Collections.unmodifiableMap(allAttributes);
+ immutables = Collections.unmodifiableMap(immutables);
+ mutables = Collections.unmodifiableMap(mutables);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+
+ for (JBossCacheManager manager : managers)
+ manager.stop();
+
+ managers.clear();
+ }
+
+ protected int getReplicationGranularity()
+ {
+ return WebMetaData.REPLICATION_GRANULARITY_SESSION;
+ }
+
+ protected int getReplicationTrigger()
+ {
+ return WebMetaData.SESSION_INVALIDATE_SET_AND_NON_PRIMITIVE_GET;
+ }
+
+ public void testBasicMaxIntervalPreventsExpiration() throws Exception
+ {
+ log.info("++++ Starting testBasicMaxIntervalPreventsExpiration ++++");
+
+ maxIntervalPreventsExpirationTest(false);
+ }
+
+ public void testZeroMaxIntervalPreventsExpiration() throws Exception
+ {
+ log.info("++++ Starting testZeroMaxIntervalPreventsExpiration ++++");
+
+ maxIntervalPreventsExpirationTest(false);
+ }
+
+ private void maxIntervalPreventsExpirationTest(boolean testZero) throws Exception
+ {
+ String warname = String.valueOf(++testId);
+
+ int maxUnrep = testZero ? 0 : 1;
+
+ // A war with a maxInactive of 3 secs and a maxUnreplicated of 0 or 1
+ JBossCacheManager[] mgrs = getCacheManagers(warname, 3, maxUnrep);
+ JBossCacheManager jbcm0 = mgrs[0];
+ JBossCacheManager jbcm1 = mgrs[1];
+
+ SetAttributesRequestHandler setHandler = new SetAttributesRequestHandler(allAttributes, false);
+ WebSessionTestUtil.invokeRequest(jbcm0, setHandler, null);
+
+ validateNewSession(setHandler);
+
+ Thread.sleep(1050);
+
+ // Now make a request that will not trigger replication unless the interval is exceeded
+ BasicRequestHandler getHandler = new BasicRequestHandler(immutables.keySet(), false);
+ WebSessionTestUtil.invokeRequest(jbcm0, getHandler, setHandler.getSessionId());
+
+ validateExpectedAttributes(immutables, getHandler);
+
+ // Sleep long enough that the session will be expired on other server
+ // if previous request didn't keep it alive
+ Thread.sleep(2000);
+
+ // Fail over and confirm all is well
+ getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
+ WebSessionTestUtil.invokeRequest(jbcm1, getHandler, setHandler.getSessionId());
+
+ validateExpectedAttributes(allAttributes, getHandler);
+ }
+
+ public void testMaxIntervalPreventsReplication() throws Exception
+ {
+ log.info("++++ Starting testMaxIntervalPreventsReplication ++++");
+
+ String warname = String.valueOf(++testId);
+
+ // A war with a maxInactive of 3 secs and a maxUnreplicated of 1
+ JBossCacheManager[] mgrs = getCacheManagers(warname, 3, 1);
+ JBossCacheManager jbcm0 = mgrs[0];
+ JBossCacheManager jbcm1 = mgrs[1];
+
+ SetAttributesRequestHandler setHandler = new SetAttributesRequestHandler(allAttributes, false);
+ WebSessionTestUtil.invokeRequest(jbcm0, setHandler, null);
+
+ // Sleep less than the maxUnreplicated time so next request shouldn't trigger timestamp repl
+ Thread.sleep(900);
+
+ // Now make a request that will not trigger replication unless the interval is exceeded
+ BasicRequestHandler getHandler = new BasicRequestHandler(immutables.keySet(), false);
+ WebSessionTestUtil.invokeRequest(jbcm0, getHandler, setHandler.getSessionId());
+
+ validateExpectedAttributes(immutables, getHandler);
+
+ // Sleep long enough that the session will be expired on other server
+ // if previous request didn't keep it alive
+ Thread.sleep(2150);
+
+ // Fail over and confirm the session was expired
+ getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
+ WebSessionTestUtil.invokeRequest(jbcm1, getHandler, setHandler.getSessionId());
+
+ validateNewSession(getHandler);
+ }
+
+ /**
+ * Confirms that the "grace period" that maxUnreplicatedInterval adds to the
+ * removal of overaged unloaded sessions in remote caches delays their
+ * removal.
+ *
+ * @throws Exception
+ */
+ public void testRemoteExpirationGracePeriod() throws Exception
+ {
+ log.info("++++ Starting testRemoteExpirationGracePeriod ++++");
+
+ String warname = String.valueOf(++testId);
+
+ JBossCacheManager[] mgrs = getCacheManagers(warname, 3, 2);
+ JBossCacheManager jbcm0 = mgrs[0];
+ JBossCacheManager jbcm1 = mgrs[1];
+
+ SetAttributesRequestHandler setHandler1 = new SetAttributesRequestHandler(allAttributes, false);
+ WebSessionTestUtil.invokeRequest(jbcm0, setHandler1, null);
+
+ Fqn session1Fqn = Fqn.fromString("/JSESSION/localhost/" + warname + "/" + setHandler1.getSessionId());
+
+ SetAttributesRequestHandler setHandler2 = new SetAttributesRequestHandler(allAttributes, false);
+ WebSessionTestUtil.invokeRequest(jbcm0, setHandler2, null);
+
+ Fqn session2Fqn = Fqn.fromString("/JSESSION/localhost/" + warname + "/" + setHandler2.getSessionId());
+
+ // Overage the sessions
+ Thread.sleep(3010);
+ // Try to force out the overaged sessions
+ jbcm1.backgroundProcess();
+ // Confirm they are still there
+ assertNotNull(pojoCaches[1].get(session1Fqn, JBossCacheService.VERSION_KEY));
+ assertNotNull(pojoCaches[1].get(session2Fqn, JBossCacheService.VERSION_KEY));
+
+ // Access one to prove it gets expired once the manager can see its real timestamp
+ BasicRequestHandler getHandler = new BasicRequestHandler(allAttributes.keySet(), false);
+ WebSessionTestUtil.invokeRequest(jbcm1, getHandler, setHandler1.getSessionId());
+ validateNewSession(getHandler);
+
+ // Sleep past the grace period
+ Thread.sleep(2010);
+ // The get restored a new fresh session with the first id, but the 2nd
+ // one is still there and overaged. Try to force it out
+ jbcm1.backgroundProcess();
+ assertNull(pojoCaches[1].get(session2Fqn, JBossCacheService.VERSION_KEY));
+ }
+
+ protected JBossCacheManager[] getCacheManagers(String warname, int maxInactive, int maxUnreplicated)
+ throws Exception
+ {
+ JBossCacheManager jbcm0 = WebSessionTestUtil.createManager(warname, maxInactive, pojoCaches[0], null);
+ WebMetaData metadata = WebSessionTestUtil.getWebMetaData(getReplicationGranularity(), getReplicationTrigger(), true, maxUnreplicated);
+ jbcm0.init(warname, metadata, false, true);
+ this.managers.add(jbcm0);
+ jbcm0.start();
+
+ JBossCacheManager jbcm1 = WebSessionTestUtil.createManager(warname, maxInactive, pojoCaches[1], null);
+ metadata = WebSessionTestUtil.getWebMetaData(getReplicationGranularity(), getReplicationTrigger(), true, maxUnreplicated);
+ jbcm1.init(warname, metadata, false, true);
+ this.managers.add(jbcm1);
+ jbcm1.start();
+
+ return new JBossCacheManager[]{jbcm0, jbcm1};
+ }
+
+ protected void validateExpectedAttributes(Map<String, Object> expected, BasicRequestHandler handler)
+ {
+ assertFalse(handler.isNewSession());
+
+ if (handler.isCheckAttributeNames())
+ {
+ assertEquals(expected.size(), handler.getAttributeNames().size());
+ }
+ Map<String, Object> checked = handler.getCheckedAttributes();
+ assertEquals(expected.size(), checked.size());
+ for (Map.Entry<String, Object> entry : checked.entrySet())
+ assertEquals(entry.getKey(), expected.get(entry.getKey()), entry.getValue());
+
+ }
+
+ protected void validateNewSession(BasicRequestHandler handler)
+ {
+ assertTrue(handler.isNewSession());
+ assertEquals(handler.getCreationTime(), handler.getLastAccessedTime());
+ if (handler.isCheckAttributeNames())
+ {
+ assertEquals(0, handler.getAttributeNames().size());
+ }
+ Map<String, Object> checked = handler.getCheckedAttributes();
+ for (Map.Entry<String, Object> entry : checked.entrySet())
+ assertNull(entry.getKey(), entry.getValue());
+ }
+
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/BasicRequestHandler.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/BasicRequestHandler.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/BasicRequestHandler.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.HttpSession;
+
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public class BasicRequestHandler implements RequestHandler
+{
+ private Set<String> namesToCheck = new HashSet<String>();
+ private boolean checkAttributeNames;
+ private Map<String, Object> checkedAttributes = new HashMap<String, Object>();
+ private Set<String> attributeNames = new HashSet<String>();
+ private String sessionId;
+ private long lastAccessedTime;
+ private int maxInactiveInterval;
+ private long creationTime;
+ private boolean newSession;
+ private HttpSession session;
+
+ /**
+ * Create a new AbstractRequestHandler.
+ *
+ */
+ public BasicRequestHandler(Set<String> toCheck, boolean checkNames)
+ {
+ if (toCheck != null)
+ this.namesToCheck.addAll(toCheck);
+ this.checkAttributeNames = checkNames;
+ }
+
+ public void handleRequest(Request request, Response response)
+ {
+ this.session = request.getSession();
+ this.sessionId = session.getId();
+ this.lastAccessedTime = session.getLastAccessedTime();
+ this.maxInactiveInterval = session.getMaxInactiveInterval();
+ this.newSession = session.isNew();
+ this.creationTime = session.getCreationTime();
+
+ if (this.checkAttributeNames)
+ {
+ Enumeration<String> e = session.getAttributeNames();
+ while (e.hasMoreElements())
+ attributeNames.add(e.nextElement());
+ }
+
+ if (namesToCheck != null)
+ {
+ for (String name : namesToCheck)
+ {
+ checkedAttributes.put(name, session.getAttribute(name));
+ }
+ }
+ }
+
+ public String getSessionId()
+ {
+ return sessionId;
+ }
+
+ public long getLastAccessedTime()
+ {
+ return lastAccessedTime;
+ }
+
+ public int getMaxInactiveInterval()
+ {
+ return maxInactiveInterval;
+ }
+
+ public boolean isNewSession()
+ {
+ return newSession;
+ }
+
+ public long getCreationTime()
+ {
+ return creationTime;
+ }
+
+ public Map<String, Object> getCheckedAttributes()
+ {
+ return checkedAttributes;
+ }
+
+ public Set<String> getAttributeNames()
+ {
+ return attributeNames;
+ }
+
+ public HttpSession getSession()
+ {
+ return session;
+ }
+
+ public boolean isCheckAttributeNames()
+ {
+ return checkAttributeNames;
+ }
+
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/CacheConfigTestSetup.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/CacheConfigTestSetup.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/CacheConfigTestSetup.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import java.net.InetAddress;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.cache.aop.PojoCache;
+import org.jboss.logging.Logger;
+import org.jboss.test.JBossTestSetup;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public class CacheConfigTestSetup extends JBossTestSetup
+{
+ private static final Logger log = Logger.getLogger(CacheConfigTestSetup.class);
+
+ public static Test getTestSetup(Class clazz, final PojoCache[] caches, final boolean local, final boolean totalReplication, final boolean marshalling)
+ throws Exception
+ {
+ final TestSuite suite = new TestSuite();
+ suite.addTest(new TestSuite(clazz));
+ return new CacheConfigTestSetup(suite, caches, local, totalReplication, marshalling);
+ }
+
+ private PojoCache[] pojoCaches;
+ private boolean local;
+ private boolean totalReplication;
+ private boolean marshalling;
+
+ /**
+ * Create a new CacheConfigTestSetup.
+ *
+ * @param test
+ * @throws Exception
+ */
+ public CacheConfigTestSetup(Test test, PojoCache[] caches, boolean local, boolean totalReplication, final boolean marshalling) throws Exception
+ {
+ super(test);
+ this.pojoCaches = caches;
+ this.local = local;
+ this.totalReplication = totalReplication;
+ this.marshalling = marshalling;
+ }
+
+ protected void setUp() throws Exception
+ {
+ if (pojoCaches == null) return;
+ String bind_addr = System.getProperty("jgroups.bind_addr");
+ String mcast_addr = System.getProperty("jgroups.udp.mcast_addr");
+ String mcast_port = System.getProperty("jgroups.udp.mcast_port");
+
+ try
+ {
+ System.setProperty("jgroups.bind_addr", System.getProperty("jbosstest.cluster.node1", InetAddress.getLocalHost().getHostAddress()));
+ String udpGroup = System.getProperty("jbosstest.udpGroup", "233.54.54.54");
+ if (udpGroup.trim().length() ==0)
+ udpGroup = "233.54.54.54";
+ System.setProperty("jgroups.udp.mcast_addr", udpGroup);
+ System.setProperty("jgroups.udp.mcast_port", String.valueOf(54545));
+
+ for (int i = 0; i < pojoCaches.length; i++)
+ {
+ pojoCaches[i] = WebSessionTestUtil.createCache(local, totalReplication, marshalling, null);
+ }
+ }
+ finally
+ {
+ if (bind_addr == null)
+ System.clearProperty("jgroups.bind_addr");
+ else
+ System.setProperty("jgroups.bind_addr", bind_addr);
+ if (mcast_addr == null)
+ System.clearProperty("jgroups.udp.mcast_addr");
+ else
+ System.setProperty("jgroups.udp.mcast_addr", mcast_addr);
+ if (mcast_port == null)
+ System.clearProperty("jgroups.udp.mcast_port");
+ else
+ System.setProperty("jgroups.udp.mcast_port", mcast_port);
+ }
+
+ // wait a few seconds so that the cluster stabilize
+ synchronized (this)
+ {
+ wait(2000);
+ }
+ }
+
+ protected void tearDown() throws Exception
+ {
+ if (pojoCaches != null)
+ {
+ for (int i = 0; i < pojoCaches.length; i++)
+ {
+ try
+ {
+ PojoCache pc = pojoCaches[i];
+ pojoCaches[i] = null;
+ pc.stop();
+ pc.destroy();
+ }
+ catch (Exception ex)
+ {
+ log.error("Failed stopping cache " + i);
+ }
+ }
+ }
+ }
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockContainer.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockContainer.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockContainer.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import org.apache.catalina.Loader;
+import org.apache.catalina.Pipeline;
+import org.apache.catalina.core.ContainerBase;
+import org.apache.catalina.core.StandardPipeline;
+import org.jboss.logging.Logger;
+
+/**
+ * Mock Container impl to wrap a JBossCacheManager in unit tests.
+ *
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision: 64743 $
+ */
+public class MockContainer extends ContainerBase
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ private Loader loader;
+
+ private Pipeline pipeline;
+
+ @Override
+ public Loader getLoader()
+ {
+ if (loader == null)
+ {
+ loader = new MockLoader();
+ loader.setContainer(this);
+ }
+ return loader;
+ }
+
+ public Pipeline getPipeline()
+ {
+ if (pipeline == null)
+ {
+ pipeline = new StandardPipeline(this);
+ }
+ return pipeline;
+ }
+
+ public void setLoader(Loader loader)
+ {
+ this.loader = loader;
+ }
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockEngine.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockEngine.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockEngine.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import org.apache.catalina.Engine;
+import org.apache.catalina.Service;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public class MockEngine extends MockContainer implements Engine
+{
+ private static final long serialVersionUID = 1L;
+
+ private Service service;
+ private String defaultHost = "localhost";
+ private String jvmRoute;
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Engine#getDefaultHost()
+ */
+ public String getDefaultHost()
+ {
+ return defaultHost;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Engine#getJvmRoute()
+ */
+ public String getJvmRoute()
+ {
+ return jvmRoute;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Engine#getService()
+ */
+ public Service getService()
+ {
+ return service;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Engine#setDefaultHost(java.lang.String)
+ */
+ public void setDefaultHost(String arg0)
+ {
+ this.defaultHost = arg0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Engine#setJvmRoute(java.lang.String)
+ */
+ public void setJvmRoute(String arg0)
+ {
+ this.jvmRoute = arg0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Engine#setService(org.apache.catalina.Service)
+ */
+ public void setService(Service arg0)
+ {
+ this.service = arg0;
+ }
+
+}
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockEngine.java
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockHost.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockHost.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockHost.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,180 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Host;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public class MockHost extends MockContainer implements Host
+{
+ private static final long serialVersionUID = 1L;
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#addAlias(java.lang.String)
+ */
+ public void addAlias(String arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#findAliases()
+ */
+ public String[] findAliases()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#getAppBase()
+ */
+ public String getAppBase()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#getAutoDeploy()
+ */
+ public boolean getAutoDeploy()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#getConfigClass()
+ */
+ public String getConfigClass()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#getDeployOnStartup()
+ */
+ public boolean getDeployOnStartup()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#getXmlNamespaceAware()
+ */
+ public boolean getXmlNamespaceAware()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#getXmlValidation()
+ */
+ public boolean getXmlValidation()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#map(java.lang.String)
+ */
+ public Context map(String arg0)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#removeAlias(java.lang.String)
+ */
+ public void removeAlias(String arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#setAppBase(java.lang.String)
+ */
+ public void setAppBase(String arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#setAutoDeploy(boolean)
+ */
+ public void setAutoDeploy(boolean arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#setConfigClass(java.lang.String)
+ */
+ public void setConfigClass(String arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#setDeployOnStartup(boolean)
+ */
+ public void setDeployOnStartup(boolean arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#setXmlNamespaceAware(boolean)
+ */
+ public void setXmlNamespaceAware(boolean arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.catalina.Host#setXmlValidation(boolean)
+ */
+ public void setXmlValidation(boolean arg0)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockHost.java
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockLoader.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockLoader.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockLoader.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import java.beans.PropertyChangeListener;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.Loader;
+
+/**
+ * Mock Loader impl for use in unit tests.
+ *
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision: 64679 $
+ */
+public class MockLoader implements Loader
+{
+ private Container container;
+
+ public void addPropertyChangeListener(PropertyChangeListener listener)
+ {
+ // TODO Auto-generated method stub
+ }
+
+ public void addRepository(String repository)
+ {
+ // TODO Auto-generated method stub
+ }
+
+ public void backgroundProcess()
+ {
+ // TODO Auto-generated method stub
+ }
+
+ public String[] findRepositories()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return container == null ? getClass().getClassLoader()
+ : container.getClass().getClassLoader();
+ }
+
+ public Container getContainer()
+ {
+ return container;
+ }
+
+ public boolean getDelegate()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public String getInfo()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean getReloadable()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean modified()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public void removePropertyChangeListener(PropertyChangeListener listener)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setContainer(Container container)
+ {
+ this.container = container;
+ }
+
+ public void setDelegate(boolean delegate)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setReloadable(boolean reloadable)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockRequest.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockRequest.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockRequest.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,121 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import java.io.IOException;
+
+import org.apache.catalina.Manager;
+import org.apache.catalina.Session;
+import org.apache.catalina.connector.Request;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public class MockRequest extends Request
+{
+ private Session session;
+ private String requestedSessionId;
+ private boolean requestedSessionIdFromURL;
+
+ /**
+ * Create a new MockRequest.
+ *
+ */
+ public MockRequest()
+ {
+ }
+
+ @Override
+ public String getRequestedSessionId()
+ {
+ return requestedSessionId;
+ }
+
+ public void setRequestedSessionId(String requestedSessionId)
+ {
+ this.requestedSessionId = requestedSessionId;
+ }
+
+
+ @Override
+ protected Session doGetSession(boolean create)
+ {
+ if (session == null)
+ {
+ Manager manager = getContext().getManager();
+ if (requestedSessionId != null)
+ {
+ try {
+ session = manager.findSession(requestedSessionId);
+ } catch (IOException e) {
+ session = null;
+ }
+ }
+
+ if (session == null && create)
+ {
+ session = manager.createSession(requestedSessionId);
+ }
+
+ if (session != null)
+ {
+ session.access();
+ }
+
+ }
+
+ if (session != null && !session.isValid())
+ {
+ session = null;
+ doGetSession(create);
+ }
+
+ return session;
+ }
+
+ public void setSession(Session session)
+ {
+ this.session = session;
+ }
+
+ @Override
+ public boolean isRequestedSessionIdFromURL()
+ {
+ return requestedSessionIdFromURL;
+ }
+
+ public void setRequestedSessionIdFromURL(boolean requestedSessionIdFromURL)
+ {
+ this.requestedSessionIdFromURL = requestedSessionIdFromURL;
+ }
+
+ @Override
+ public void recycle()
+ {
+ if (session != null)
+ session.endAccess();
+ }
+
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockValve.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockValve.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MockValve.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+
+import org.apache.catalina.CometEvent;
+import org.apache.catalina.Valve;
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+import org.apache.catalina.valves.ValveBase;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public class MockValve extends ValveBase
+{
+ static
+ {
+ info = "MockValve";
+ }
+
+ private Request invokedRequest;
+ private Response invokedResponse;
+
+ /**
+ * Create a new MockValve.
+ *
+ */
+ public MockValve()
+ {
+ }
+
+ @Override
+ public void invoke(Request request, Response response) throws IOException, ServletException
+ {
+ this.invokedRequest = request;
+ this.invokedResponse = response;
+ }
+
+ public Request getInvokedRequest()
+ {
+ return invokedRequest;
+ }
+
+ public Response getInvokedResponse()
+ {
+ return invokedResponse;
+ }
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MutableObject.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MutableObject.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/MutableObject.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import java.io.Serializable;
+
+/**
+ * Simple wrapper around a string that will trigger replication on a get if
+ * SET_AND_NON_PRIMITIVE_GET is used.
+ *
+ * @author Brian Stansberry
+ *
+ */
+public class MutableObject implements Serializable
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8800180646736265624L;
+
+ private String string;
+
+ /**
+ * Create a new MutableObject.
+ *
+ */
+ public MutableObject(String string)
+ {
+ this.string = string;
+ }
+
+ public String getString()
+ {
+ return this.string;
+ }
+
+ public void setString(String string)
+ {
+ this.string = string;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof MutableObject)
+ {
+ return this.string.equals(((MutableObject) obj).string);
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return this.string.hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return this.string;
+ }
+
+
+
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/RequestHandler.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/RequestHandler.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/RequestHandler.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public interface RequestHandler
+{
+ void handleRequest(Request request, Response response);
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/RequestHandlerValve.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/RequestHandlerValve.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/RequestHandlerValve.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public class RequestHandlerValve extends MockValve
+{
+ private RequestHandler requestHandler;
+
+ public RequestHandlerValve(RequestHandler handler)
+ {
+ this.requestHandler = handler;
+ }
+
+ public String getInfo()
+ {
+ return "RequestHandlerValve";
+ }
+
+ public void invoke(Request request, Response response) throws IOException, ServletException
+ {
+ super.invoke(request, response);
+ requestHandler.handleRequest(request, response);
+ }
+
+ public RequestHandler getRequestHandler()
+ {
+ return requestHandler;
+ }
+
+ public void setRequestHandler(RequestHandler requestHandler)
+ {
+ this.requestHandler = requestHandler;
+ }
+
+
+
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/SetAttributesRequestHandler.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/SetAttributesRequestHandler.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/SetAttributesRequestHandler.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.test.cluster.web.util;
+
+import java.util.Map;
+
+import javax.servlet.http.HttpSession;
+
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+
+/**
+ * @author Brian Stansberry
+ *
+ */
+public class SetAttributesRequestHandler extends BasicRequestHandler
+{
+ private Map<String, Object> toStore;
+
+ /**
+ * Create a new EstablishSessionRequestHandler.
+ *
+ */
+ public SetAttributesRequestHandler(Map<String, Object> toStore, boolean checkNames)
+ {
+ super(toStore.keySet(), checkNames);
+ this.toStore = toStore;
+ }
+
+ public void handleRequest(Request request, Response response)
+ {
+ super.handleRequest(request, response);
+
+ HttpSession session = getSession();
+ for (Map.Entry<String,Object> entry : toStore.entrySet())
+ {
+ session.setAttribute(entry.getKey(), entry.getValue());
+ }
+ }
+
+
+
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/WebSessionTestUtil.java
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/WebSessionTestUtil.java (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/main/org/jboss/test/cluster/web/util/WebSessionTestUtil.java 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,191 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.cluster.web.util;
+
+import java.io.IOException;
+import java.util.Set;
+
+import javax.servlet.ServletException;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Manager;
+import org.apache.catalina.Pipeline;
+import org.apache.catalina.Valve;
+import org.apache.catalina.connector.Response;
+import org.apache.catalina.core.StandardContext;
+import org.jboss.cache.PropertyConfigurator;
+import org.jboss.cache.aop.PojoCache;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.web.tomcat.service.session.JBossCacheManager;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * A WebSessionTestUtil.
+ *
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebSessionTestUtil
+{
+ private static final String CONFIG_LOCATION = "cluster/http/jboss-web-test-service.xml";
+
+ public static final String JVM_ROUTE_0 = "node0";
+ public static final String JVM_ROUTE_1 = "node1";
+
+ public static JBossCacheManager createManager(String warName, int maxInactiveInterval,
+ boolean local, boolean totalReplication,
+ boolean marshalling, String jvmRoute,
+ Set<PojoCache> allCaches)
+ throws Exception
+ {
+ PojoCache cache = createCache(local, totalReplication, marshalling, allCaches);
+ return createManager(warName, maxInactiveInterval, cache, jvmRoute);
+ }
+
+ public static JBossCacheManager createManager(String warName,
+ int maxInactiveInterval,
+ PojoCache cache,
+ String jvmRoute)
+ {
+ JBossCacheManager jbcm = new JBossCacheManager(cache);
+ jbcm.setSnapshotMode("instant");
+
+ MockEngine engine = new MockEngine();
+ engine.setJvmRoute(jvmRoute);
+ MockHost host = new MockHost();
+ engine.addChild(host);
+ host.setName("localhost");
+ StandardContext container = new StandardContext();
+ container.setName(warName);
+ host.addChild(container);
+ container.setManager(jbcm);
+
+ // Do this after assigning the manager to the container, or else
+ // the container's setting will override ours
+ // Can't just set the container as their config is per minute not per second
+ jbcm.setMaxInactiveInterval(maxInactiveInterval);
+ return jbcm;
+ }
+
+ public static PojoCache createCache(boolean local, boolean totalReplication,
+ boolean marshalling, Set<PojoCache> allCaches) throws Exception
+ {
+ PojoCache cache = new PojoCache();
+ PropertyConfigurator config = new PropertyConfigurator();
+ config.configure(cache, CONFIG_LOCATION);
+ if (local)
+ cache.setCacheMode("LOCAL");
+ if (!totalReplication)
+ {
+ Element e = cache.getBuddyReplicationConfig();
+
+ NodeList list = e.getChildNodes();
+ for (int i = 0; i < list.getLength(); i++)
+ {
+ Node node = list.item(i);
+ if (node.getNodeName().equals("buddyReplicationEnabled"))
+ {
+ node.setNodeValue("true");
+ break;
+ }
+ }
+ cache.setBuddyReplicationConfig(e);
+ }
+
+ if (marshalling)
+ {
+ cache.setUseRegionBasedMarshalling(true);
+ cache.setInactiveOnStartup(true);
+ }
+
+ if (allCaches != null)
+ allCaches.add(cache);
+
+ cache.start();
+ return cache;
+ }
+
+ public static void invokeRequest(Manager manager, RequestHandler handler, String sessionId)
+ throws ServletException, IOException
+ {
+ Valve valve = setupPipeline(manager, handler);
+ MockRequest request = new MockRequest();
+ request.setRequestedSessionId(sessionId);
+ request.setContext((Context) manager.getContainer());
+ Response response = new Response();
+ request.setResponse(response);
+ valve.invoke(request, response);
+ request.recycle();
+ }
+
+ public static Valve setupPipeline(Manager manager, RequestHandler requestHandler)
+ {
+ Pipeline pipeline = manager.getContainer().getPipeline();
+
+ // Clean out any existing request handler
+ Valve[] valves = pipeline.getValves();
+ RequestHandlerValve mockValve = null;
+ for (Valve valve: valves)
+ {
+ if (valve instanceof RequestHandlerValve)
+ {
+ mockValve = (RequestHandlerValve) valve;
+ break;
+ }
+ }
+
+ if (mockValve == null)
+ {
+ mockValve = new RequestHandlerValve(requestHandler);
+ pipeline.addValve(mockValve);
+ }
+ else
+ {
+ mockValve.setRequestHandler(requestHandler);
+ }
+
+ return pipeline.getFirst();
+ }
+
+ public static WebMetaData getWebMetaData(int granularity, int trigger, boolean batchMode, int maxUnreplicated)
+ {
+ WebMetaData metadata = new WebMetaData();
+ metadata.setDistributable(true);
+ metadata.setReplicationGranularity(granularity);
+ metadata.setInvalidateSessionPolicy(trigger);
+ metadata.setReplicationFieldBatchMode(batchMode);
+ metadata.setMaxUnreplicatedInterval(new Integer(maxUnreplicated));
+
+ return metadata;
+ }
+
+ /**
+ * Prevent external instantiation.
+ *
+ */
+ private WebSessionTestUtil()
+ {
+ }
+
+}
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/http-sr/WEB-INF/jboss-web.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/http-sr/WEB-INF/jboss-web.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/http-sr/WEB-INF/jboss-web.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<jboss-web>
+ <replication-config>
+ <max-unreplicated-interval>16</max-unreplicated-interval>
+ </replication-config>
+</jboss-web>
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/http-sr/WEB-INF/web.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/http-sr/WEB-INF/web.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/http-sr/WEB-INF/web.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+ <display-name>Welcome to JBoss</display-name>
+ <description>
+ Welcome to JBoss
+ </description>
+ <distributable/>
+
+ <!-- timeout is set to 60 seconds -->
+ <session-config>
+ <session-timeout>1</session-timeout>
+ </session-config>
+</web-app>
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/jboss-web-test-service.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/jboss-web-test-service.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/jboss-web-test-service.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- Can be parsed to create a basic configuration for unit tests -->
+
+<server>
+
+ <mbean code="org.jboss.cache.aop.PojoCache"
+ name="jboss.cache:service=TomcatClusteringTestCache">
+
+ <attribute name="ClusterName">Tomcat-TestCluster</attribute>
+
+ <!-- make sure to specify BatchModeTransactionManager only! -->
+ <attribute name="TransactionManagerLookupClass">org.jboss.cache.BatchModeTransactionManagerLookup</attribute>
+
+ <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+ <attribute name="CacheMode">REPL_SYNC</attribute>
+
+ <attribute name="SyncReplTimeout">20000</attribute>
+
+ <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+ <attribute name="UseRegionBasedMarshalling">false</attribute>
+ <attribute name="InactiveOnStartup">false</attribute>
+
+ <attribute name="BuddyReplicationConfig">
+ <config>
+ <buddyReplicationEnabled>false</buddyReplicationEnabled>
+ <buddyLocatorClass>org.jboss.cache.buddyreplication.NextMemberBuddyLocator</buddyLocatorClass>
+ <buddyLocatorProperties>
+ numBuddies = 1
+ ignoreColocatedBuddies = true
+ </buddyLocatorProperties>
+
+ <buddyPoolName>default</buddyPoolName>
+ <buddyCommunicationTimeout>2000</buddyCommunicationTimeout>
+
+ <autoDataGravitation>false</autoDataGravitation>
+ <dataGravitationRemoveOnFind>true</dataGravitationRemoveOnFind>
+ <dataGravitationSearchBackupTrees>true</dataGravitationSearchBackupTrees>
+
+ </config>
+ </attribute>
+
+ </mbean>
+
+</server>
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/version.jsp
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/version.jsp (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/version.jsp 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,13 @@
+<%@page contentType="text/html"
+ import="org.jboss.mx.util.*"
+ import="javax.management.*"
+%>
+<%
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName on = new ObjectName("jboss.cache:service=TomcatClusteringCache");
+ String fqn = "/JSESSION/localhost" + request.getContextPath() + "/" + session.getId();
+ Object[] params = { fqn, "VERSION" };
+ String[] types = new String[] { "java.lang.String", "java.lang.Object" };
+ Object version = server.invoke(on, "get", params, types);
+%>
+<%= version %>
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/version.jsp
___________________________________________________________________
Name: svn:executable
+ *
Deleted: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/web.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/web.xml 2008-07-10 01:53:54 UTC (rev 75571)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/web.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!DOCTYPE web-app
- PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
- <display-name>Welcome to JBoss</display-name>
- <description>
- Welcome to JBoss
- </description>
- <distributable/>
-
- <!-- timeout is set to 60 seconds -->
- <session-config>
- <session-timeout>1</session-timeout>
- </session-config>
-</web-app>
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-attr.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-attr.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-attr.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<jboss-web>
+ <replication-config>
+ <replication-granularity>ATTRIBUTE</replication-granularity>
+ </replication-config>
+</jboss-web>
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-attr.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-batch-false.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-batch-false.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-batch-false.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<jboss-web>
+ <replication-config>
+ <replication-field-batch-mode>FALSE</replication-field-batch-mode>
+ </replication-config>
+</jboss-web>
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-batch-false.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-bogus.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-bogus.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-bogus.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<jboss-web>
+ <replication-config>
+ <replication-granularity>bogus</replication-granularity>
+ <replication-trigger>bogus</replication-trigger>
+ <replication-field-batch-mode>bogus</replication-field-batch-mode>
+ <max-unreplicated-interval>-2345</max-unreplicated-interval>
+ </replication-config>
+</jboss-web>
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-bogus.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-default.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-default.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-default.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<jboss-web>
+ <replication-config>
+ <replication-granularity>SESSION</replication-granularity>
+ <replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>
+ <replication-field-batch-mode>TRUE</replication-field-batch-mode>
+ <max-unreplicated-interval>60</max-unreplicated-interval>
+ </replication-config>
+</jboss-web>
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-default.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-empty.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-empty.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-empty.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<jboss-web>
+</jboss-web>
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-empty.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-field.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-field.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-field.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<jboss-web>
+ <replication-config>
+ <replication-granularity>FIELD</replication-granularity>
+ </replication-config>
+</jboss-web>
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-field.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-no-max.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-no-max.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-no-max.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<jboss-web>
+ <replication-config>
+ <max-unreplicated-interval>-1</max-unreplicated-interval>
+ </replication-config>
+</jboss-web>
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-no-max.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-set-and-get.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-set-and-get.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-set-and-get.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<jboss-web>
+ <replication-config>
+ <replication-trigger>SET_AND_GET</replication-trigger>
+ </replication-config>
+</jboss-web>
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-set-and-get.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-set.xml
===================================================================
--- branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-set.xml (rev 0)
+++ branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-set.xml 2008-07-10 02:31:43 UTC (rev 75572)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<jboss-web>
+ <replication-config>
+ <replication-trigger>SET</replication-trigger>
+ </replication-config>
+</jboss-web>
Property changes on: branches/JBPAPP_4_2_0_GA-JBPAPP-947/testsuite/src/resources/cluster/http/xmlparsing/jboss-web-set.xml
___________________________________________________________________
Name: svn:executable
+ *
More information about the jboss-cvs-commits
mailing list