JBoss Remoting SVN: r3585 - remoting2/branches/2.x/lib/jboss.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-07 02:43:44 -0500 (Fri, 07 Mar 2008)
New Revision: 3585
Modified:
remoting2/branches/2.x/lib/jboss/jrunit.jar
Log:
JBREM-876: Checked in changes to jrunit and built new jrunit.jar based on repository version of jrunit.
Modified: remoting2/branches/2.x/lib/jboss/jrunit.jar
===================================================================
(Binary files differ)
16 years, 9 months
JBoss Remoting SVN: r3584 - remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-07 00:04:56 -0500 (Fri, 07 Mar 2008)
New Revision: 3584
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptingMarshaller.java
remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptingUnMarshaller.java
Log:
JBREM-698: Returns preferred stream unchanged.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptingMarshaller.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptingMarshaller.java 2008-03-07 04:52:56 UTC (rev 3583)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptingMarshaller.java 2008-03-07 05:04:56 UTC (rev 3584)
@@ -110,7 +110,11 @@
cipher = EncryptionManager.getCipher(Cipher.ENCRYPT_MODE, this.cipherAlgorithm);
}
-
+ public OutputStream getMarshallingStream(OutputStream outputStream) throws IOException
+ {
+ return outputStream;
+ }
+
/**
* Writes encrypted, marshalled form of <code>dataObject</code> to <code>output</code>.
*
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptingUnMarshaller.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptingUnMarshaller.java 2008-03-07 04:52:56 UTC (rev 3583)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/marshal/encryption/EncryptingUnMarshaller.java 2008-03-07 05:04:56 UTC (rev 3584)
@@ -100,6 +100,11 @@
cipher = EncryptionManager.getCipher(Cipher.DECRYPT_MODE, this.cipherAlgorithm);
}
+ public InputStream getMarshallingStream(InputStream inputStream) throws IOException
+ {
+ return inputStream;
+ }
+
/**
* Restores a encrypted, marshalled form of an object to its original state.
*
16 years, 9 months
JBoss Remoting SVN: r3583 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 23:52:56 -0500 (Thu, 06 Mar 2008)
New Revision: 3583
Added:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/BisocketCompressionStressTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/CompressionStressTestParent.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/HttpCompressionStressTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/RMICompressionStressTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/SocketCompressionStressTestCase.java
Log:
JBREM-677: New unit tests.
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/BisocketCompressionStressTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/BisocketCompressionStressTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/BisocketCompressionStressTestCase.java 2008-03-07 04:52:56 UTC (rev 3583)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.remoting.marshall.compress;
+
+import org.jboss.test.remoting.marshall.compress.CompressionStressTestParent;
+
+/**
+ * Unit test for JBREM-677.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 6, 2008
+ * </p>
+ */
+public class BisocketCompressionStressTestCase extends CompressionStressTestParent
+{
+ protected String getTransport()
+ {
+ return "bisocket";
+ }
+}
+
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/CompressionStressTestParent.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/CompressionStressTestParent.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/CompressionStressTestParent.java 2008-03-07 04:52:56 UTC (rev 3583)
@@ -0,0 +1,189 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.remoting.marshall.compress;
+
+import java.net.InetAddress;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.apache.log4j.PatternLayout;
+import org.jboss.logging.XLevel;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.MicroRemoteClientInvoker;
+import org.jboss.remoting.ServerInvocationHandler;
+import org.jboss.remoting.ServerInvoker;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.marshal.MarshalFactory;
+import org.jboss.remoting.marshal.compress.CompressingMarshaller;
+import org.jboss.remoting.marshal.compress.CompressingUnMarshaller;
+import org.jboss.remoting.transport.Connector;
+import org.jboss.remoting.transport.PortUtil;
+
+
+/**
+ * Unit test for JBREM-677.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 6, 2008
+ * </p>
+ */
+abstract public class CompressionStressTestParent extends TestCase
+{
+ private static Logger log = Logger.getLogger(CompressionStressTestParent.class);
+
+ private static boolean firstTime = true;
+
+ protected String host;
+ protected int port;
+ protected String locatorURI;
+ protected InvokerLocator serverLocator;
+ protected Connector connector;
+ protected TestInvocationHandler invocationHandler;
+
+
+ public void setUp() throws Exception
+ {
+ if (firstTime)
+ {
+ firstTime = false;
+ Logger.getLogger("org.jboss.remoting").setLevel(XLevel.INFO);
+ Logger.getLogger("org.jboss.test.remoting").setLevel(Level.INFO);
+ String pattern = "[%d{ABSOLUTE}] [%t] %5p (%F:%L) - %m%n";
+ PatternLayout layout = new PatternLayout(pattern);
+ ConsoleAppender consoleAppender = new ConsoleAppender(layout);
+ Logger.getRootLogger().addAppender(consoleAppender);
+ MarshalFactory.addMarshaller("compress", new CompressingMarshaller(), new CompressingUnMarshaller());
+ }
+ }
+
+
+ public void tearDown()
+ {
+ }
+
+
+ public void testCompression() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Start server.
+ setupServer();
+
+ // Create client.
+ InvokerLocator clientLocator = new InvokerLocator(locatorURI);
+ HashMap clientConfig = new HashMap();
+ clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
+ addExtraClientConfig(clientConfig);
+ Client client = new Client(clientLocator, clientConfig);
+ client.connect();
+ log.info("client is connected");
+
+ // Test connections.
+ assertEquals("abc", client.invoke("abc"));
+ log.info("connection is good");
+
+ // Verify CompressingMarshaller / CompressingUnMarshaller are being used.
+ MicroRemoteClientInvoker invoker = (MicroRemoteClientInvoker) client.getInvoker();
+ assertTrue(invoker.getMarshaller() instanceof CompressingMarshaller);
+ assertTrue(invoker.getUnMarshaller() instanceof CompressingUnMarshaller);
+
+ StringBuffer sb = new StringBuffer(10000);
+ for (int i = 0; i < 40000; i++)
+ {
+ sb.append(((char) i % 10));
+ String msg = sb.toString();
+ Object result = client.invoke(msg);
+ assertEquals("failed on invocation " + i, msg, result);
+
+ if ((i + 1) % 1000 == 0)
+ {
+ log.info("invocations: " + (i + 1));
+ log.info("length: " + msg.length());
+ }
+ }
+
+ client.disconnect();
+ shutdownServer();
+ log.info(getName() + " PASSES");
+ }
+
+
+ abstract protected String getTransport();
+
+
+ protected void addExtraClientConfig(Map config) {}
+ protected void addExtraServerConfig(Map config) {}
+
+
+ protected void setupServer() throws Exception
+ {
+ host = InetAddress.getLocalHost().getHostAddress();
+ port = PortUtil.findFreePort(host);
+ locatorURI = getTransport() + "://" + host + ":" + port + "/?datatype=compress";
+ String parameters = System.getProperty("remoting.metadata");
+ if (parameters != null) locatorURI += "&" + parameters;
+ serverLocator = new InvokerLocator(locatorURI);
+ log.info("Starting remoting server with locator uri of: " + locatorURI);
+ HashMap config = new HashMap();
+ config.put(InvokerLocator.FORCE_REMOTE, "true");
+ addExtraServerConfig(config);
+ connector = new Connector(serverLocator, config);
+ connector.create();
+ invocationHandler = new TestInvocationHandler();
+ connector.addInvocationHandler("test", invocationHandler);
+ connector.start();
+ }
+
+
+ protected void shutdownServer() throws Exception
+ {
+ if (connector != null)
+ connector.stop();
+ }
+
+
+ static class TestInvocationHandler implements ServerInvocationHandler
+ {
+ public void addListener(InvokerCallbackHandler callbackHandler) {}
+ public Object invoke(final InvocationRequest invocation) throws Throwable
+ {
+// log.info("parameter: " + invocation.getParameter());
+// log.info("server: type: " + invocation.getParameter().getClass());
+// log.info("server length: " + ((String)invocation.getParameter()).length());
+ return invocation.getParameter();
+ }
+ public void removeListener(InvokerCallbackHandler callbackHandler) {}
+ public void setMBeanServer(MBeanServer server) {}
+ public void setInvoker(ServerInvoker invoker) {}
+ }
+}
\ No newline at end of file
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/HttpCompressionStressTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/HttpCompressionStressTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/HttpCompressionStressTestCase.java 2008-03-07 04:52:56 UTC (rev 3583)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.remoting.marshall.compress;
+
+import org.jboss.test.remoting.marshall.compress.CompressionStressTestParent;
+
+/**
+ * Unit test for JBREM-677.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 6, 2008
+ * </p>
+ */
+public class HttpCompressionStressTestCase extends CompressionStressTestParent
+{
+ protected String getTransport()
+ {
+ return "http";
+ }
+}
+
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/RMICompressionStressTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/RMICompressionStressTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/RMICompressionStressTestCase.java 2008-03-07 04:52:56 UTC (rev 3583)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.remoting.marshall.compress;
+
+import org.jboss.test.remoting.marshall.compress.CompressionStressTestParent;
+
+/**
+ * Unit test for JBREM-677.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 6, 2008
+ * </p>
+ */
+public class RMICompressionStressTestCase extends CompressionStressTestParent
+{
+ protected String getTransport()
+ {
+ return "rmi";
+ }
+}
+
Added: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/SocketCompressionStressTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/SocketCompressionStressTestCase.java (rev 0)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/compress/SocketCompressionStressTestCase.java 2008-03-07 04:52:56 UTC (rev 3583)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.remoting.marshall.compress;
+
+import org.jboss.test.remoting.marshall.compress.CompressionStressTestParent;
+
+
+/**
+ * Unit test for JBREM-677.
+ *
+ * @author <a href="ron.sigal(a)jboss.com">Ron Sigal</a>
+ * @version $Revision: 1.1 $
+ * <p>
+ * Copyright Mar 6, 2008
+ * </p>
+ */
+public class SocketCompressionStressTestCase extends CompressionStressTestParent
+{
+ protected String getTransport()
+ {
+ return "socket";
+ }
+}
+
16 years, 9 months
JBoss Remoting SVN: r3582 - remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-06 23:17:27 -0500 (Thu, 06 Mar 2008)
New Revision: 3582
Modified:
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/AtomicStateMachine.java
Log:
Add read lock protected test to start of wait methods
Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/AtomicStateMachine.java
===================================================================
--- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/AtomicStateMachine.java 2008-03-07 04:15:30 UTC (rev 3581)
+++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/AtomicStateMachine.java 2008-03-07 04:17:27 UTC (rev 3582)
@@ -208,6 +208,9 @@
public void waitInterruptiblyFor(final T state) throws InterruptedException {
+ if (in(state)) {
+ return;
+ }
writeLock.lockInterruptibly();
try {
while (this.state != state) {
@@ -219,6 +222,9 @@
}
public void waitFor(final T state) {
+ if (in(state)) {
+ return;
+ }
writeLock.lock();
try {
while (this.state != state) {
@@ -230,6 +236,9 @@
}
public void waitForHold(final T state) {
+ if (inHold(state)) {
+ return;
+ }
writeLock.lock();
try {
while (this.state != state) {
@@ -251,6 +260,9 @@
}
public boolean waitInterruptiblyFor(final T state, final long timeout, final TimeUnit timeUnit) throws InterruptedException {
+ if (in(state)) {
+ return true;
+ }
final long timeoutMillis = timeUnit.toMillis(timeout);
final long startTime = System.currentTimeMillis();
final long endTime = startTime + timeoutMillis < 0 ? Long.MAX_VALUE : startTime + timeoutMillis;
@@ -269,6 +281,10 @@
}
public T waitInterruptiblyForNot(final T state) throws InterruptedException {
+ final T current = getState();
+ if (current != state) {
+ return current;
+ }
writeLock.lockInterruptibly();
try {
while (this.state == state) {
@@ -281,6 +297,11 @@
}
public T waitInterruptiblyForNotHold(final T state) throws InterruptedException {
+ final T current = getStateHold();
+ if (current != state) {
+ return current;
+ }
+ release();
writeLock.lockInterruptibly();
try {
while (this.state == state) {
@@ -294,6 +315,10 @@
}
public T waitForNot(final T state) {
+ final T current = getState();
+ if (current != state) {
+ return current;
+ }
writeLock.lock();
try {
while (this.state == state) {
@@ -306,6 +331,11 @@
}
public T waitForNotHold(final T state) {
+ final T current = getStateHold();
+ if (current != state) {
+ return current;
+ }
+ release();
writeLock.lock();
try {
while (this.state == state) {
@@ -327,6 +357,10 @@
}
public T waitInterruptiblyForNot(final T state, final long timeout, final TimeUnit timeUnit) throws InterruptedException {
+ final T current = getState();
+ if (current != state) {
+ return current;
+ }
final long timeoutMillis = timeUnit.toMillis(timeout);
final long startTime = System.currentTimeMillis();
final long endTime = startTime + timeoutMillis < 0 ? Long.MAX_VALUE : startTime + timeoutMillis;
@@ -344,6 +378,11 @@
public T waitInterruptiblyForNotHold(final T state, final long timeout, final TimeUnit timeUnit) throws InterruptedException {
+ final T current = getStateHold();
+ if (current != state) {
+ return current;
+ }
+ release();
final long timeoutMillis = timeUnit.toMillis(timeout);
final long startTime = System.currentTimeMillis();
final long endTime = startTime + timeoutMillis < 0 ? Long.MAX_VALUE : startTime + timeoutMillis;
@@ -366,6 +405,11 @@
}
public T waitForNotHold(final T state, final long timeout, final TimeUnit timeUnit) {
+ final T current = getStateHold();
+ if (current != state) {
+ return current;
+ }
+ release();
final long timeoutMillis = timeUnit.toMillis(timeout);
final long startTime = System.currentTimeMillis();
final long endTime = startTime + timeoutMillis < 0 ? Long.MAX_VALUE : startTime + timeoutMillis;
@@ -397,6 +441,10 @@
}
public T waitForNot(final T state, final long timeout, final TimeUnit timeUnit) {
+ final T current = getState();
+ if (current != state) {
+ return current;
+ }
final long timeoutMillis = timeUnit.toMillis(timeout);
final long startTime = System.currentTimeMillis();
final long endTime = startTime + timeoutMillis < 0 ? Long.MAX_VALUE : startTime + timeoutMillis;
16 years, 9 months
JBoss Remoting SVN: r3581 - remoting3/trunk/api/src/main/java/org/jboss/cx/remoting.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-06 23:15:30 -0500 (Thu, 06 Mar 2008)
New Revision: 3581
Added:
remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/IOExceptionCarrier.java
remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/RemotingExceptionCarrier.java
Log:
Exception carrier classes
Added: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/IOExceptionCarrier.java
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/IOExceptionCarrier.java (rev 0)
+++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/IOExceptionCarrier.java 2008-03-07 04:15:30 UTC (rev 3581)
@@ -0,0 +1,16 @@
+package org.jboss.cx.remoting;
+
+import java.io.IOException;
+
+/**
+ *
+ */
+public class IOExceptionCarrier extends RuntimeException {
+ public IOExceptionCarrier(IOException cause) {
+ super(cause);
+ }
+
+ public IOException getCause() {
+ return (IOException) super.getCause();
+ }
+}
Added: remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/RemotingExceptionCarrier.java
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/RemotingExceptionCarrier.java (rev 0)
+++ remoting3/trunk/api/src/main/java/org/jboss/cx/remoting/RemotingExceptionCarrier.java 2008-03-07 04:15:30 UTC (rev 3581)
@@ -0,0 +1,14 @@
+package org.jboss.cx.remoting;
+
+/**
+ *
+ */
+public class RemotingExceptionCarrier extends IOExceptionCarrier {
+ public RemotingExceptionCarrier(RemotingException cause) {
+ super(cause);
+ }
+
+ public RemotingException getCause() {
+ return (RemotingException) super.getCause();
+ }
+}
16 years, 9 months
JBoss Remoting SVN: r3580 - remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-06 22:53:34 -0500 (Thu, 06 Mar 2008)
New Revision: 3580
Modified:
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/SynchronizedQueue.java
Log:
Suppress an IDEA inspection
Modified: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/SynchronizedQueue.java
===================================================================
--- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/SynchronizedQueue.java 2008-03-07 03:53:02 UTC (rev 3579)
+++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/SynchronizedQueue.java 2008-03-07 03:53:34 UTC (rev 3580)
@@ -85,6 +85,7 @@
public <T> T[] toArray(final T[] a) {
synchronized(monitor) {
+ //noinspection SuspiciousToArrayCall
return delegate.toArray(a);
}
}
16 years, 9 months
JBoss Remoting SVN: r3579 - remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-06 22:53:02 -0500 (Thu, 06 Mar 2008)
New Revision: 3579
Added:
remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/Translator.java
Log:
Translator interface
Added: remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/Translator.java
===================================================================
--- remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/Translator.java (rev 0)
+++ remoting3/trunk/util/src/main/java/org/jboss/cx/remoting/util/Translator.java 2008-03-07 03:53:02 UTC (rev 3579)
@@ -0,0 +1,8 @@
+package org.jboss.cx.remoting.util;
+
+/**
+ *
+ */
+public interface Translator<I, O> {
+ O translate(I input);
+}
16 years, 9 months
JBoss Remoting SVN: r3578 - remoting2/branches/2.x/lib/jboss.
by jboss-remoting-commits@lists.jboss.org
Author: david.lloyd(a)jboss.com
Date: 2008-03-06 13:47:16 -0500 (Thu, 06 Mar 2008)
New Revision: 3578
Modified:
remoting2/branches/2.x/lib/jboss/jboss-serialization.jar
Log:
Update JBSER to 1.0.3.GA to fix various test suite failures
Modified: remoting2/branches/2.x/lib/jboss/jboss-serialization.jar
===================================================================
(Binary files differ)
16 years, 9 months
JBoss Remoting SVN: r3577 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/web.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:21:30 -0500 (Thu, 06 Mar 2008)
New Revision: 3577
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/web/WebInvokerTestClient.java
Log:
JBREM-844: Changed log.info() to log.debug().
Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/web/WebInvokerTestClient.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/web/WebInvokerTestClient.java 2008-03-06 08:19:38 UTC (rev 3576)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/web/WebInvokerTestClient.java 2008-03-06 08:21:30 UTC (rev 3577)
@@ -228,12 +228,12 @@
protected void checkContentType() throws Exception
{
- log.info("check_content_type: " + System.getProperty("check_content_type"));
+ log.debug("check_content_type: " + System.getProperty("check_content_type"));
String s = System.getProperty("check_content_type", "true");
boolean doCheck = Boolean.valueOf(s).booleanValue();
if (!doCheck)
{
- log.info("skipping content type check");
+ log.debug("skipping content type check");
return;
}
16 years, 9 months
JBoss Remoting SVN: r3576 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/encrypt.
by jboss-remoting-commits@lists.jboss.org
Author: ron.sigal(a)jboss.com
Date: 2008-03-06 03:19:38 -0500 (Thu, 06 Mar 2008)
New Revision: 3576
Removed:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/encrypt/EncryptingMarshallerTestCase.java
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/encrypt/EncryptionStandaloneTestCase.java
Log:
JBREM-898: Renamed so it won't run in test suite.
Deleted: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/encrypt/EncryptingMarshallerTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/encrypt/EncryptingMarshallerTestCase.java 2008-03-06 08:18:07 UTC (rev 3575)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/encrypt/EncryptingMarshallerTestCase.java 2008-03-06 08:19:38 UTC (rev 3576)
@@ -1,61 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.test.remoting.marshall.encrypt;
-
-import org.apache.log4j.Level;
-import org.jboss.jrunit.harness.TestDriver;
-
-
-/**
- * A EncryptingMarshallerTestCase.
- *
- * @author Anil.Saldhana(a)jboss.org
- * @version $Revision$
- */
-
-public class EncryptingMarshallerTestCase extends TestDriver
-{
- public void declareTestClasses()
- {
- addTestClasses(EncryptingMarshallerTestClient.class.getName(),
- 1,
- EncryptingMarshallerTestServer.class.getName());
-
- }
-
- protected Level getTestLogLevel()
- {
- return Level.ERROR;
- }
-
- /*protected String getClientJVMArguments()
- {
- return "-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y";
- } */
-
- /*protected String getServerJVMArguments()
- {
- return "-Xdebug -Xrunjdwp:transport=dt_socket,address=8686,server=y,suspend=y";
- } */
-}
-
Deleted: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/encrypt/EncryptionStandaloneTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/encrypt/EncryptionStandaloneTestCase.java 2008-03-06 08:18:07 UTC (rev 3575)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/marshall/encrypt/EncryptionStandaloneTestCase.java 2008-03-06 08:19:38 UTC (rev 3576)
@@ -1,183 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.remoting.marshall.encrypt;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import org.jboss.remoting.marshal.MarshalFactory;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.remoting.marshal.encryption.EncryptingMarshaller;
-import org.jboss.remoting.marshal.encryption.EncryptingUnMarshaller;
-import org.jboss.remoting.marshal.http.HTTPMarshaller;
-import org.jboss.remoting.marshal.http.HTTPUnMarshaller;
-import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
-import org.jboss.remoting.marshal.serializable.SerializableUnMarshaller;
-
-import junit.framework.TestCase;
-
-//$Id$
-
-/**
- * Tests Remoting Encryption facilities
- * @author <a href="mailto:Anil.Saldhana@jboss.org">Anil Saldhana</a>
- * @since Aug 16, 2006
- * @version $Revision$
- */
-public class EncryptionStandaloneTestCase extends TestCase
-{
- private Marshaller marshaller;
- private UnMarshaller unmarshaller;
-
- private String[] standard = new String[]
- {null, "AES", "DES", "Blowfish", "DESede"};
-
- private String[] padded = new String[]
- {"AES/CBC/PKCS5Padding", "AES/PCBC/PKCS5Padding","AES/PCBC/PKCS5Padding",
- "AES/CFB/PKCS5Padding", "AES/OFB/PKCS5Padding",
- "DES/CBC/PKCS5Padding", "DES/PCBC/PKCS5Padding","DES/PCBC/PKCS5Padding",
- "DES/CFB/PKCS5Padding", "DES/OFB/PKCS5Padding",
- "DESede/CBC/PKCS5Padding", "DESede/PCBC/PKCS5Padding","DESede/PCBC/PKCS5Padding",
- "DESede/CFB/PKCS5Padding", "DESede/OFB/PKCS5Padding"};
-
- private String[] unpadded = new String[]
- {"AES/CBC/NoPadding", "AES/PCBC/NoPadding","AES/PCBC/NoPadding",
- "AES/CFB/NoPadding", "AES/OFB/NoPadding",
- "DES/CBC/NoPadding", "DES/PCBC/NoPadding","DES/PCBC/NoPadding",
- "DES/CFB/NoPadding", "DES/OFB/NoPadding",
- "DESede/CBC/NoPadding", "DESede/PCBC/NoPadding","DESede/PCBC/NoPadding",
- "DESede/CFB/NoPadding", "DESede/OFB/NoPadding"};
-
-
- public void testSerializable() throws IOException, ClassNotFoundException
- {
- for(int i = 0 ; i < standard.length; i++)
- runAlgoTest(standard[i]);
- for(int i = 0 ; i < padded.length; i++)
- runAlgoTest(padded[i]);
- for(int i = 0 ; i < unpadded.length; i++)
- runAlgoTest(unpadded[i]);
- }
-
-
- public void testWrappedSerializable() throws IOException, ClassNotFoundException
- {
- for(int i = 0 ; i < standard.length; i++)
- runWrappedSerializableTest(standard[i]);
- for(int i = 0 ; i < padded.length; i++)
- runWrappedSerializableTest(padded[i]);
- for(int i = 0 ; i < unpadded.length; i++)
- runWrappedSerializableTest(unpadded[i]);
- }
-
- /**
- * Commented out usecases not supported
- * @throws IOException
- * @throws ClassNotFoundException
- */
- public void testHTTP() throws IOException, ClassNotFoundException
- {
- for(int i = 0 ; i < standard.length; i++)
- runHttpTest(standard[i]);
- for(int i = 0 ; i < padded.length; i++)
- runHttpTest(padded[i]);
- //NoPadding is not correctly supported by HttpUnMarshaller
- /*for(int i = 0 ; i < unpadded.length; i++)
- runHttpTest(unpadded[i]); */
- }
-
-
- protected void runOneTest() throws IOException, ClassNotFoundException
- {
- String testData = "This is some test data";
- Object param = new String(testData);
-
- ByteArrayOutputStream output = new ByteArrayOutputStream();
- marshaller.write(param, output);
- byte[] byteArray = new byte[output.size()];
- byteArray = output.toByteArray();
- ByteArrayInputStream input = new ByteArrayInputStream(byteArray);
- Object result = unmarshaller.read(input, null);
-
- System.out.println("Result: " + result);
- assertEquals(testData, result);
- }
-
- private void runAlgoTest(String algo)
- throws IOException, ClassNotFoundException
- {
- EncryptingMarshaller em = new EncryptingMarshaller();
- EncryptingUnMarshaller um = new EncryptingUnMarshaller();
- if(algo != null)
- {
- em.setCipherAlgorithm(algo);
- um.setCipherAlgorithm(algo);
- }
- MarshalFactory.addMarshaller(EncryptingMarshaller.DATATYPE,em, um);
-
- marshaller = MarshalFactory.getMarshaller(EncryptingMarshaller.DATATYPE);
- unmarshaller = MarshalFactory.getUnMarshaller(EncryptingMarshaller.DATATYPE);
- runOneTest();
- }
-
- private void runHttpTest(String algo)
- throws IOException, ClassNotFoundException
- {
- String datatype = "encryptedHTTP";
- Marshaller m = MarshalFactory.getMarshaller(HTTPMarshaller.DATATYPE);
- UnMarshaller u = MarshalFactory.getUnMarshaller(HTTPUnMarshaller.DATATYPE);
- EncryptingMarshaller em = new EncryptingMarshaller(m);
- EncryptingUnMarshaller um = new EncryptingUnMarshaller(u);
- if(algo != null)
- {
- em.setCipherAlgorithm(algo);
- um.setCipherAlgorithm(algo);
- }
- MarshalFactory.addMarshaller(datatype,em, um);
- marshaller = MarshalFactory.getMarshaller(datatype);
- unmarshaller = MarshalFactory.getUnMarshaller(datatype);
- runOneTest();
- }
-
- private void runWrappedSerializableTest(String algo)
- throws IOException, ClassNotFoundException
- {
- String datatype = "encryptedSerializable";
- String sd = SerializableMarshaller.DATATYPE;
- String sud = SerializableUnMarshaller.DATATYPE;
- EncryptingMarshaller em =
- new EncryptingMarshaller(MarshalFactory.getMarshaller(sd));
- EncryptingUnMarshaller um =
- new EncryptingUnMarshaller(MarshalFactory.getUnMarshaller(sud));
- if(algo != null)
- {
- em.setCipherAlgorithm(algo);
- um.setCipherAlgorithm(algo);
- }
- MarshalFactory.addMarshaller(datatype,em, um);
-
- marshaller = MarshalFactory.getMarshaller(datatype);
- unmarshaller = MarshalFactory.getUnMarshaller(datatype);
- }
-}
16 years, 9 months