Package org.hamcrest.core

Examples of org.hamcrest.core.IsInstanceOf


    public <T> Matcher<T> anything() {
        return new IsAnything<T>();
    }
   
    public Matcher<Object> a(Class<?> type) {
        return new IsInstanceOf(type);
    }
View Full Code Here


    public Matcher<Object> a(Class<?> type) {
        return new IsInstanceOf(type);
    }
   
    public Matcher<Object> an(Class<?> type) {
        return new IsInstanceOf(type);
    }
View Full Code Here

    Assert.assertTrue(result.containsKey("price"));
   
    Assert.assertEquals(8, result.size());
   
    final Object object = result.get("categories");
    Assert.assertThat(object, new IsInstanceOf(Set.class));
    final Set<?> categories = (Set<?>) object;
    // Must be a collection with more than 1 value
    // (there is also a describe that always returns a collection with only the first original entry).
    Assert.assertEquals(2, categories.size());
  }
View Full Code Here

        is(equalTo(2)));
  }

  @Test
  public void validPropertiesObjectReturnIfBothFilesAreNull() {
    IsInstanceOf anInstanceOfPropertiesClass = new IsInstanceOf(Properties.class);
    Properties propertiesFile = null;
    Properties customProperties = null;

    Properties modifiedProperties = new PropertyFileMerger().mergePropertiesFiles(propertiesFile, customProperties);
    assertThat(modifiedProperties,
View Full Code Here

     * @deprecated
     *  use {@link #aNonNull} or {@link #any} until type inference actually works in a future version of Java
     */
    @Deprecated
    public static Matcher<Object> a(Class<?> type) {
        return new IsInstanceOf(type);
    }
View Full Code Here

     * @deprecated
     *  use {@link #aNonNull} or {@link #any} until type inference actually works in a future version of Java
     */
    @Deprecated
    public static Matcher<Object> an(Class<?> type) {
        return new IsInstanceOf(type);
    }
View Full Code Here

    public void testDecodeStrings() throws Exception {
        Object bin = Bert.decode(new byte[]{ -125, 109, 0, 0, 0, 5, 104, 101,
                108, 108, 111});
        Assert.assertThat("recognises binary",
                bin,
                new IsInstanceOf(byte[].class));
        Assert.assertArrayEquals("decodes binary",
                new byte[]{104, 101, 108, 108, 111},
                (byte[]) bin);

        Assert.assertEquals("decodes strings",
View Full Code Here

    public static <T> Matcher<T> anything() {
        return new IsAnything<T>();
    }
   
    public static Matcher<Object> a(Class<?> type) {
        return new IsInstanceOf(type);
    }
View Full Code Here

    public static Matcher<Object> a(Class<?> type) {
        return new IsInstanceOf(type);
    }
   
    public static Matcher<Object> an(Class<?> type) {
        return new IsInstanceOf(type);
    }
View Full Code Here

TOP

Related Classes of org.hamcrest.core.IsInstanceOf

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.