hammant 2004/06/06 19:03:47
Modified: integrationtests maven.xml
Added: client/impl/src/test/org/apache/altrmi/client/impl
DefaultConnectionPingerTestCase.java
DummyClientInvocationHandler.java
Removed: integrationtests/src/test/org/apache/altrmi/test
DummyInvocationHandler.java
integrationtests/src/test/org/apache/altrmi/test/misc
DefaultConnectionPingerTestCase.java
Log:
DefaultConnectionPinger moved
Revision Changes Path
1.3 +2 -1 incubator-altrmi/integrationtests/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/incubator-altrmi/integrationtests/maven.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- maven.xml 6 Jun 2004 23:03:06 -0000 1.2
+++ maven.xml 7 Jun 2004 02:03:47 -0000 1.3
@@ -44,6 +44,7 @@
<ant:pathelement
location="${plugin.getDependencyPath('commons-attributes-api')}"/>
</ant:classpath>
</ant:taskdef>
+
<!-- TODO: Remove hardcoded test src dir (vinay) -->
<ant:attribute-compiler
destDir="${maven.build.dir}/test-classes">
<ant:fileset dir="${maven.src.dir}/test/"
includes="*.java"/>
@@ -53,7 +54,7 @@
</postGoal>
- <!-- /** Aggregate all jars within the Altrmi Dist directory. -->
+ <!-- /** Aggregate all jars within the AltRMI Dist directory. -->
<postGoal name="test:test">
<j:forEach var="dep" items="${pom.dependencies}">
1.1
incubator-altrmi/client/impl/src/test/org/apache/altrmi/client/impl/DefaultConnectionPingerTestCase.java
Index: DefaultConnectionPingerTestCase.java
===================================================================
/* ====================================================================
* Copyright 2001 - 2004
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.altrmi.client.impl;
import junit.framework.TestCase;
import org.apache.altrmi.common.DefaultThreadPool;
public class DefaultConnectionPingerTestCase extends TestCase
{
public DefaultConnectionPingerTestCase(String name)
{
super(name);
}
protected void setUp() throws Exception
{
super.setUp();
}
public void testPingingStartsAndStops() throws Exception
{
DefaultConnectionPinger pinger = new
DefaultConnectionPinger(1L,10000L);
DummyClientInvocationHandler dummy = new
DummyClientInvocationHandler();
dummy.setThreadPool(new DefaultThreadPool());
pinger.setInvocationHandler(dummy);
pinger.start();
Thread.sleep(1000);
assertTrue("Should have pinged", dummy.isPinged());
pinger.stop();
dummy.reset();
Thread.sleep(1000);
assertTrue("Should have stopped pinging", !dummy.isPinged());
}
}
1.1
incubator-altrmi/client/impl/src/test/org/apache/altrmi/client/impl/DummyClientInvocationHandler.java
Index: DummyClientInvocationHandler.java
===================================================================
/* ====================================================================
* Copyright 2001 - 2004
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.altrmi.client.impl;
import org.apache.altrmi.common.Reply;
import org.apache.altrmi.common.Request;
import org.apache.altrmi.common.ConnectionException;
import org.apache.altrmi.common.CallbackException;
import org.apache.altrmi.common.ThreadPool;
import org.apache.altrmi.client.ClientInvocationHandler;
import org.apache.altrmi.client.ClientMonitor;
import org.apache.altrmi.client.ConnectionPinger;
/**
* Class DummyClientInvocationHandler
*
*
* @author Paul Hammant
* @version $Revision: 1.1 $
*/
public class DummyClientInvocationHandler implements ClientInvocationHandler
{
boolean pinged = false;
long lastReq = System.currentTimeMillis();
private ClientMonitor m_clientMonitor;
private ThreadPool m_threadContextProvider;
public boolean isPinged()
{
return pinged;
}
public void reset()
{
pinged = false;
}
public Reply handleInvocation(Request request)
{
throw new UnsupportedOperationException();
}
public void ping()
{
pinged = true;
}
public long getLastRealRequest()
{
return lastReq;
}
public ClassLoader getInterfacesClassLoader()
{
throw new UnsupportedOperationException();
}
public void setClientMonitor(ClientMonitor clientMonitor)
{
m_clientMonitor = clientMonitor;
}
public void setConnectionPinger(ConnectionPinger connectionPinger)
{
throw new UnsupportedOperationException();
}
public void initialize() throws ConnectionException
{
throw new UnsupportedOperationException();
}
public void close()
{
throw new UnsupportedOperationException();
}
public Object resolveArgument(String remoteObjName,String
methodSignature, Class inputArgumentClass, Object inputArgumentInstance)
{
throw new UnsupportedOperationException();
}
public ClientMonitor getClientMonitor()
{
return m_clientMonitor;
}
public boolean isCallBackEnabled()
{
return false;
}
public boolean exposeObject(Object exposedObject, Class exposedInterface)
throws CallbackException
{
throw new UnsupportedOperationException();
}
public String getPublishedName(Object exposedObject)
{
throw new UnsupportedOperationException();
}
public void setThreadPool(ThreadPool threadContextProvider)
{
m_threadContextProvider = threadContextProvider;
}
public ThreadPool getThreadPool()
{
return m_threadContextProvider;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]