-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
85 changed files
with
375 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
es4x/src/test/java/io/reactiverse/es4x/test/JULFormatterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package io.reactiverse.es4x.test; | ||
|
||
import io.reactiverse.es4x.jul.ANSIFormatter; | ||
import io.vertx.ext.unit.Async; | ||
import io.vertx.ext.unit.TestContext; | ||
import io.vertx.ext.unit.junit.RunTestOnContext; | ||
import io.vertx.ext.unit.junit.VertxUnitRunner; | ||
import org.junit.AfterClass; | ||
import org.junit.BeforeClass; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import java.io.IOException; | ||
import java.io.PrintWriter; | ||
import java.io.StringWriter; | ||
import java.util.logging.Level; | ||
import java.util.logging.LogRecord; | ||
|
||
@RunWith(VertxUnitRunner.class) | ||
public class JULFormatterTest { | ||
|
||
@BeforeClass | ||
public static void before() { | ||
//System.setProperty("es4x.host.class.filter", "io.vertx.**,java.util.**,java.time.**,java.lang.**,java.net.**,io.reactiverse.es4x.**,!java.nio.file.FileAlreadyExistsException"); | ||
System.setProperty("es4x.host.class.filter", "!java.nio.file.FileAlreadyExistsException"); | ||
} | ||
|
||
@AfterClass | ||
public static void after() { | ||
System.getProperties().remove("es4x.host.class.filter"); | ||
} | ||
|
||
@Rule | ||
public RunTestOnContext rule = new RunTestOnContext(); | ||
|
||
@Test(timeout = 10000) | ||
public void shouldDeployVerticle(TestContext ctx) { | ||
final Async async = ctx.async(); | ||
rule.vertx().deployVerticle("js:./verticle3.js", deploy -> { | ||
ctx.assertFalse(deploy.succeeded()); | ||
ANSIFormatter formatter = new ANSIFormatter(); | ||
LogRecord item = new LogRecord(Level.ALL, "message"); | ||
item.setThrown(deploy.cause()); | ||
String out = formatter.format(item); | ||
System.out.println(out); | ||
|
||
try (StringWriter sw = new StringWriter()) { | ||
PrintWriter pw = new PrintWriter(sw); | ||
ANSIFormatter.printStackTrace(deploy.cause(), pw); | ||
System.out.println(sw); | ||
} catch (IOException e) { | ||
// ignore | ||
} | ||
async.complete(); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.