use of org.apache.samza.config.StreamConfig in project samza by apache.
the class TestStreamUtil method testGetStreamStreamIdNull.
// Null is not allowed for streamId.
@Test(expected = IllegalArgumentException.class)
public void testGetStreamStreamIdNull() {
Config config = buildStreamConfig(null, StreamConfig.SYSTEM, TEST_SYSTEM);
StreamUtil.getStreamSpec(null, new StreamConfig(config));
}
use of org.apache.samza.config.StreamConfig in project samza by apache.
the class TestStreamUtil method testGetStreamWithSystemAtStreamScopeInConfig.
// If the system is specified at the stream scope, use it
@Test
public void testGetStreamWithSystemAtStreamScopeInConfig() {
Config config = buildStreamConfig(STREAM_ID, StreamConfig.PHYSICAL_NAME, TEST_PHYSICAL_NAME, StreamConfig.SYSTEM, TEST_SYSTEM);
StreamSpec spec = StreamUtil.getStreamSpec(STREAM_ID, new StreamConfig(config));
assertEquals(TEST_SYSTEM, spec.getSystemName());
}
use of org.apache.samza.config.StreamConfig in project samza by apache.
the class TestStreamUtil method testGetStreamWithoutPhysicalNameInConfig.
// The streamId should be used as the physicalName when the physical name is not specified.
// NOTE: its either this, set to null, or exception. This seems better for backward compatibility and API brevity.
@Test
public void testGetStreamWithoutPhysicalNameInConfig() {
Config config = buildStreamConfig(STREAM_ID, StreamConfig.SYSTEM, TEST_SYSTEM);
StreamSpec spec = StreamUtil.getStreamSpec(STREAM_ID, new StreamConfig(config));
assertEquals(STREAM_ID, spec.getPhysicalName());
}
use of org.apache.samza.config.StreamConfig in project samza by apache.
the class TestStreamUtil method testGetStreamSystemNameArgNull.
// Null is not allowed IllegalArgumentException system name.
@Test(expected = IllegalArgumentException.class)
public void testGetStreamSystemNameArgNull() {
Config config = buildStreamConfig(STREAM_ID, StreamConfig.PHYSICAL_NAME, TEST_PHYSICAL_NAME, StreamConfig.SYSTEM, null);
StreamUtil.getStreamSpec(STREAM_ID, new StreamConfig(config));
}
use of org.apache.samza.config.StreamConfig in project samza by apache.
the class TestStreamUtil method testGetStreamPhysicalNameArgSimple.
// When the physicalName argument is passed explicitly it should be used, regardless of whether it is also in the config
@Test
public void testGetStreamPhysicalNameArgSimple() {
Config config = buildStreamConfig(STREAM_ID, // This should be ignored because of the explicit arg
StreamConfig.PHYSICAL_NAME, // This should be ignored because of the explicit arg
TEST_PHYSICAL_NAME2, StreamConfig.SYSTEM, TEST_SYSTEM);
StreamSpec spec = StreamUtil.getStreamSpec(STREAM_ID, new StreamConfig(config));
assertEquals(STREAM_ID, spec.getId());
assertEquals(TEST_PHYSICAL_NAME2, spec.getPhysicalName());
assertEquals(TEST_SYSTEM, spec.getSystemName());
}
Aggregations