Search in sources :

Example 1 with FakeException

use of io.confluent.ksql.FakeException in project ksql by confluentinc.

the class ConsoleTest method testPrintErrorStreamedRow.

@Test
public void testPrintErrorStreamedRow() throws IOException {
    StreamedRow row = new StreamedRow(new FakeException());
    terminal.printStreamedRow(row);
}
Also used : StreamedRow(io.confluent.ksql.rest.entity.StreamedRow) FakeException(io.confluent.ksql.FakeException) Test(org.junit.Test)

Example 2 with FakeException

use of io.confluent.ksql.FakeException in project ksql by confluentinc.

the class ConsoleTest method testPrintKSqlEntityList.

@Test
public void testPrintKSqlEntityList() throws IOException {
    Map<String, Object> properties = new HashMap<>();
    properties.put("k1", 1);
    properties.put("k2", "v2");
    properties.put("k3", true);
    List<Queries.RunningQuery> queries = new ArrayList<>();
    queries.add(new Queries.RunningQuery("select * from t1", "TestTopic", new QueryId("0")));
    for (int i = 0; i < 5; i++) {
        KsqlEntityList entityList = new KsqlEntityList(Arrays.asList(new CommandStatusEntity("e", "topic/1/create", "SUCCESS", "Success Message"), new ErrorMessageEntity("e", new FakeException()), new PropertiesList("e", properties), new Queries("e", queries), new SourceDescription("e", "TestSource", Collections.EMPTY_LIST, Collections.EMPTY_LIST, buildTestSchema(i), DataSource.DataSourceType.KTABLE.getKqlType(), "key", "2000-01-01", "stats", "errors", false, "avro", "kadka-topic", "topology", "executionPlan", 1, 1), new TopicDescription("e", "TestTopic", "TestKafkaTopic", "AVRO", "schemaString"), new StreamsList("e", Arrays.asList(new SourceInfo.Stream("TestStream", "TestTopic", "AVRO"))), new TablesList("e", Arrays.asList(new SourceInfo.Table("TestTable", "TestTopic", "JSON", false))), new KsqlTopicsList("e", Arrays.asList(new KsqlTopicInfo("TestTopic", "TestKafkaTopic", DataSource.DataSourceSerDe.JSON))), new KafkaTopicsList("e", Arrays.asList(new KafkaTopicInfo("TestKafkaTopic", true, ImmutableList.of(1), 1, 1))), new ExecutionPlan("Test Execution Plan")));
        terminal.printKsqlEntityList(entityList);
    }
}
Also used : KsqlEntityList(io.confluent.ksql.rest.entity.KsqlEntityList) Queries(io.confluent.ksql.rest.entity.Queries) HashMap(java.util.HashMap) KafkaTopicsList(io.confluent.ksql.rest.entity.KafkaTopicsList) ArrayList(java.util.ArrayList) CommandStatusEntity(io.confluent.ksql.rest.entity.CommandStatusEntity) ExecutionPlan(io.confluent.ksql.rest.entity.ExecutionPlan) StreamsList(io.confluent.ksql.rest.entity.StreamsList) QueryId(io.confluent.ksql.query.QueryId) KsqlTopicInfo(io.confluent.ksql.rest.entity.KsqlTopicInfo) ErrorMessageEntity(io.confluent.ksql.rest.entity.ErrorMessageEntity) PropertiesList(io.confluent.ksql.rest.entity.PropertiesList) TablesList(io.confluent.ksql.rest.entity.TablesList) FakeException(io.confluent.ksql.FakeException) KafkaTopicInfo(io.confluent.ksql.rest.entity.KafkaTopicInfo) TopicDescription(io.confluent.ksql.rest.entity.TopicDescription) KsqlTopicsList(io.confluent.ksql.rest.entity.KsqlTopicsList) SourceDescription(io.confluent.ksql.rest.entity.SourceDescription) Test(org.junit.Test)

Aggregations

FakeException (io.confluent.ksql.FakeException)2 Test (org.junit.Test)2 QueryId (io.confluent.ksql.query.QueryId)1 CommandStatusEntity (io.confluent.ksql.rest.entity.CommandStatusEntity)1 ErrorMessageEntity (io.confluent.ksql.rest.entity.ErrorMessageEntity)1 ExecutionPlan (io.confluent.ksql.rest.entity.ExecutionPlan)1 KafkaTopicInfo (io.confluent.ksql.rest.entity.KafkaTopicInfo)1 KafkaTopicsList (io.confluent.ksql.rest.entity.KafkaTopicsList)1 KsqlEntityList (io.confluent.ksql.rest.entity.KsqlEntityList)1 KsqlTopicInfo (io.confluent.ksql.rest.entity.KsqlTopicInfo)1 KsqlTopicsList (io.confluent.ksql.rest.entity.KsqlTopicsList)1 PropertiesList (io.confluent.ksql.rest.entity.PropertiesList)1 Queries (io.confluent.ksql.rest.entity.Queries)1 SourceDescription (io.confluent.ksql.rest.entity.SourceDescription)1 StreamedRow (io.confluent.ksql.rest.entity.StreamedRow)1 StreamsList (io.confluent.ksql.rest.entity.StreamsList)1 TablesList (io.confluent.ksql.rest.entity.TablesList)1 TopicDescription (io.confluent.ksql.rest.entity.TopicDescription)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1