hammant 2004/06/06 16:42:39
Added: client/impl/src/test/org/apache/altrmi/client/impl/direct
DirectHostContextTestCase.java
Log:
Start of client side unit tests
Revision Changes Path
1.1
incubator-altrmi/client/impl/src/test/org/apache/altrmi/client/impl/direct/DirectHostContextTestCase.java
Index: DirectHostContextTestCase.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.direct;
import junit.framework.TestCase;
import org.apache.altrmi.server.ServerInvocationHandler;
import org.apache.altrmi.common.Reply;
import org.apache.altrmi.common.Request;
import org.apache.altrmi.common.GarbageCollectionReply;
import org.apache.altrmi.common.GarbageCollectionRequest;
import org.apache.altrmi.client.ClientInvocationHandler;
import java.util.Vector;
public class DirectHostContextTestCase extends TestCase {
public void testBasicPassingOfRequests() {
final Vector vec = new Vector();
DirectHostContext dhc = new DirectHostContext.WithSimpleDefaults(new
ServerInvocationHandler() {
public Reply handleInvocation(Request request, Object
connectionDetails) {
vec.add(request);
return new GarbageCollectionReply();
}
});
ClientInvocationHandler cih = dhc.getInvocationHandler();
assertTrue(cih.handleInvocation(new GarbageCollectionRequest())
instanceof GarbageCollectionReply);
assertTrue(vec.get(0) instanceof GarbageCollectionRequest);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]