Examples of SCSubscribeMessage


Examples of org.serviceconnector.api.SCSubscribeMessage

   * Expectation: throws SCMPValidatorException
   */
  @Test(expected = SCMPValidatorException.class)
  public void t21_subscribeNoMask() throws Exception {
    publishService = client.newPublishService(TestConstants.pubServiceName1);
    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    SCSubscribeMessage subMsgResponse = null;
    subMsgRequest.setSessionInfo(TestConstants.doNothingCmd);
    subMsgRequest.setNoDataIntervalSeconds(100);
    msgCallback = new MsgCallback(publishService);
    subMsgResponse = publishService.subscribe(subMsgRequest, msgCallback);
  }
View Full Code Here

Examples of org.serviceconnector.api.SCSubscribeMessage

   * Expectation: passes
   */
  @Test
  public void t22_subscribeBlankMask() throws Exception {
    publishService = client.newPublishService(TestConstants.pubServiceName1);
    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    SCSubscribeMessage subMsgResponse = null;
    subMsgRequest.setMask(" ");
    subMsgRequest.setSessionInfo(TestConstants.doNothingCmd);
    subMsgRequest.setNoDataIntervalSeconds(100);
    msgCallback = new MsgCallback(publishService);
    subMsgResponse = publishService.subscribe(subMsgRequest, msgCallback);
View Full Code Here

Examples of org.serviceconnector.api.SCSubscribeMessage

   * Expectation: throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t23_subscribeMaskTooLong() throws Exception {
    publishService = client.newPublishService(TestConstants.pubServiceName1);
    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    SCSubscribeMessage subMsgResponse = null;
    subMsgRequest.setMask(TestConstants.stringLength257);
    subMsgRequest.setSessionInfo(TestConstants.doNothingCmd);
    subMsgRequest.setNoDataIntervalSeconds(100);
    msgCallback = new MsgCallback(publishService);
    subMsgResponse = publishService.subscribe(subMsgRequest, msgCallback);
View Full Code Here

Examples of org.serviceconnector.api.SCSubscribeMessage

   * Expectation: throws SCMPValidatorException
   */
  @Test(expected = SCMPValidatorException.class)
  public void t23_subscribeMaskIllegalCharacter() throws Exception {
    publishService = client.newPublishService(TestConstants.pubServiceName1);
    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    SCSubscribeMessage subMsgResponse = null;
    subMsgRequest.setMask("abc%xy");
    subMsgRequest.setSessionInfo(TestConstants.doNothingCmd);
    subMsgRequest.setNoDataIntervalSeconds(100);
    msgCallback = new MsgCallback(publishService);
    subMsgResponse = publishService.subscribe(subMsgRequest, msgCallback);
View Full Code Here

Examples of org.serviceconnector.api.SCSubscribeMessage

   * Expectation: passes
   */
  @Test
  public void t25_noDataInterval() throws Exception {
    publishService = client.newPublishService(TestConstants.pubServiceName1);
    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    subMsgRequest.setDataLength(TestConstants.pangram.length());
    SCSubscribeMessage subMsgResponse = null;
    subMsgRequest.setMask(TestConstants.mask);
    subMsgRequest.setSessionInfo(TestConstants.doNothingCmd);
    subMsgRequest.setNoDataIntervalSeconds(10);
    msgCallback = new MsgCallback(publishService);
    subMsgResponse = publishService.subscribe(subMsgRequest, msgCallback);
    Assert.assertNotNull("the session ID is null", publishService.getSessionId());
    Assert.assertEquals("message body is not the same length", subMsgRequest.getDataLength(), subMsgResponse.getDataLength());
    Assert.assertEquals("compression is not the same", subMsgRequest.isCompressed(), subMsgResponse.isCompressed());
    Assert.assertTrue("is not subscribed", publishService.isSubscribed());
    publishService.unsubscribe();
    Assert.assertNull("the session ID is not null", publishService.getSessionId());
  }
View Full Code Here

Examples of org.serviceconnector.api.SCSubscribeMessage

   * Expectation: throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t26_noDataIntervalNegative() throws Exception {
    publishService = client.newPublishService(TestConstants.pubServiceName1);
    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    SCSubscribeMessage subMsgResponse = null;
    subMsgRequest.setMask(TestConstants.mask);
    subMsgRequest.setSessionInfo(TestConstants.doNothingCmd);
    subMsgRequest.setNoDataIntervalSeconds(-1);
    msgCallback = new MsgCallback(publishService);
    subMsgResponse = publishService.subscribe(subMsgRequest, msgCallback);
View Full Code Here

Examples of org.serviceconnector.api.SCSubscribeMessage

   * Expectation: throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t27_noDataIntervalZero() throws Exception {
    publishService = client.newPublishService(TestConstants.pubServiceName1);
    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    SCSubscribeMessage subMsgResponse = null;
    subMsgRequest.setMask(TestConstants.mask);
    subMsgRequest.setSessionInfo(TestConstants.doNothingCmd);
    subMsgRequest.setNoDataIntervalSeconds(0);
    msgCallback = new MsgCallback(publishService);
    subMsgResponse = publishService.subscribe(subMsgRequest, msgCallback);
View Full Code Here

Examples of org.serviceconnector.api.SCSubscribeMessage

   * Expectation: throws SCServiceException
   */
  @Test(expected = SCServiceException.class)
  public void t28_noDataInterval() throws Exception {
    publishService = client.newPublishService(TestConstants.pubServiceName1);
    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    SCSubscribeMessage subMsgResponse = null;
    subMsgRequest.setMask(TestConstants.mask);
    subMsgRequest.setSessionInfo(TestConstants.doNothingCmd);
    subMsgRequest.setNoDataIntervalSeconds(67000);
    msgCallback = new MsgCallback(publishService);
    subMsgResponse = publishService.subscribe(subMsgRequest, msgCallback);
View Full Code Here

Examples of org.serviceconnector.api.SCSubscribeMessage

   * Expectation: throws SCMPValidatorException
   */
  @Test(expected = SCMPValidatorException.class)
  public void t71_changeSubscriptionNullMask() throws Exception {
    publishService = client.newPublishService(TestConstants.pubServiceName1);
    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    subMsgRequest.setDataLength(TestConstants.pangram.length());
    SCSubscribeMessage subMsgResponse = null;
    subMsgRequest.setMask(TestConstants.mask);
    subMsgRequest.setSessionInfo(TestConstants.doNothingCmd);
    subMsgRequest.setNoDataIntervalSeconds(100);
    msgCallback = new MsgCallback(publishService);
    subMsgResponse = publishService.subscribe(subMsgRequest, msgCallback);
View Full Code Here

Examples of org.serviceconnector.api.SCSubscribeMessage

    SCClient client2 = new SCClient(TestConstants.HOST, TestConstants.PORT_SC2_TCP, ConnectionType.NETTY_TCP);
    client2.attach();
    SCPublishService service1 = client.newPublishService(TestConstants.pubServiceName1);
    SCPublishService service2 = client2.newPublishService(TestConstants.pubServiceName1);

    SCSubscribeMessage subMsgRequest = new SCSubscribeMessage(TestConstants.pangram);
    subMsgRequest.setDataLength(TestConstants.pangram.length());
    @SuppressWarnings("unused")
    SCSubscribeMessage subMsgResponse = null;
    subMsgRequest.setMask(TestConstants.mask);
    subMsgRequest.setSessionInfo(TestConstants.doNothingCmd);
    subMsgRequest.setNoDataIntervalSeconds(10);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.