use of org.junit.runner.notification.Failure in project ceylon-compiler by ceylon.
the class CeylonTestGroup method runChild.
@Override
protected void runChild(Runner method, RunNotifier notifier) {
Description description = describeChild(method);
notifier.fireTestStarted(description);
Failure failure = null;
try {
method.run(notifier);
} finally {
if (failure != null) {
notifier.fireTestFailure(failure);
}
}
notifier.fireTestFinished(description);
}
use of org.junit.runner.notification.Failure in project ceylon-compiler by ceylon.
the class CeylonTestRunner method runChild.
@Override
protected void runChild(Method method, RunNotifier notifier) {
Description description = describeChild(method);
notifier.fireTestStarted(description);
Failure failure = null;
try {
failure = executeTest(method, description);
} finally {
if (failure != null) {
notifier.fireTestFailure(failure);
}
}
notifier.fireTestFinished(description);
}
use of org.junit.runner.notification.Failure in project ddf by codice.
the class BinaryContentImplTest method testBinaryContentImplNegativeSize.
@Test
public void testBinaryContentImplNegativeSize() {
InputStream is;
try {
is = new FileInputStream(content);
BinaryContentImpl bci = new BinaryContentImpl(is, mimeType);
bci.setSize(-20L);
assertEquals(BinaryContentImpl.UNKNOWN_SIZE, bci.getSize());
} catch (IOException e) {
LOGGER.error(IO_FAILURE, e);
new Failure(null, e);
}
}
use of org.junit.runner.notification.Failure in project ddf by codice.
the class BinaryContentImplTest method testBinaryContentImplByteArrayX2NotNull.
@Test
public void testBinaryContentImplByteArrayX2NotNull() {
InputStream is;
try {
is = new FileInputStream(content);
BinaryContentImpl bci = new BinaryContentImpl(is, mimeType);
assertNotNull(bci.getByteArray());
assertNotNull(bci.getByteArray());
} catch (IOException e) {
LOGGER.error(IO_FAILURE, e);
new Failure(null, e);
}
}
use of org.junit.runner.notification.Failure in project ddf by codice.
the class BinaryContentImplTest method setUp.
@Before
public void setUp() {
content = new File("src/test/resources/data/i4ce.png");
MimetypesFileTypeMap mimeMapper = new MimetypesFileTypeMap();
try {
mimeType = new MimeType(mimeMapper.getContentType(content));
} catch (MimeTypeParseException e) {
LOGGER.error("Mime parser Failure", e);
new Failure(null, e);
}
}
Aggregations