All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.junit.internal.matchers.SubstringMatcher Maven / Gradle / Ivy

Go to download

JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java.

There is a newer version: 4.11
Show newest version
package org.junit.internal.matchers;

import org.hamcrest.Description;

public abstract class SubstringMatcher extends TypeSafeMatcher {

    protected final String substring;

    protected SubstringMatcher(final String substring) {
        this.substring = substring;
    }

    @Override
	public boolean matchesSafely(String item) {
        return evalSubstringOf(item);
    }

    public void describeTo(Description description) {
        description.appendText("a string ")
                .appendText(relationship())
                .appendText(" ")
                .appendValue(substring);
    }

    protected abstract boolean evalSubstringOf(String string);

    protected abstract String relationship();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy