This repository has been archived by the owner on Feb 8, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- stream fields not arrays anymore - added tests using EDSL - wordcount regression test - enabled CounterApp example
- Loading branch information
1 parent
b712f9c
commit db94ea8
Showing
12 changed files
with
198 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
subprojects/s4-core/src/test/java/org/apache/s4/wordcount/WordCountModule.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
subprojects/s4-edsl/src/test/java/org/apache/s4/edsl/wordcount/WordCountApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.apache.s4.edsl.wordcount; | ||
|
||
import java.io.IOException; | ||
|
||
import org.apache.s4.core.Stream; | ||
import org.apache.s4.edsl.BuilderS4DSL; | ||
import org.apache.s4.fixtures.SocketAdapter; | ||
import org.apache.s4.wordcount.SentenceKeyFinder; | ||
import org.apache.s4.wordcount.StringEvent; | ||
import org.apache.s4.wordcount.WordClassifierPE; | ||
import org.apache.s4.wordcount.WordCountEvent; | ||
import org.apache.s4.wordcount.WordCountKeyFinder; | ||
import org.apache.s4.wordcount.WordCounterPE; | ||
import org.apache.s4.wordcount.WordSeenEvent; | ||
import org.apache.s4.wordcount.WordSeenKeyFinder; | ||
import org.apache.s4.wordcount.WordSplitterPE; | ||
|
||
public class WordCountApp extends BuilderS4DSL { | ||
|
||
SocketAdapter<StringEvent> socketAdapter; | ||
|
||
protected void onInit() { | ||
pe("Classifier").type(WordClassifierPE.class).pe("Counter").type(WordCounterPE.class) | ||
.emit(WordCountEvent.class).withKeyFinder(WordCountKeyFinder.class).to("Classifier").pe("Splitter") | ||
.type(WordSplitterPE.class).emit(WordSeenEvent.class).withKeyFinder(WordSeenKeyFinder.class) | ||
.to("Counter").build(); | ||
Stream<StringEvent> sentenceStream = createStream("sentences stream", new SentenceKeyFinder(), | ||
getPE("Splitter")); | ||
try { | ||
socketAdapter = new SocketAdapter<StringEvent>(sentenceStream, new SocketAdapter.SentenceEventFactory()); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
subprojects/s4-edsl/src/test/java/org/apache/s4/edsl/wordcount/WordCountTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.apache.s4.edsl.wordcount; | ||
|
||
import org.junit.Test; | ||
|
||
public class WordCountTest extends org.apache.s4.wordcount.WordCountTest { | ||
|
||
@Test | ||
public void testSimple() throws Exception { | ||
testWordCountApp(WordCountApp.class); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.