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(-1, 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 testBinaryContentImplByteArrayNotNull.
@Test
public void testBinaryContentImplByteArrayNotNull() {
InputStream is;
try {
is = new FileInputStream(content);
BinaryContentImpl bci = new BinaryContentImpl(is, mimeType);
byte[] contents = bci.getByteArray();
assertNotNull(contents);
} 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 ResourceImplTest method testResourceImplNegativeSize.
@Test
public void testResourceImplNegativeSize() {
InputStream is;
try {
is = new FileInputStream(content);
ResourceImpl ri = new ResourceImpl(is, mimeType, TEST_NAME);
ri.setSize(-20L);
assertEquals(-1, ri.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 ResourceImplTest 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);
}
}
use of org.junit.runner.notification.Failure in project bitsquare by bitsquare.
the class StressTestMailboxMessage method main.
// # MAIN ENTRY POINT
// Inspired by <https://stackoverflow.com/a/9288513> by Marc Peters.
public static void main(String[] args) {
Request request = (args.length == 0) ? Request.aClass(NetworkStressTest.class) : Request.method(NetworkStressTest.class, args[0]);
Result result = new JUnitCore().run(request);
for (Failure f : result.getFailures()) System.err.printf("\n%s\n%s", f, f.getTrace());
System.exit(result.wasSuccessful() ? 0 : 1);
}
Aggregations