Search in sources :

Example 96 with SinkConfig

use of org.apache.pulsar.common.io.SinkConfig in project incubator-pulsar by apache.

the class TestCmdSinks method testCmdSinkConfigFileCorrect.

@Test
public void testCmdSinkConfigFileCorrect() throws Exception {
    SinkConfig sinkConfig = getSinkConfig();
    testCmdSinkConfigFile(sinkConfig, sinkConfig);
}
Also used : SinkConfig(org.apache.pulsar.common.io.SinkConfig) Test(org.testng.annotations.Test)

Example 97 with SinkConfig

use of org.apache.pulsar.common.io.SinkConfig in project incubator-pulsar by apache.

the class TestCmdSinks method testMissingConfig.

@Test
public void testMissingConfig() throws Exception {
    SinkConfig sinkConfig = getSinkConfig();
    sinkConfig.setConfigs(null);
    testCmdSinkCliMissingArgs(TENANT, NAMESPACE, NAME, INPUTS, TOPIC_PATTERN, CUSTOM_SERDE_INPUT_STRING, PROCESSING_GUARANTEES, PARALLELISM, JAR_FILE_PATH, CPU, RAM, DISK, null, sinkConfig);
}
Also used : SinkConfig(org.apache.pulsar.common.io.SinkConfig) Test(org.testng.annotations.Test)

Example 98 with SinkConfig

use of org.apache.pulsar.common.io.SinkConfig in project incubator-pulsar by apache.

the class TestCmdSinks method testMissingProcessingGuarantees.

@Test
public void testMissingProcessingGuarantees() throws Exception {
    SinkConfig sinkConfig = getSinkConfig();
    sinkConfig.setProcessingGuarantees(null);
    testCmdSinkCliMissingArgs(TENANT, NAMESPACE, NAME, INPUTS, TOPIC_PATTERN, CUSTOM_SERDE_INPUT_STRING, null, PARALLELISM, JAR_FILE_PATH, CPU, RAM, DISK, SINK_CONFIG_STRING, sinkConfig);
}
Also used : SinkConfig(org.apache.pulsar.common.io.SinkConfig) Test(org.testng.annotations.Test)

Example 99 with SinkConfig

use of org.apache.pulsar.common.io.SinkConfig in project incubator-pulsar by apache.

the class TestCmdSinks method testCmdSinkConfigFileMissingProcessingGuarantees.

@Test
public void testCmdSinkConfigFileMissingProcessingGuarantees() throws Exception {
    SinkConfig testSinkConfig = getSinkConfig();
    testSinkConfig.setProcessingGuarantees(null);
    SinkConfig expectedSinkConfig = getSinkConfig();
    expectedSinkConfig.setProcessingGuarantees(null);
    testCmdSinkConfigFile(testSinkConfig, expectedSinkConfig);
}
Also used : SinkConfig(org.apache.pulsar.common.io.SinkConfig) Test(org.testng.annotations.Test)

Example 100 with SinkConfig

use of org.apache.pulsar.common.io.SinkConfig in project incubator-pulsar by apache.

the class TestCmdSinks method testParseConfigs.

@Test
public void testParseConfigs() throws Exception {
    SinkConfig testSinkConfig = getSinkConfig();
    Map<String, Object> config = testSinkConfig.getConfigs();
    Assert.assertEquals(config.get("int"), 1000);
    Assert.assertEquals(config.get("int_string"), "1000");
    Assert.assertEquals(config.get("float"), 1000.0);
    Assert.assertEquals(config.get("float_string"), "1000.0");
    Assert.assertEquals(config.get("created_at"), "Mon Jul 02 00:33:15 +0000 2018");
}
Also used : SinkConfig(org.apache.pulsar.common.io.SinkConfig) Test(org.testng.annotations.Test)

Aggregations

SinkConfig (org.apache.pulsar.common.io.SinkConfig)223 Test (org.testng.annotations.Test)165 Gson (com.google.gson.Gson)42 HashMap (java.util.HashMap)33 Function (org.apache.pulsar.functions.proto.Function)27 File (java.io.File)24 ConsumerConfig (org.apache.pulsar.common.functions.ConsumerConfig)24 IdentityFunction (org.apache.pulsar.functions.api.utils.IdentityFunction)24 NarClassLoader (org.apache.pulsar.common.nar.NarClassLoader)21 PulsarAdminException (org.apache.pulsar.client.admin.PulsarAdminException)19 IOException (java.io.IOException)18 Resources (org.apache.pulsar.common.functions.Resources)15 FileInputStream (java.io.FileInputStream)12 WebTarget (javax.ws.rs.client.WebTarget)12 ObjectMapperFactory (org.apache.pulsar.common.util.ObjectMapperFactory)12 TopicStats (org.apache.pulsar.common.policies.data.TopicStats)10 List (java.util.List)9 Map (java.util.Map)9 CompletableFuture (java.util.concurrent.CompletableFuture)9 Cleanup (lombok.Cleanup)9