use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class AlluxioInterpreterTest method countNotExistTest.
@Test
public void countNotExistTest() throws IOException {
InterpreterResult output = alluxioInterpreter.interpret("count /NotExistFile", null);
Assert.assertEquals(Code.ERROR, output.code());
Assert.assertEquals(ExceptionMessage.PATH_DOES_NOT_EXIST.getMessage("/NotExistFile") + "\n", output.message().get(0).getData());
}
use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class AlluxioInterpreterTest method locationNotExistTest.
@Test
public void locationNotExistTest() throws IOException {
InterpreterResult output = alluxioInterpreter.interpret("location /NotExistFile", null);
Assert.assertEquals(ExceptionMessage.PATH_DOES_NOT_EXIST.getMessage("/NotExistFile") + "\n", output.message().get(0).getData());
Assert.assertEquals(Code.ERROR, output.code());
}
use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class AlluxioInterpreterTest method catTest.
@Test
public void catTest() throws IOException {
FileSystemTestUtils.createByteFile(fs, "/testFile", WriteType.MUST_CACHE, 10, 10);
InterpreterResult output = alluxioInterpreter.interpret("cat /testFile", null);
byte[] expected = BufferUtils.getIncreasingByteArray(10);
Assert.assertEquals(Code.SUCCESS, output.code());
Assert.assertArrayEquals(expected, output.message().get(0).getData().substring(0, output.message().get(0).getData().length() - 1).getBytes());
}
use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class CassandraInterpreterTest method should_execute_statement_with_serial_consistency_option.
@Test
public void should_execute_statement_with_serial_consistency_option() throws Exception {
//Given
String statement = "@serialConsistency=SERIAL\n" + "SELECT * FROM zeppelin.artists LIMIT 1;";
//When
final InterpreterResult actual = interpreter.interpret(statement, intrContext);
//Then
assertThat(actual.code()).isEqualTo(Code.SUCCESS);
}
use of org.apache.zeppelin.interpreter.InterpreterResult in project zeppelin by apache.
the class CassandraInterpreterTest method should_describe_aggregate.
@Test
@Ignore
public //TODO activate test when using Java 8 and C* 3.x
void should_describe_aggregate() throws Exception {
//Given
Properties properties = new Properties();
properties.setProperty(CASSANDRA_HOSTS, "127.0.0.1");
properties.setProperty(CASSANDRA_PORT, "9042");
Interpreter interpreter = new CassandraInterpreter(properties);
interpreter.open();
final String query = "DESCRIBE AGGREGATES;";
//When
final InterpreterResult actual = interpreter.interpret(query, intrContext);
//Then
assertThat(actual.code()).isEqualTo(Code.SUCCESS);
}
Aggregations