01: package org.drools.brms.server.util;
02:
03: import junit.framework.TestCase;
04:
05: import org.drools.brms.client.modeldriven.SuggestionCompletionEngine;
06:
07: public class SuggestionCompletionEngineBuilderTest extends TestCase {
08: SuggestionCompletionEngineBuilder builder = new SuggestionCompletionEngineBuilder();
09:
10: protected void setUp() throws Exception {
11: super .setUp();
12: this .builder.newCompletionEngine();
13: }
14:
15: protected void tearDown() throws Exception {
16: super .tearDown();
17: }
18:
19: public void testAddDSLSentence() {
20: final String input = "{This} is a {pattern} considered pretty \\{{easy}\\} by most \\{people\\}. What do you {say}?";
21: this .builder.addDSLActionSentence(input);
22: this .builder.addDSLConditionSentence("foo bar");
23: final SuggestionCompletionEngine engine = this .builder
24: .getInstance();
25:
26: assertEquals(1, engine.actionDSLSentences.length);
27: assertEquals(1, engine.conditionDSLSentences.length);
28:
29: }
30:
31: }
|