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

The following examples show how to use org.hamcrest.Matchers#is() . These examples are extracted from open source projects. 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
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 Project: beam   File: LogRecordMatcher.java    License: Apache License 2.0 4 votes vote down vote up
private LogRecordMatcher(Level level, String substring) {
  this(Matchers.is(level), substring);
}
 
Example 3
@Override
public Matcher<NullValue> testDataMatcher() {
	return Matchers.is(NullValue.getInstance());
}
 
Example 4
@Override
public Matcher<BigDecimal> testDataMatcher() {
	return Matchers.is(new BigDecimal("123456789012345678901234567890123456.789"));
}
 
Example 5
@Override
public Matcher<BigInteger> testDataMatcher() {
	return Matchers.is(new BigInteger("123456789012345678901234567890123456"));
}
 
Example 6
@Override
public Matcher<Boolean> testDataMatcher() {
	return Matchers.is(Boolean.TRUE);
}
 
Example 7
@Override
public Matcher<Short> testDataMatcher() {
	return Matchers.is((short) 123);
}
 
Example 8
@Override
public Matcher<Time> testDataMatcher() {
	return Matchers.is(new Time(1580382960L));
}
 
Example 9
@Override
public Matcher<ByteValue> testDataMatcher() {
	return Matchers.is(new ByteValue((byte) 42));
}
 
Example 10
@Override
public Matcher<Character> testDataMatcher() {
	return Matchers.is(Character.MAX_VALUE);
}
 
Example 11
@Override
public Matcher<ShortValue> testDataMatcher() {
	return Matchers.is(new ShortValue((short) 123));
}
 
Example 12
@Override
public Matcher<Date> testDataMatcher() {
	return Matchers.is(new Date(1580382960L));
}
 
Example 13
@Override
public Matcher<Double> testDataMatcher() {
	return Matchers.is(new Double("12345.6789"));
}
 
Example 14
@Override
public Matcher<DoubleValue> testDataMatcher() {
	return Matchers.is(new DoubleValue(12345.6789));
}
 
Example 15
@Override
public Matcher<Float> testDataMatcher() {
	return Matchers.is(new Float("123.456"));
}
 
Example 16
@Override
public Matcher<FloatValue> testDataMatcher() {
	return Matchers.is(new FloatValue(123.456f));
}
 
Example 17
@Override
public Matcher<Integer> testDataMatcher() {
	return Matchers.is(123456);
}
 
Example 18
@Override
public Matcher<IntValue> testDataMatcher() {
	return Matchers.is(new IntValue(123456));
}
 
Example 19
@Override
public Matcher<Long> testDataMatcher() {
	return Matchers.is(1234567890L);
}
 
Example 20
@Override
public Matcher<LongValue> testDataMatcher() {
	return Matchers.is(new LongValue(1234567890));
}