コード例 #1
0
 @Test(
     groups = "wso2.das",
     description = "Check stream exception situation",
     dependsOnMethods = "addStreamDefinition",
     expectedExceptions = AxisFault.class)
 public void addSameStreamDefWithDifferentAttribute() throws Exception {
   StreamDefinitionBean streamDefinitionBean =
       getEventStreamBeanTable1Version1DifferentAttribute();
   webServiceClient.addStreamDefinition(streamDefinitionBean);
 }
コード例 #2
0
 @Test(groups = "wso2.das", description = "Adding valid stream definition")
 public void addStreamDefinition() throws Exception {
   init();
   StreamDefinitionBean streamDefinitionBean = getEventStreamBeanTable1Version1();
   webServiceClient.addStreamDefinition(streamDefinitionBean);
   Thread.sleep(5000);
   StreamDefinitionBean streamDefinition =
       webServiceClient.getStreamDefinition(TABLE1, STREAM_VERSION_1);
   Assert.assertEquals(streamDefinition.getName(), TABLE1, "Stream name mismatch");
   Assert.assertNotNull(streamDefinition.getPayloadData(), "Empty payload array");
   Assert.assertEquals(streamDefinition.getPayloadData().length, 2, "Invalid payload data count");
 }
コード例 #3
0
 @Test(
     groups = "wso2.das",
     description = "Publish event",
     dependsOnMethods = "addStreamDefinition")
 public void publishEvent() throws Exception {
   StreamDefinitionBean streamDefTable2Version1 = getEventStreamBeanTable2Version1();
   webServiceClient.addStreamDefinition(streamDefTable2Version1);
   EventBean eventBean = new EventBean();
   eventBean.setStreamName(TABLE2);
   eventBean.setStreamVersion(STREAM_VERSION_1);
   RecordValueEntryBean[] payloadData = new RecordValueEntryBean[2];
   RecordValueEntryBean uuid = new RecordValueEntryBean();
   uuid.setFieldName("uuid");
   uuid.setType("LONG");
   uuid.setLongValue(123);
   payloadData[0] = uuid;
   RecordValueEntryBean name = new RecordValueEntryBean();
   name.setFieldName("name");
   name.setType("STRING");
   name.setStringValue("DAS");
   payloadData[1] = name;
   eventBean.setPayloadData(payloadData);
   webServiceClient.publishEvent(eventBean);
 }