public static void test(Config conf) throws Exception {
int spout_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_SPOUT_PARALLELISM_HINT), 1);
int split_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_SPLIT_PARALLELISM_HINT), 1);
int count_Parallelism_hint = JStormUtils.parseInt(conf.get(TOPOLOGY_COUNT_PARALLELISM_HINT), 1);
TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("spout", new FastRandomSentenceSpout(), spout_Parallelism_hint);
builder.setBolt("split", new SplitSentence(), split_Parallelism_hint).shuffleGrouping("spout");
long windowSize = JStormUtils.parseLong(conf.get("window.size.sec"), 10);
long stateWindowSize = JStormUtils.parseLong(conf.get("state.window.size.sec"), 60);
builder.setBolt("count", new WordCount()
.timeWindow(Time.seconds(windowSize))
.withStateSize(Time.seconds(stateWindowSize)),
count_Parallelism_hint).fieldsGrouping("split", new Fields("word"));
String[] className = Thread.currentThread().getStackTrace()[1].getClassName().split("\\.");
String topologyName = className[className.length - 1];
boolean isLocal = true;
if (conf.containsKey("storm.cluster.mode")) {
isLocal = StormConfig.local_mode(conf);
}
JStormHelper.runTopology(builder.createTopology(), topologyName, conf, 60,
new JStormHelper.CheckAckedFail(conf), isLocal);
}