Search in sources :

Example 1 with CustomOutputFieldsDeclarer

use of com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer in project bullet-storm by yahoo.

the class FilterBoltTest method testOutputFields.

@Test
public void testOutputFields() {
    CustomOutputFieldsDeclarer declarer = new CustomOutputFieldsDeclarer();
    bolt.declareOutputFields(declarer);
    Fields expected = new Fields(TopologyConstants.ID_FIELD, TopologyConstants.DATA_FIELD);
    Assert.assertTrue(declarer.areFieldsPresent(TopologyConstants.DATA_STREAM, false, expected));
}
Also used : Fields(org.apache.storm.tuple.Fields) CustomOutputFieldsDeclarer(com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer) Test(org.testng.annotations.Test) DistributionTest(com.yahoo.bullet.aggregations.DistributionTest) TopKTest(com.yahoo.bullet.aggregations.TopKTest) CountDistinctTest(com.yahoo.bullet.aggregations.CountDistinctTest)

Example 2 with CustomOutputFieldsDeclarer

use of com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer in project bullet-storm by yahoo.

the class JoinBoltTest method testOutputFields.

@Test
public void testOutputFields() {
    CustomOutputFieldsDeclarer declarer = new CustomOutputFieldsDeclarer();
    bolt.declareOutputFields(declarer);
    Fields expectedResultFields = new Fields(TopologyConstants.ID_FIELD, TopologyConstants.RESULT_FIELD, TopologyConstants.METADATA_FIELD);
    Fields expectedFeedbackFields = new Fields(TopologyConstants.ID_FIELD, TopologyConstants.METADATA_FIELD);
    Assert.assertTrue(declarer.areFieldsPresent(TopologyConstants.RESULT_STREAM, false, expectedResultFields));
    Assert.assertTrue(declarer.areFieldsPresent(TopologyConstants.FEEDBACK_STREAM, false, expectedFeedbackFields));
}
Also used : Fields(org.apache.storm.tuple.Fields) CustomOutputFieldsDeclarer(com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer) Test(org.testng.annotations.Test) GroupByTest(com.yahoo.bullet.aggregations.GroupByTest) DistributionTest(com.yahoo.bullet.aggregations.DistributionTest) TopKTest(com.yahoo.bullet.aggregations.TopKTest) CountDistinctTest(com.yahoo.bullet.aggregations.CountDistinctTest)

Example 3 with CustomOutputFieldsDeclarer

use of com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer in project bullet-storm by yahoo.

the class QuerySpoutTest method testDeclaredOutputFields.

@Test
public void testDeclaredOutputFields() {
    CustomOutputFieldsDeclarer declarer = new CustomOutputFieldsDeclarer();
    spout.declareOutputFields(declarer);
    Fields expectedQueryFields = new Fields(TopologyConstants.ID_FIELD, TopologyConstants.QUERY_FIELD, TopologyConstants.METADATA_FIELD);
    Fields expectedMetadataFields = new Fields(TopologyConstants.ID_FIELD, TopologyConstants.METADATA_FIELD);
    Assert.assertTrue(declarer.areFieldsPresent(TopologyConstants.QUERY_STREAM, false, expectedQueryFields));
    Assert.assertTrue(declarer.areFieldsPresent(TopologyConstants.METADATA_STREAM, false, expectedMetadataFields));
}
Also used : Fields(org.apache.storm.tuple.Fields) CustomOutputFieldsDeclarer(com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer) Test(org.testng.annotations.Test)

Example 4 with CustomOutputFieldsDeclarer

use of com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer in project bullet-storm by yahoo.

the class ResultBoltTest method testDeclareOutputFields.

@Test
public void testDeclareOutputFields() {
    CustomOutputFieldsDeclarer declarer = new CustomOutputFieldsDeclarer();
    bolt.declareOutputFields(declarer);
    Assert.assertTrue(!declarer.areFieldsDeclared());
}
Also used : CustomOutputFieldsDeclarer(com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer) Test(org.testng.annotations.Test)

Example 5 with CustomOutputFieldsDeclarer

use of com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer in project bullet-storm by yahoo.

the class LoopBoltTest method testDeclareOutputFields.

@Test
public void testDeclareOutputFields() {
    CustomOutputFieldsDeclarer declarer = new CustomOutputFieldsDeclarer();
    bolt.declareOutputFields(declarer);
    Assert.assertTrue(!declarer.areFieldsDeclared());
}
Also used : CustomOutputFieldsDeclarer(com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer) Test(org.testng.annotations.Test)

Aggregations

CustomOutputFieldsDeclarer (com.yahoo.bullet.storm.testing.CustomOutputFieldsDeclarer)6 Test (org.testng.annotations.Test)6 Fields (org.apache.storm.tuple.Fields)4 CountDistinctTest (com.yahoo.bullet.aggregations.CountDistinctTest)2 DistributionTest (com.yahoo.bullet.aggregations.DistributionTest)2 TopKTest (com.yahoo.bullet.aggregations.TopKTest)2 GroupByTest (com.yahoo.bullet.aggregations.GroupByTest)1