30 lines
813 B
Java
30 lines
813 B
Java
package eu.mikroskeem.utils.test.paste;
|
|
|
|
import eu.mikroskeem.utils.paste.Paste;
|
|
import org.junit.Assert;
|
|
import org.junit.Test;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class PasteTest {
|
|
@Test
|
|
public void testExceptionPaste(){
|
|
Paste paste = new Paste();
|
|
try {
|
|
throw new RuntimeException("Fake exception");
|
|
} catch (RuntimeException e){
|
|
String url;
|
|
try {
|
|
url = paste.pasteException(e);
|
|
} catch (IOException ioex){
|
|
/* Test paste server down? */
|
|
Assert.fail("Paste server seems to be down, unable to test");
|
|
return;
|
|
}
|
|
Assert.assertNotNull(url);
|
|
System.out.println("Example paste:");
|
|
System.out.println(url);
|
|
}
|
|
}
|
|
}
|