Search in sources :

Example 1 with SolrSearchSink

use of io.cdap.plugin.batch.SolrSearchSink in project hydrator-plugins by cdapio.

the class SolrSearchSinkTest method testWrongKeyFieldName.

@Test(expected = IllegalArgumentException.class)
public void testWrongKeyFieldName() {
    SolrSearchSink.BatchSolrSearchConfig config = new SolrSearchSink.BatchSolrSearchConfig("SolrSink", SolrSearchSinkConfig.SINGLE_NODE_MODE, "localhost:8983", "collection1", "wrong_id", "office address:address", "1000");
    SolrSearchSink sinkObject = new SolrSearchSink(config);
    MockPipelineConfigurer configurer = new MockPipelineConfigurer(inputSchema);
    sinkObject.configurePipeline(configurer);
}
Also used : MockPipelineConfigurer(io.cdap.cdap.etl.mock.common.MockPipelineConfigurer) SolrSearchSink(io.cdap.plugin.batch.SolrSearchSink) Test(org.junit.Test)

Example 2 with SolrSearchSink

use of io.cdap.plugin.batch.SolrSearchSink in project hydrator-plugins by cdapio.

the class SolrSearchSinkTest method testInvalidInputDataType.

@Test(expected = IllegalArgumentException.class)
public void testInvalidInputDataType() {
    Schema inputSchema = Schema.recordOf("input-record", Schema.Field.of("id", Schema.of(Schema.Type.STRING)), Schema.Field.of("firstname", Schema.of(Schema.Type.STRING)), Schema.Field.of("lastname", Schema.of(Schema.Type.STRING)), Schema.Field.of("office address", Schema.of(Schema.Type.STRING)), Schema.Field.of("pincode", Schema.nullableOf(Schema.of(Schema.Type.BYTES))));
    SolrSearchSink.BatchSolrSearchConfig config = new SolrSearchSink.BatchSolrSearchConfig("SolrSink", SolrSearchSinkConfig.SINGLE_NODE_MODE, "localhost:8983", "collection1", "id", "office address:address", "1000");
    SolrSearchSink sinkObject = new SolrSearchSink(config);
    MockPipelineConfigurer configurer = new MockPipelineConfigurer(inputSchema);
    sinkObject.configurePipeline(configurer);
}
Also used : MockPipelineConfigurer(io.cdap.cdap.etl.mock.common.MockPipelineConfigurer) Schema(io.cdap.cdap.api.data.schema.Schema) SolrSearchSink(io.cdap.plugin.batch.SolrSearchSink) Test(org.junit.Test)

Example 3 with SolrSearchSink

use of io.cdap.plugin.batch.SolrSearchSink in project hydrator-plugins by cdapio.

the class SolrSearchSinkTest method testInvalidSingleNodeSolrUrl.

@Test(expected = IllegalArgumentException.class)
public void testInvalidSingleNodeSolrUrl() {
    SolrSearchSink.BatchSolrSearchConfig config = new SolrSearchSink.BatchSolrSearchConfig("SolrSink", SolrSearchSinkConfig.SINGLE_NODE_MODE, "localhost:8983,localhost:8984", "collection1", "id", "office address:address", "1000");
    SolrSearchSink sinkObject = new SolrSearchSink(config);
    MockPipelineConfigurer configurer = new MockPipelineConfigurer(inputSchema);
    sinkObject.configurePipeline(configurer);
}
Also used : MockPipelineConfigurer(io.cdap.cdap.etl.mock.common.MockPipelineConfigurer) SolrSearchSink(io.cdap.plugin.batch.SolrSearchSink) Test(org.junit.Test)

Aggregations

MockPipelineConfigurer (io.cdap.cdap.etl.mock.common.MockPipelineConfigurer)3 SolrSearchSink (io.cdap.plugin.batch.SolrSearchSink)3 Test (org.junit.Test)3 Schema (io.cdap.cdap.api.data.schema.Schema)1