1
package org.jboss.test.remoting.connection;
3
import java.io.IOException;
4
import java.net.MalformedURLException;
5
import java.util.HashMap;
8
import junit.framework.TestCase;
10
import org.jboss.remoting.Client;
11
import org.jboss.remoting.ConnectionFailedException;
12
import org.jboss.remoting.ConnectionValidator;
13
import org.jboss.remoting.InvokerLocator;
14
import org.jboss.remoting.MicroRemoteClientInvoker;
15
import org.jboss.remoting.marshal.Marshaller;
16
import org.jboss.remoting.marshal.UnMarshaller;
17
import org.jboss.remoting.transport.ClientInvoker;
19
public class ConnectionValidatorTestCase extends TestCase
22
public void testShouldDisallowDirectRun()
24
ConnectionValidator cv = new ConnectionValidator(new Client() {
25
public Map getConfiguration()
30
public ClientInvoker getInvoker()
34
return new MicroRemoteClientInvoker(
35
new InvokerLocator("http://dummy:65535/dummy/")) {
37
public String getSessionId()
42
protected String getDefaultDataType()
44
throw new UnsupportedOperationException();
47
protected void handleConnect() throws ConnectionFailedException
49
throw new UnsupportedOperationException();
52
protected void handleDisconnect()
54
throw new UnsupportedOperationException();
57
protected Object transport(String sessionId, Object invocation, Map metadata, Marshaller marshaller,
58
UnMarshaller unmarshaller) throws IOException, ConnectionFailedException, ClassNotFoundException
60
throw new UnsupportedOperationException();
64
catch (MalformedURLException e)
66
throw new RuntimeException(e);
74
fail("Should throw IllegalStateException");
75
} catch (IllegalStateException e) {