use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class RESTPubSubTest method testSettings.
@Test
public void testSettings() throws PubSubException {
BulletConfig config = new BulletConfig("src/test/resources/test_config.yaml");
RESTPubSub pubSub = new RESTPubSub(config);
// Test custom values from file
RESTQueryPublisher publisher = (RESTQueryPublisher) pubSub.getPublisher();
String queryURL = publisher.getQueryURL();
Assert.assertEquals(queryURL, "http://localhost:9901/CUSTOM/query");
// Test defaults
RESTSubscriber resultSubscriber = (RESTSubscriber) pubSub.getSubscriber();
List<String> urls = resultSubscriber.getUrls();
Assert.assertEquals(urls.size(), 1);
Assert.assertEquals(urls.get(0), "http://localhost:9901/api/bullet/pubsub/result");
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class AggregationOperationsTest method testGroupByStrategy.
@Test
public void testGroupByStrategy() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(Aggregation.Type.GROUP);
aggregation.setFields(singletonMap("field", "foo"));
aggregation.setAttributes(singletonMap(GroupOperation.OPERATIONS, singletonList(singletonMap(GroupOperation.OPERATION_TYPE, GroupOperation.GroupOperationType.COUNT.getName()))));
aggregation.configure(config);
Assert.assertEquals(AggregationOperations.findStrategy(aggregation, config).getClass(), GroupBy.class);
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class AggregationOperationsTest method testCountDistinctStrategy.
@Test
public void testCountDistinctStrategy() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(Aggregation.Type.COUNT_DISTINCT);
aggregation.setFields(singletonMap("field", "foo"));
aggregation.configure(config);
Assert.assertEquals(AggregationOperations.findStrategy(aggregation, config).getClass(), CountDistinct.class);
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class AggregationOperationsTest method testTopKStrategy.
@Test
public void testTopKStrategy() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(Aggregation.Type.TOP_K);
aggregation.setFields(singletonMap("field", "foo"));
aggregation.configure(config);
Assert.assertEquals(AggregationOperations.findStrategy(aggregation, config).getClass(), TopK.class);
}
use of com.yahoo.bullet.common.BulletConfig in project bullet-core by yahoo.
the class AggregationOperationsTest method testNullType.
@Test(expectedExceptions = NullPointerException.class)
public void testNullType() {
Aggregation aggregation = new Aggregation();
BulletConfig config = new BulletConfig();
aggregation.setType(null);
aggregation.configure(config);
AggregationOperations.findStrategy(aggregation, config);
}
Aggregations