public void testPutStreamFromClientToClient() { log.info("testPutStreamFromClientToClient("); // Interface implementation for the second client BSkeleton_ClientIF partner = new ClientIF_putStreams(); // Create second client BClient_Testser client2 = TestUtilsHttp.createClient(); client2.addRemote(partner); // Pass the interface of the second client to the server side of the first client client.ServerIF.SetPartner(partner); // First client queries the interface of the second client from the server side ClientIF partnerIF = client.ServerIF.GetPartner(); for (int i = 0; i < 1; i++) { log.info("call client..."); IList <Stream> arr = TestUtilsHttp.makeTestStreams(); partnerIF.PutStreams(arr, 0); log.info("call client OK"); } client2.done(); log.info(")testPutStreamFromClientToClient"); }
public void testServerRequestsStreamFromClient() { log.info("testServerRequestsStreamFromClient("); // (1) Provide implementation for interface ClientIF client.addRemote(new MyClientIF_getStreams()); // (2) Call server method. // On the server, this method calls the client-side interface // registered in step (1) log.info("call client..."); IList <Stream> arrR = remote.GetStreamsFromClient(true); log.info("call client OK"); List <Stream> arr = TestUtilsHttp.makeTestStreams(); TestUtils.assertEquals(log, "streams.length", arr.Count, arrR.Count); for (int i = 0; i < arr.Count; i++) { TestUtils.assertEquals(log, "stream[" + i + "]", arr[i], arrR[i]); } log.info(")testServerRequestsStreamFromClient"); }
public void testCallClientFromClientThrowEx() { log.info("testCallClientFromClientThrowEx("); BSkeleton_ClientIF partner = new MyClientIF_throwEx(); BClient_Testser client2 = TestUtilsHttp.createClient(); client2.addRemote(partner); client.ServerIF.SetPartner(partner); ClientIF partnerIF = client.ServerIF.GetPartner(); try { partnerIF.IncrementInt(7); } catch (BException e) { TestUtils.assertEquals(log, "exception", exceptionCode, e.Code); } log.info(")testCallClientFromClientThrowEx"); }
public void testHandoverStream() { log.info("testHandoverStream("); List <Stream> streams = TestUtilsHttp.makeTestStreams(); for (int i = 0; i < streams.Count; i++) { Stream istrm = streams[i]; remote.SetImage(istrm); Stream strmFromServer = remote.GetImage(); BContentStream streamFailOpen = new BContentStreamWrapperFailOpen(strmFromServer); remote.SetImage(streamFailOpen); for (int j = 0; j < 2; j++) { List <Stream> estreams = TestUtilsHttp.makeTestStreams(); Stream estrm = estreams[i]; Stream rstrm = remote.GetImage(); TestUtils.assertEquals(log, "stream[" + i + "]=" + estrm, estrm, rstrm); } remote.SetImage(null); TestUtils.checkTempDirEmpty(client); } log.info(")testHandoverStream"); }
public override IList <Stream> GetStreams(int ctrl) { try { return(TestUtilsHttp.makeTestStreams()); } catch (IOException e) { throw new BException(BExceptionC.IOERROR, "", e); } }
public void setUp() { BClient_Testser client1 = TestUtilsHttp.createClient(); client1.RemoteWithAuthentication.SetUseAuthentication(true); client1.done(); client = TestUtilsHttp.createClient(); remote = client.RemoteWithAuthentication; }
public override void PutStreams(IList <Stream> streams, int ctrl) { try { List <Stream> arr = TestUtilsHttp.makeTestStreams(); TestUtils.assertEquals(log, "streams.length", arr.Count, streams.Count); for (int i = 0; i < arr.Count; i++) { TestUtils.assertEquals(log, "stream[" + i + "]", arr[i], streams[i]); } } catch (IOException e) { throw new BException(BExceptionC.IOERROR, "", e); } }
public void testServerProvidesStreamForClient() { log.info("testServerProvidesStreamForClient("); // (1) Provide implementation for interface ClientIF client.addRemote(new ClientIF_putStreams()); // (2) Call server method. // On the server, this method calls the client-side interface // registered in step (1) log.info("call client..."); List <Stream> arr = TestUtilsHttp.makeTestStreams(); remote.PutStreamsOnClient(arr); log.info("call client OK"); log.info(")testServerProvidesStreamForClient"); }
public void testCallClientFromClient() { log.info("testCallClientFromClient("); BSkeleton_ClientIF partner = new MyClientIF_withIncrementInt(); BClient_Testser client2 = TestUtilsHttp.createClient(); client2.addRemote(partner); client.ServerIF.SetPartner(partner); ClientIF partnerIF = client.ServerIF.GetPartner(); int r = partnerIF.IncrementInt(7); TestUtils.assertEquals(log, "incrementInt", 8, r); log.info(")testCallClientFromClient"); }
public void testReturnStreamFromClientToClient() { log.info("testReturnStreamFromClientToClient("); // Interface implementation for the second client BSkeleton_ClientIF partner = new MyClientIF_getStreams(); // Create second client BClient_Testser client2 = TestUtilsHttp.createClient(); client2.addRemote(partner); // Pass the interface of the second client to the server side of the first client client.ServerIF.SetPartner(partner); // First client queries the interface of the second client from the server side ClientIF partnerIF = client.ServerIF.GetPartner(); log.info("call client..."); IList <Stream> arrR = partnerIF.GetStreams(0); log.info("call client OK"); List <Stream> arr = TestUtilsHttp.makeTestStreams(); TestUtils.assertEquals(log, "streams.length", arr.Count, arrR.Count); for (int i = 0; i < arr.Count; i++) { TestUtils.assertEquals(log, "stream[" + i + "]", arr[i], arrR[i]); } client2.done(); log.info(")testReturnStreamFromClientToClient"); }
public void setUp() { client = TestUtilsHttp.createClient(BWireFlags.GZIP); remote = client.RemoteMapTypes; }
public void setUp() { client = TestUtilsHttp.createClient(); remote = client.ServerIF; }
public void setUp() { client = TestUtilsHttp.createClient(); remote = client.RemoteStreams; }
public void setUp() { client = TestUtilsHttp.createClient(); remote = client.RemotePrimitiveTypes; }
public void setUp() { client = TestUtilsHttp.createClient(); }