Java Code Examples for org.hamcrest.Matchers#is()

The following examples show how to use org.hamcrest.Matchers#is() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PipelineOptionsReflectorTest.java    From beam with Apache License 2.0 5 votes vote down vote up
private static Matcher<PipelineOptionSpec> hasClass(Class<?> clazz) {
  return new FeatureMatcher<PipelineOptionSpec, Class<?>>(
      Matchers.<Class<?>>is(clazz), "defining class", "class") {
    @Override
    protected Class<?> featureValueOf(PipelineOptionSpec actual) {
      return actual.getDefiningInterface();
    }
  };
}
 
Example 2
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<ShortValue> testDataMatcher() {
	return Matchers.is(new ShortValue((short) 123));
}
 
Example 3
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<LongValue> testDataMatcher() {
	return Matchers.is(new LongValue(1234567890));
}
 
Example 4
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Long> testDataMatcher() {
	return Matchers.is(1234567890L);
}
 
Example 5
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<IntValue> testDataMatcher() {
	return Matchers.is(new IntValue(123456));
}
 
Example 6
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Integer> testDataMatcher() {
	return Matchers.is(123456);
}
 
Example 7
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<FloatValue> testDataMatcher() {
	return Matchers.is(new FloatValue(123.456f));
}
 
Example 8
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Float> testDataMatcher() {
	return Matchers.is(new Float("123.456"));
}
 
Example 9
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<DoubleValue> testDataMatcher() {
	return Matchers.is(new DoubleValue(12345.6789));
}
 
Example 10
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Double> testDataMatcher() {
	return Matchers.is(new Double("12345.6789"));
}
 
Example 11
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Date> testDataMatcher() {
	return Matchers.is(new Date(1580382960L));
}
 
Example 12
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Character> testDataMatcher() {
	return Matchers.is(Character.MAX_VALUE);
}
 
Example 13
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<ByteValue> testDataMatcher() {
	return Matchers.is(new ByteValue((byte) 42));
}
 
Example 14
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Time> testDataMatcher() {
	return Matchers.is(new Time(1580382960L));
}
 
Example 15
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Short> testDataMatcher() {
	return Matchers.is((short) 123);
}
 
Example 16
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<Boolean> testDataMatcher() {
	return Matchers.is(Boolean.TRUE);
}
 
Example 17
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<BigInteger> testDataMatcher() {
	return Matchers.is(new BigInteger("123456789012345678901234567890123456"));
}
 
Example 18
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<BigDecimal> testDataMatcher() {
	return Matchers.is(new BigDecimal("123456789012345678901234567890123456.789"));
}
 
Example 19
Source File: BasicTypeSerializerUpgradeTestSpecifications.java    From flink with Apache License 2.0 4 votes vote down vote up
@Override
public Matcher<NullValue> testDataMatcher() {
	return Matchers.is(NullValue.getInstance());
}
 
Example 20
Source File: LogRecordMatcher.java    From beam with Apache License 2.0 4 votes vote down vote up
private LogRecordMatcher(Level level, String substring) {
  this(Matchers.is(level), substring);
}