use of org.hamcrest.core.IsInstanceOf in project druid by druid-io.
the class StupidPoolTest method testTake.
@Test
public void testTake() {
Assert.assertThat(resourceHolderObj, new IsInstanceOf(ResourceHolder.class));
Object expectedObject = resourceHolderObj.get();
Assert.assertEquals(expectedObject, defaultString);
}
use of org.hamcrest.core.IsInstanceOf in project kafka by apache.
the class GlobalProcessorContextImplTest method shouldReturnGlobalOrNullStore.
@Test
public void shouldReturnGlobalOrNullStore() {
assertThat(globalContext.getStateStore(GLOBAL_STORE_NAME), new IsInstanceOf(StateStore.class));
assertNull(globalContext.getStateStore(UNKNOWN_STORE));
}
use of org.hamcrest.core.IsInstanceOf in project beam by apache.
the class AvroByteReaderFactoryTest method testCreatePlainAvroByteReader.
@Test
public void testCreatePlainAvroByteReader() throws Exception {
Coder<?> coder = WindowedValue.getFullCoder(BigEndianIntegerCoder.of(), GlobalWindow.Coder.INSTANCE);
NativeReader<?> reader = runTestCreateAvroReader(pathToAvroFile, null, null, CloudObjects.asCloudObject(coder, /*sdkComponents=*/
null));
assertThat(reader, new IsInstanceOf(AvroByteReader.class));
AvroByteReader avroReader = (AvroByteReader) reader;
Assert.assertEquals(pathToAvroFile, avroReader.avroSource.getFileOrPatternSpec());
Assert.assertEquals(0L, avroReader.startPosition);
Assert.assertEquals(Long.MAX_VALUE, avroReader.endPosition);
Assert.assertEquals(coder, avroReader.coder);
}
use of org.hamcrest.core.IsInstanceOf in project beam by apache.
the class AvroByteReaderFactoryTest method testCreateRichAvroByteReader.
@Test
public void testCreateRichAvroByteReader() throws Exception {
Coder<?> coder = WindowedValue.getFullCoder(BigEndianIntegerCoder.of(), GlobalWindow.Coder.INSTANCE);
NativeReader<?> reader = runTestCreateAvroReader(pathToAvroFile, 200L, 500L, CloudObjects.asCloudObject(coder, /*sdkComponents=*/
null));
assertThat(reader, new IsInstanceOf(AvroByteReader.class));
AvroByteReader avroReader = (AvroByteReader) reader;
Assert.assertEquals(pathToAvroFile, avroReader.avroSource.getFileOrPatternSpec());
Assert.assertEquals(200L, avroReader.startPosition);
Assert.assertEquals(500L, avroReader.endPosition);
Assert.assertEquals(coder, avroReader.coder);
}
use of org.hamcrest.core.IsInstanceOf in project beam by apache.
the class SinkRegistryTest method testCreatePredefinedSink.
@Test
public void testCreatePredefinedSink() throws Exception {
CloudObject spec = CloudObject.forClassName("AvroSink");
addString(spec, "filename", "/path/to/file.txt");
SizeReportingSinkWrapper<?> sink = SinkRegistry.defaultRegistry().create(spec, StringUtf8Coder.of(), options, BatchModeExecutionContext.forTesting(options, "testStage"), TestOperationContext.create());
assertThat(sink.getUnderlyingSink(), new IsInstanceOf(AvroByteSink.class));
}
Aggregations