CVS: junit/src/org/junit/experimental/test/assertion AssumptionViolatedExceptionTest.java, NONE, 1.1

David Saff <[email protected]> Thu, 12 Jul 2007 10:08:27 -0700
Newsgroups gmane.comp.java.junit.devel
Message-ID <[email protected]>
Update of /cvsroot/junit/junit/src/org/junit/experimental/test/assertion
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26134/src/org/junit/experimental/test/assertion

Added Files:
	AssumptionViolatedExceptionTest.java 
Log Message:
Re-organize theory packages

--- NEW FILE: AssumptionViolatedExceptionTest.java ---
package org.junit.experimental.test.assertion;

import static org.junit.matchers.StringContains.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.hamcrest.Matcher;
import org.hamcrest.StringDescription;
import org.junit.Test;
import org.junit.Assume.AssumptionViolatedException;
import org.junit.experimental.theories.methods.api.Theory;
import org.junit.experimental.theories.runner.api.Theories;
import org.junit.runner.RunWith;

@RunWith(Theories.class)
public class AssumptionViolatedExceptionTest {
	public static Object TWO= 2;

	public static Matcher<?> IS_THREE= is(3);

	@Theory
	public void toStringIsUseful(Object actual, Matcher<?> matcher) {
		assertThat(new AssumptionViolatedException(actual, matcher).toString(),
				containsString(matcher.toString()));
	}

	@Test
	public void AssumptionViolatedExceptionDescribesItself() {
		AssumptionViolatedException e= new AssumptionViolatedException(3, is(2));
		assertThat(StringDescription.asString(e), is("got: <3>, expected: is <2>"));
	}
}


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/