private BucketDTO createBucket() { BucketDTO bucket = new BucketDTO(); bucket.setName("StockQuoteAnalyzer"); bucket.setDescription( "This bucket analyzes stock quotes and trigger an event" + " if the last traded amount is greater than 100."); bucket.setEngineProvider("SiddhiCEPRuntime"); return bucket; }
@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()); }