コード例 #1
0
 @BeforeClass(groups = {"wso2.cep"})
 public void login() throws Exception {
   ClientConnectionUtil.waitForPort(9443);
   String loggedInSessionCookie = util.login();
   cepAdminServiceStub =
       new CEPAdminServiceStub("https://localhost:9443/services/CEPAdminService");
   ServiceClient client = cepAdminServiceStub._getServiceClient();
   Options options = client.getOptions();
   options.setManageSession(true);
   options.setProperty(
       org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, loggedInSessionCookie);
 }
コード例 #2
0
  @Test(groups = {"wso2.cep"})
  public void siddhiBucketCreationTest()
      throws CEPAdminServiceCEPConfigurationException, RemoteException,
          CEPAdminServiceCEPAdminException, InterruptedException {

    int numberOfBuckets = cepAdminServiceStub.getAllBucketCount();

    BucketDTO bucket = createBucket();

    InputDTO input = createInput();
    QueryDTO query = createQuery();
    OutputDTO output = createOutput();
    query.setOutput(output);
    bucket.setInputs(new InputDTO[] {input});
    bucket.setQueries(new QueryDTO[] {query});

    cepAdminServiceStub.addBucket(bucket);

    /* extra time for all the services to be properly deployed */
    Thread.sleep(5000);
    Assert.assertEquals(++numberOfBuckets, cepAdminServiceStub.getAllBucketCount());
  }