Package org.hamcrest

Examples of org.hamcrest.BaseMatcher


    }
   
    @Test
    public void shouldUseMatchersSafely() {
        //given
        List<Matcher> matchers = (List) Arrays.asList(new BaseMatcher() {
            public boolean matches(Object item) {
                throw new ClassCastException("nasty matcher");
            }

            public void describeTo(Description description) {
View Full Code Here


    // Shouldn't throw
    new OperaSettings().merge(caps);
  }

  private Matcher matchesProfile(final OperaProfile expected) {
    return new BaseMatcher() {
      public boolean matches(Object o) {
        OperaProfile actual = (OperaProfile) o;

        try {
          if ((expected.toJson().toString().equals(actual.toJson().toString())) &&
View Full Code Here

public final class Classes {

    @SuppressWarnings("unchecked")
    public static Matcher isSubclassOf(final Class superClass) {
        return new BaseMatcher() {
            @Override
            public boolean matches(final Object item) {
                final Class cls = (Class) item;
                return superClass.isAssignableFrom(cls);
            }
View Full Code Here

        ctx.init( project, getDefaultDotnetCompilerConfig() );

        Set<Artifact> libraries = ctx.getLibraryDependenciesFor( ArtifactScope.COMPILE );
        assertThat( libraries.size(), equalTo( 1 ) );
        assertThat( ( (Artifact) libraries.toArray()[0] ).getFile().getAbsolutePath(),
                    CoreMatchers.allOf( new BaseMatcher()
                    {
                        private String containsString = "assembly" + File.separator + "GAC_MSIL" + File.separator +
                            "artifactId" + File.separator + "1.0__dsfajkdsfajdfs" + File.separator + "artifactId.dll";

                        public boolean matches( Object object )
View Full Code Here

TOP

Related Classes of org.hamcrest.BaseMatcher

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.