use of com.yahoo.document.datatypes.StringFieldValue in project vespa by vespa-engine.
the class EchoTestCase method requireThatValueIsEchoed.
@Test
public void requireThatValueIsEchoed() {
ByteArrayOutputStream out = new ByteArrayOutputStream();
ExecutionContext ctx = new ExecutionContext(new SimpleTestAdapter());
ctx.setValue(new StringFieldValue("69"));
new EchoExpression(new PrintStream(out)).execute(ctx);
assertEquals("69" + System.getProperty("line.separator"), out.toString());
}
use of com.yahoo.document.datatypes.StringFieldValue in project vespa by vespa-engine.
the class ExecutionContextTestCase method requireThatValueCanBeSet.
@Test
public void requireThatValueCanBeSet() {
ExecutionContext ctx = new ExecutionContext();
FieldValue val = new StringFieldValue("foo");
ctx.setValue(val);
assertSame(val, ctx.getValue());
}
use of com.yahoo.document.datatypes.StringFieldValue in project vespa by vespa-engine.
the class ExecutionContextTestCase method requireThatClearRemovesVariables.
@Test
public void requireThatClearRemovesVariables() {
ExecutionContext ctx = new ExecutionContext();
ctx.setVariable("foo", new StringFieldValue("foo"));
ctx.clear();
assertNull(ctx.getVariable("foo"));
}
use of com.yahoo.document.datatypes.StringFieldValue in project vespa by vespa-engine.
the class ExecutionContextTestCase method requireThatClearRemovesValue.
@Test
public void requireThatClearRemovesValue() {
ExecutionContext ctx = new ExecutionContext();
ctx.setValue(new StringFieldValue("foo"));
ctx.clear();
assertNull(ctx.getValue());
}
use of com.yahoo.document.datatypes.StringFieldValue in project vespa by vespa-engine.
the class ExecutionContextTestCase method requireThatLanguageCanBeResolved.
@Test
public void requireThatLanguageCanBeResolved() {
ExecutionContext ctx = new ExecutionContext();
ctx.setValue(new StringFieldValue("\u3072\u3089\u304c\u306a"));
assertEquals(Language.JAPANESE, ctx.resolveLanguage(new SimpleLinguistics()));
ctx.setValue(new StringFieldValue("\ud55c\uae00\uacfc"));
assertEquals(Language.KOREAN, ctx.resolveLanguage(new SimpleLinguistics()));
}
Aggregations