[jboss-cvs] JBossAS SVN: r65562 - in branches/JBoss_4_0_5_GA_CP/testsuite: src/main/org/jboss/test/naming and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Sep 22 18:01:48 EDT 2007
Author: bstansberry at jboss.com
Date: 2007-09-22 18:01:48 -0400 (Sat, 22 Sep 2007)
New Revision: 65562
Added:
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/NonDeserializable.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinderMBean.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartHANamingService.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingServiceMBean.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/naming/restart/
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/naming/restart/jboss-service.xml
Removed:
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/NonDeserializable.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinderMBean.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartHANamingService.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingServiceMBean.java
branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/naming/restart/jboss-service.xml
Modified:
branches/JBoss_4_0_5_GA_CP/testsuite/imports/sections/naming.xml
Log:
[ASPATCH-289] Handle cached RMI Naming stubs that are out of sync w/ server after restart
Modified: branches/JBoss_4_0_5_GA_CP/testsuite/imports/sections/naming.xml
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/imports/sections/naming.xml 2007-09-22 21:59:34 UTC (rev 65561)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/imports/sections/naming.xml 2007-09-22 22:01:48 UTC (rev 65562)
@@ -114,6 +114,16 @@
<include name="org/jboss/test/naming/factory/*"/>
</fileset>
</jar>
-
+
+ <!-- Test of naming restart -->
+ <jar destfile="${build.lib}/naming-restart.sar">
+ <zipfileset dir="${build.resources}/naming/restart"
+ fullpath="META-INF/jboss-service.xml">
+ <include name="jboss-service.xml"/>
+ </zipfileset>
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/naming/restart/*"/>
+ </fileset>
+ </jar>
</target>
</project>
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart (from rev 65512, branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart)
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/NonDeserializable.java
===================================================================
--- branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/NonDeserializable.java 2007-09-20 23:58:12 UTC (rev 65512)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/NonDeserializable.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -1,47 +0,0 @@
-/*
- * 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.naming.restart;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-/**
- * Class that throws NoSuchObjectException in deserialization.
- * @author bstansberry
- */
-public class NonDeserializable implements Serializable
-{
- private static final long serialVersionUID = 0L;
-
- private void writeObject(java.io.ObjectOutputStream out)
- throws IOException
- {
- out.defaultWriteObject();
- }
-
- private void readObject(java.io.ObjectInputStream in)
- throws IOException, ClassNotFoundException
- {
- throw new java.rmi.NoSuchObjectException("Let's see how this is handled");
- }
-}
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/NonDeserializable.java (from rev 65558, branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/NonDeserializable.java)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/NonDeserializable.java (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/NonDeserializable.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -0,0 +1,47 @@
+/*
+ * 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.naming.restart;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+/**
+ * Class that throws NoSuchObjectException in deserialization.
+ * @author bstansberry
+ */
+public class NonDeserializable implements Serializable
+{
+ private static final long serialVersionUID = 0L;
+
+ private void writeObject(java.io.ObjectOutputStream out)
+ throws IOException
+ {
+ out.defaultWriteObject();
+ }
+
+ private void readObject(java.io.ObjectInputStream in)
+ throws IOException, ClassNotFoundException
+ {
+ throw new java.rmi.NoSuchObjectException("Let's see how this is handled");
+ }
+}
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java
===================================================================
--- branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java 2007-09-20 23:58:12 UTC (rev 65512)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -1,158 +0,0 @@
-/*
- * 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.naming.restart;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NameNotFoundException;
-
-import org.jboss.logging.Logger;
-import org.jnp.interfaces.MarshalledValuePair;
-import org.jnp.interfaces.Naming;
-import org.jnp.interfaces.NamingParser;
-
-/**
- * Binds an object into JNDI.
- *
- * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @version $Revision$
- */
-public class ObjectBinder implements ObjectBinderMBean
-{
- private static Logger log = Logger.getLogger(ObjectBinder.class);
-
- public static final String NAME = "NamingRestartBinding";
- public static final String BAD_BINDING = "NamingRestartBadBinding";
- public static final String VALUE = "VALUE";
- public static final String SUBCONTEXT_NAME = "LocalSubcontext";
-// private String providerURL;
- private NamingParser parser = new NamingParser();
- private RestartNamingServiceMBean naming;
-
- public void setNamingService(RestartNamingServiceMBean naming)
- {
-// this.providerURL = (naming == null)
-// ? null
-// : naming.getBindAddress() + ":" + naming.getPort();
- this.naming = naming;
- }
-
- public void start() throws Exception
- {
- // Standard JNDI
- Context ctx = new InitialContext();
- ctx.bind(NAME, VALUE);
- log.info("Bound " + VALUE + " to " + ctx + " under " + NAME);
- ctx.bind(BAD_BINDING, new NonDeserializable());
- log.info("Bound a NonDeserializable to " + ctx + " under " + BAD_BINDING);
-
- // For some reason creating a context for our own JNDI doesn't work
- // inside the server, so as a hack we directly deal with the NamingServer
- // to bind the object
-
-// Properties env = new Properties();
-// env.setProperty("java.naming.provider.url", providerURL);
-// log.info("Env = " + env);
-// Context ctx = new InitialContext(env);
-// ctx.bind(NAME, VALUE);
-
- Naming namingServer = naming.getNamingInstance();
- namingServer.bind(parser.parse(NAME),
- new MarshalledValuePair(VALUE),
- VALUE.getClass().getName());
- log.info("Bound " + VALUE + " to " + namingServer + " under " + NAME);
- Context sub = namingServer.createSubcontext(parser.parse(SUBCONTEXT_NAME));
- sub.bind(parser.parse(NAME), VALUE);
- log.info("Bound " + VALUE + " to " + sub + " under " + NAME);
-
- // NOTE: we must bind the NonDeserializable directly, or else the
- // NamingContext will wrap it in a MarshalledValuePair, which will
- // defeat the test by triggering deserialization too late
- namingServer.bind(parser.parse(BAD_BINDING), new NonDeserializable(),
- NonDeserializable.class.getName());
-
- log.info("Bound a NonDeserializable to " + namingServer + " under " + BAD_BINDING);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.test.naming.restart.ObjectBinderMBean#stop()
- */
- public void stop() throws Exception
- {
- // Standard JNDI
- Context ctx = new InitialContext();
- ctx.unbind(NAME);
- log.info("Unbound " + NAME + " from " + ctx);
- ctx.unbind(BAD_BINDING);
- log.info("Unbound " + BAD_BINDING + " from " + ctx);
-
- // For some reason creating a context for our own JNDI doesn't work
- // inside the server, so as a hack we directly deal with the NamingServer
- // to bind the object
-
-// Properties env = new Properties();
-// env.setProperty("java.naming.provider.url", providerURL);
-//
-// Context ctx = new InitialContext(env);
-// ctx.unbind(NAME);
-
- Naming namingServer = naming.getNamingInstance();
- try
- {
- namingServer.unbind(parser.parse(SUBCONTEXT_NAME + "/" + NAME));
- log.info("Unbound " + SUBCONTEXT_NAME + "/" + NAME + " from " + namingServer);
- }
- catch (NameNotFoundException ignored)
- {
- // already unbound by test
- }
- try
- {
- namingServer.unbind(parser.parse(SUBCONTEXT_NAME));
- log.info("Unbound " + SUBCONTEXT_NAME + " from " + namingServer);
- }
- catch (NameNotFoundException ignored)
- {
- // already unbound by test
- }
- try
- {
- namingServer.unbind(parser.parse(NAME));
- log.info("Unbound " + NAME + " from " + namingServer);
- }
- catch (NameNotFoundException ignored)
- {
- // already unbound by test
- }
- try
- {
- namingServer.unbind(parser.parse(BAD_BINDING));
- log.info("Unbound " + BAD_BINDING + " from " + namingServer);
- }
- catch (NameNotFoundException ignored)
- {
- // already unbound by test
- }
-
- }
-}
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java (from rev 65558, branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinder.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -0,0 +1,158 @@
+/*
+ * 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.naming.restart;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+
+import org.jboss.logging.Logger;
+import org.jnp.interfaces.MarshalledValuePair;
+import org.jnp.interfaces.Naming;
+import org.jnp.interfaces.NamingParser;
+
+/**
+ * Binds an object into JNDI.
+ *
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision$
+ */
+public class ObjectBinder implements ObjectBinderMBean
+{
+ private static Logger log = Logger.getLogger(ObjectBinder.class);
+
+ public static final String NAME = "NamingRestartBinding";
+ public static final String BAD_BINDING = "NamingRestartBadBinding";
+ public static final String VALUE = "VALUE";
+ public static final String SUBCONTEXT_NAME = "LocalSubcontext";
+// private String providerURL;
+ private NamingParser parser = new NamingParser();
+ private RestartNamingServiceMBean naming;
+
+ public void setNamingService(RestartNamingServiceMBean naming)
+ {
+// this.providerURL = (naming == null)
+// ? null
+// : naming.getBindAddress() + ":" + naming.getPort();
+ this.naming = naming;
+ }
+
+ public void start() throws Exception
+ {
+ // Standard JNDI
+ Context ctx = new InitialContext();
+ ctx.bind(NAME, VALUE);
+ log.info("Bound " + VALUE + " to " + ctx + " under " + NAME);
+ ctx.bind(BAD_BINDING, new NonDeserializable());
+ log.info("Bound a NonDeserializable to " + ctx + " under " + BAD_BINDING);
+
+ // For some reason creating a context for our own JNDI doesn't work
+ // inside the server, so as a hack we directly deal with the NamingServer
+ // to bind the object
+
+// Properties env = new Properties();
+// env.setProperty("java.naming.provider.url", providerURL);
+// log.info("Env = " + env);
+// Context ctx = new InitialContext(env);
+// ctx.bind(NAME, VALUE);
+
+ Naming namingServer = naming.getNamingInstance();
+ namingServer.bind(parser.parse(NAME),
+ new MarshalledValuePair(VALUE),
+ VALUE.getClass().getName());
+ log.info("Bound " + VALUE + " to " + namingServer + " under " + NAME);
+ Context sub = namingServer.createSubcontext(parser.parse(SUBCONTEXT_NAME));
+ sub.bind(parser.parse(NAME), VALUE);
+ log.info("Bound " + VALUE + " to " + sub + " under " + NAME);
+
+ // NOTE: we must bind the NonDeserializable directly, or else the
+ // NamingContext will wrap it in a MarshalledValuePair, which will
+ // defeat the test by triggering deserialization too late
+ namingServer.bind(parser.parse(BAD_BINDING), new NonDeserializable(),
+ NonDeserializable.class.getName());
+
+ log.info("Bound a NonDeserializable to " + namingServer + " under " + BAD_BINDING);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.test.naming.restart.ObjectBinderMBean#stop()
+ */
+ public void stop() throws Exception
+ {
+ // Standard JNDI
+ Context ctx = new InitialContext();
+ ctx.unbind(NAME);
+ log.info("Unbound " + NAME + " from " + ctx);
+ ctx.unbind(BAD_BINDING);
+ log.info("Unbound " + BAD_BINDING + " from " + ctx);
+
+ // For some reason creating a context for our own JNDI doesn't work
+ // inside the server, so as a hack we directly deal with the NamingServer
+ // to bind the object
+
+// Properties env = new Properties();
+// env.setProperty("java.naming.provider.url", providerURL);
+//
+// Context ctx = new InitialContext(env);
+// ctx.unbind(NAME);
+
+ Naming namingServer = naming.getNamingInstance();
+ try
+ {
+ namingServer.unbind(parser.parse(SUBCONTEXT_NAME + "/" + NAME));
+ log.info("Unbound " + SUBCONTEXT_NAME + "/" + NAME + " from " + namingServer);
+ }
+ catch (NameNotFoundException ignored)
+ {
+ // already unbound by test
+ }
+ try
+ {
+ namingServer.unbind(parser.parse(SUBCONTEXT_NAME));
+ log.info("Unbound " + SUBCONTEXT_NAME + " from " + namingServer);
+ }
+ catch (NameNotFoundException ignored)
+ {
+ // already unbound by test
+ }
+ try
+ {
+ namingServer.unbind(parser.parse(NAME));
+ log.info("Unbound " + NAME + " from " + namingServer);
+ }
+ catch (NameNotFoundException ignored)
+ {
+ // already unbound by test
+ }
+ try
+ {
+ namingServer.unbind(parser.parse(BAD_BINDING));
+ log.info("Unbound " + BAD_BINDING + " from " + namingServer);
+ }
+ catch (NameNotFoundException ignored)
+ {
+ // already unbound by test
+ }
+
+ }
+}
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinderMBean.java
===================================================================
--- branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinderMBean.java 2007-09-20 23:58:12 UTC (rev 65512)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinderMBean.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -1,24 +0,0 @@
-package org.jboss.test.naming.restart;
-
-
-public interface ObjectBinderMBean
-{
-
- void setNamingService(RestartNamingServiceMBean naming);
-
- /**
- * Bind an object both in standard JNDI (to expose via HA-JNDI) and in our
- * injected NamingServer
- *
- * @throws Exception
- */
- void start() throws Exception;
-
- /**
- * Undoes the bindings done in start().
- *
- * @throws Exception
- */
- void stop() throws Exception;
-
-}
\ No newline at end of file
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinderMBean.java (from rev 65558, branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinderMBean.java)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinderMBean.java (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/ObjectBinderMBean.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -0,0 +1,24 @@
+package org.jboss.test.naming.restart;
+
+
+public interface ObjectBinderMBean
+{
+
+ void setNamingService(RestartNamingServiceMBean naming);
+
+ /**
+ * Bind an object both in standard JNDI (to expose via HA-JNDI) and in our
+ * injected NamingServer
+ *
+ * @throws Exception
+ */
+ void start() throws Exception;
+
+ /**
+ * Undoes the bindings done in start().
+ *
+ * @throws Exception
+ */
+ void stop() throws Exception;
+
+}
\ No newline at end of file
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartHANamingService.java
===================================================================
--- branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/RestartHANamingService.java 2007-09-20 23:58:12 UTC (rev 65512)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartHANamingService.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -1,77 +0,0 @@
-/*
- * 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.naming.restart;
-
-import org.jboss.ha.jndi.HANamingService;
-import org.jnp.interfaces.Naming;
-import org.jnp.interfaces.NamingContext;
-
-/**
- * Subclass of HANamingService that ensures we don't screw up
- * the in-VM NamingContext class static haServers map.
- *
- * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @version $Revision$
- */
-public class RestartHANamingService extends HANamingService
-{
-
- /**
- * Create a new RestartHANamingService.
- *
- */
- public RestartHANamingService()
- {
- super();
- }
-
- protected void createService() throws Exception
- {
- Naming naming = NamingContext.getHANamingServerForPartition(clusterPartition.getPartitionName());
- try
- {
- super.createService();
- }
- finally
- {
- if (naming == null)
- NamingContext.removeHANamingServerForPartition(clusterPartition.getPartitionName());
- else
- NamingContext.setHANamingServerForPartition(clusterPartition.getPartitionName(), naming);
- }
- }
-
- protected void stopService() throws Exception
- {
- Naming naming = NamingContext.getHANamingServerForPartition(clusterPartition.getPartitionName());
- try
- {
- super.stopService();
- }
- finally
- {
- if (naming != null)
- NamingContext.setHANamingServerForPartition(clusterPartition.getPartitionName(), naming);
- }
- }
-}
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartHANamingService.java (from rev 65558, branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/RestartHANamingService.java)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartHANamingService.java (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartHANamingService.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -0,0 +1,78 @@
+/*
+ * 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.naming.restart;
+
+import org.jboss.ha.jndi.HANamingService;
+import org.jnp.interfaces.Naming;
+import org.jnp.interfaces.NamingContext;
+
+/**
+ * Subclass of HANamingService that ensures we don't screw up
+ * the in-VM NamingContext class static haServers map.
+ *
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision$
+ */
+public class RestartHANamingService extends HANamingService
+{
+
+ /**
+ * Create a new RestartHANamingService.
+ *
+ */
+ public RestartHANamingService()
+ {
+ super();
+ this.replicantName = "RestartHAJNDI";
+ }
+
+ protected void createService() throws Exception
+ {
+ Naming naming = NamingContext.getHANamingServerForPartition(clusterPartition.getPartitionName());
+ try
+ {
+ super.createService();
+ }
+ finally
+ {
+ if (naming == null)
+ NamingContext.removeHANamingServerForPartition(clusterPartition.getPartitionName());
+ else
+ NamingContext.setHANamingServerForPartition(clusterPartition.getPartitionName(), naming);
+ }
+ }
+
+ protected void stopService() throws Exception
+ {
+ Naming naming = NamingContext.getHANamingServerForPartition(clusterPartition.getPartitionName());
+ try
+ {
+ super.stopService();
+ }
+ finally
+ {
+ if (naming != null)
+ NamingContext.setHANamingServerForPartition(clusterPartition.getPartitionName(), naming);
+ }
+ }
+}
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java
===================================================================
--- branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java 2007-09-20 23:58:12 UTC (rev 65512)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -1,67 +0,0 @@
-/*
- * 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.naming.restart;
-
-import java.rmi.server.UnicastRemoteObject;
-
-import org.jboss.naming.NamingService;
-import org.jnp.interfaces.Naming;
-import org.jnp.server.Main;
-
-/**
- * Overrides NamingService to unexport the naming stub in stopService().
- * Used to test what happens when this is done.
- *
- * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @version $Revision$
- */
-public class RestartNamingService extends NamingService
- implements RestartNamingServiceMBean
-{
-
- /* (non-Javadoc)
- * @see org.jboss.test.naming.restart.RestartNamingServiceMBean#getNaming()
- */
- public Naming getNamingInstance()
- {
- return getNamingServer().getServer();
- }
-
- protected void startService() throws Exception
- {
- Main main = getNamingServer();
- main.setUseGlobalService(false);
- main.setInstallGlobalService(false);
-
- super.startService();
- }
-
- protected void stopService() throws Exception
- {
- super.stopService();
- UnicastRemoteObject.unexportObject(getNamingServer().getServer(), true);
- }
-
-
-
-}
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java (from rev 65558, branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingService.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -0,0 +1,67 @@
+/*
+ * 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.naming.restart;
+
+import java.rmi.server.UnicastRemoteObject;
+
+import org.jboss.naming.NamingService;
+import org.jnp.interfaces.Naming;
+import org.jnp.server.Main;
+
+/**
+ * Overrides NamingService to unexport the naming stub in stopService().
+ * Used to test what happens when this is done.
+ *
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision$
+ */
+public class RestartNamingService extends NamingService
+ implements RestartNamingServiceMBean
+{
+
+ /* (non-Javadoc)
+ * @see org.jboss.test.naming.restart.RestartNamingServiceMBean#getNaming()
+ */
+ public Naming getNamingInstance()
+ {
+ return getNamingServer().getServer();
+ }
+
+ protected void startService() throws Exception
+ {
+ Main main = getNamingServer();
+ main.setUseGlobalService(false);
+ main.setInstallGlobalService(false);
+
+ super.startService();
+ }
+
+ protected void stopService() throws Exception
+ {
+ super.stopService();
+ UnicastRemoteObject.unexportObject(getNamingServer().getServer(), true);
+ }
+
+
+
+}
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingServiceMBean.java
===================================================================
--- branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingServiceMBean.java 2007-09-20 23:58:12 UTC (rev 65512)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingServiceMBean.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -1,16 +0,0 @@
-package org.jboss.test.naming.restart;
-
-import org.jboss.naming.NamingServiceMBean;
-import org.jnp.interfaces.Naming;
-
-public interface RestartNamingServiceMBean extends NamingServiceMBean
-{
- boolean getUseGlobalService();
- void setUseGlobalService(boolean useGlobal);
-
- boolean getInstallGlobalService();
- void setInstallGlobalService(boolean installGlobal);
-
- Naming getNamingInstance();
-
-}
\ No newline at end of file
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingServiceMBean.java (from rev 65558, branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingServiceMBean.java)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingServiceMBean.java (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/main/org/jboss/test/naming/restart/RestartNamingServiceMBean.java 2007-09-22 22:01:48 UTC (rev 65562)
@@ -0,0 +1,16 @@
+package org.jboss.test.naming.restart;
+
+import org.jboss.naming.NamingServiceMBean;
+import org.jnp.interfaces.Naming;
+
+public interface RestartNamingServiceMBean extends NamingServiceMBean
+{
+ boolean getUseGlobalService();
+ void setUseGlobalService(boolean useGlobal);
+
+ boolean getInstallGlobalService();
+ void setInstallGlobalService(boolean installGlobal);
+
+ Naming getNamingInstance();
+
+}
\ No newline at end of file
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/naming/restart (from rev 65512, branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/resources/naming/restart)
Deleted: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/naming/restart/jboss-service.xml
===================================================================
--- branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/resources/naming/restart/jboss-service.xml 2007-09-20 23:58:12 UTC (rev 65512)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/naming/restart/jboss-service.xml 2007-09-22 22:01:48 UTC (rev 65562)
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id$ -->
-
-<!-- ===================================================================== -->
-<!-- JBoss Server Configuration -->
-<!-- ===================================================================== -->
-
-<server>
-
- <!-- ==================================================================== -->
- <!-- JNDI -->
- <!-- ==================================================================== -->
-
- <!-- Use our own NamingService subclass that unexports the NamingServer
- in stopService(). This better simulates a server shutdown.
- We don't really want to test a non-shutdown redeploy of the naming
- service as that is a highly unlikely usage. -->
- <mbean code="org.jboss.test.naming.restart.RestartNamingService"
- name="jboss:service=RestartNaming">
-
- <!-- IMPORTANT Ensure we use our own NamingServer and don't screw up the
- static ref to the std one in the server-side NamingContext class -->
- <attribute name="UseGlobalService">false</attribute>
- <attribute name="InstallGlobalService">false</attribute>
-
- <attribute name="CallByValue">false</attribute>
- <attribute name="Port">19099</attribute>
- <attribute name="BindAddress">${jboss.bind.address}</attribute>
- <!-- Use 0 == anonymous to minimize port conflict chances in test runs -->
- <attribute name="RmiPort">0</attribute>
- <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
- <depends optional-attribute-name="LookupPool"
- proxy-type="attribute">jboss.system:service=ThreadPool</depends>
- </mbean>
-
- <!-- Our own HA-JNDI that we can redeploy. Subclasses std HA-JNDI service
- to ensure we don't pollute static ref to the std HA-JNDI in the
- server-side NamingContext class -->
- <mbean code="org.jboss.test.naming.restart.RestartHANamingService"
- name="jboss:service=RestartHAJNDI">
-
- <depends optional-attribute-name="ClusterPartition"
- proxy-type="attribute">jboss:service=${jboss.partition.name:DefaultPartition}</depends>
- <attribute name="BindAddress">${jboss.bind.address}</attribute>
- <!-- Port on which the HA-JNDI stub is made available -->
- <attribute name="Port">19100</attribute>
- <!-- Use 0 == anonymous to minimize port conflict chances in test runs -->
- <attribute name="RmiPort">0</attribute>
- <attribute name="Backlog">50</attribute>
-
- <depends optional-attribute-name="LookupPool"
- proxy-type="attribute">jboss.system:service=ThreadPool</depends>
-
- <attribute name="DiscoveryDisabled">false</attribute>
- <attribute name="AutoDiscoveryBindAddress">${jboss.bind.address}</attribute>
- <!-- Use a custom Multicast Address and group port for auto-discovery -->
- <attribute name="AutoDiscoveryAddress">230.9.9.9</attribute>
- <attribute name="AutoDiscoveryGroup">19102</attribute>
- <!-- The TTL (time-to-live) for autodiscovery IP multicast packets -->
- <attribute name="AutoDiscoveryTTL">1</attribute>
-
- <attribute name="LoadBalancePolicy">org.jboss.ha.framework.interfaces.RoundRobin</attribute>
-
- </mbean>
-
- <!-- Binds an object in the above two naming services for remote lookup
- by the test client -->
- <mbean code="org.jboss.test.naming.restart.ObjectBinder"
- name="jboss:service=RestartNamingObjectBinder">
-
- <depends optional-attribute-name="NamingService"
- proxy-type="attribute">jboss:service=RestartNaming</depends>
- </mbean>
-
-
-</server>
Copied: branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/naming/restart/jboss-service.xml (from rev 65558, branches/JBoss_4_0_5_GA_CP06_JBAS-4631/testsuite/src/resources/naming/restart/jboss-service.xml)
===================================================================
--- branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/naming/restart/jboss-service.xml (rev 0)
+++ branches/JBoss_4_0_5_GA_CP/testsuite/src/resources/naming/restart/jboss-service.xml 2007-09-22 22:01:48 UTC (rev 65562)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+
+<!-- ===================================================================== -->
+<!-- JBoss Server Configuration -->
+<!-- ===================================================================== -->
+
+<server>
+
+ <!-- ==================================================================== -->
+ <!-- JNDI -->
+ <!-- ==================================================================== -->
+
+ <!-- Use our own NamingService subclass that unexports the NamingServer
+ in stopService(). This better simulates a server shutdown.
+ We don't really want to test a non-shutdown redeploy of the naming
+ service as that is a highly unlikely usage. -->
+ <mbean code="org.jboss.test.naming.restart.RestartNamingService"
+ name="jboss:service=RestartNaming">
+
+ <!-- IMPORTANT Ensure we use our own NamingServer and don't screw up the
+ static ref to the std one in the server-side NamingContext class -->
+ <attribute name="UseGlobalService">false</attribute>
+ <attribute name="InstallGlobalService">false</attribute>
+
+ <attribute name="CallByValue">false</attribute>
+ <attribute name="Port">19099</attribute>
+ <attribute name="BindAddress">${jboss.bind.address}</attribute>
+ <!-- Use 0 == anonymous to minimize port conflict chances in test runs -->
+ <attribute name="RmiPort">0</attribute>
+ <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
+ <depends optional-attribute-name="LookupPool"
+ proxy-type="attribute">jboss.system:service=ThreadPool</depends>
+ </mbean>
+
+ <!-- Our own HA-JNDI that we can redeploy. Subclasses std HA-JNDI service
+ to ensure we don't pollute static ref to the std HA-JNDI in the
+ server-side NamingContext class -->
+ <mbean code="org.jboss.test.naming.restart.RestartHANamingService"
+ name="jboss:service=RestartHAJNDI">
+
+ <depends optional-attribute-name="ClusterPartition"
+ proxy-type="attribute">jboss:service=${jboss.partition.name:DefaultPartition}</depends>
+ <attribute name="BindAddress">${jboss.bind.address}</attribute>
+ <!-- Port on which the HA-JNDI stub is made available -->
+ <attribute name="Port">19100</attribute>
+ <!-- Use 0 == anonymous to minimize port conflict chances in test runs -->
+ <attribute name="RmiPort">0</attribute>
+ <attribute name="Backlog">50</attribute>
+
+ <depends optional-attribute-name="LookupPool"
+ proxy-type="attribute">jboss.system:service=ThreadPool</depends>
+
+ <attribute name="DiscoveryDisabled">false</attribute>
+ <attribute name="AutoDiscoveryBindAddress">${jboss.bind.address}</attribute>
+ <!-- Use a custom Multicast Address and group port for auto-discovery -->
+ <attribute name="AutoDiscoveryAddress">230.9.9.9</attribute>
+ <attribute name="AutoDiscoveryGroup">19102</attribute>
+ <!-- The TTL (time-to-live) for autodiscovery IP multicast packets -->
+ <attribute name="AutoDiscoveryTTL">1</attribute>
+
+ <attribute name="LoadBalancePolicy">org.jboss.ha.framework.interfaces.RoundRobin</attribute>
+
+ </mbean>
+
+ <!-- Binds an object in the above two naming services for remote lookup
+ by the test client -->
+ <mbean code="org.jboss.test.naming.restart.ObjectBinder"
+ name="jboss:service=RestartNamingObjectBinder">
+
+ <depends optional-attribute-name="NamingService"
+ proxy-type="attribute">jboss:service=RestartNaming</depends>
+ </mbean>
+
+
+</server>
More information about the jboss-cvs-commits
mailing list