edvin
11/29/2017, 8:35 PMkastork
11/29/2017, 8:41 PMkastork
11/29/2017, 8:42 PMkastork
11/29/2017, 8:51 PMmvn install
generates the failureedvin
11/29/2017, 8:52 PM/src/main/test/resources/META-INF/services/tornadofx.ChildInterceptor
and rerun? Does it say 2 or 0 interceptors then?kastork
11/29/2017, 8:53 PMaddChildInterceptor
(this is before removing the META-INF file)kastork
11/29/2017, 8:56 PMkastork
11/29/2017, 8:57 PMmvn test
generates two failures: "Expected 0, but was 1" and "Expected 0 but was 1" (but remember the nature of the test arguments is backwards. It means to say Expected 2 but was 0.kastork
11/29/2017, 8:58 PMonlyOneInterceptorShouldWork(tornadofx.tests.ChildInterceptorTest) Time elapsed: 0.004 sec <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<1>
at org.junit.Assert.fail(Assert.java:88)
kastork
11/29/2017, 8:58 PMkastork
11/29/2017, 8:58 PMinterceptorsLoaded(tornadofx.tests.ChildInterceptorTest) Time elapsed: 0 sec <<< FAILURE!
java.lang.AssertionError: expected:<0> but was:<2>
at org.junit.Assert.fail(Assert.java:88)
edvin
11/29/2017, 8:59 PMkastork
11/29/2017, 8:59 PMkastork
11/29/2017, 9:01 PMedvin
11/29/2017, 9:01 PMuser
11/29/2017, 9:02 PMedvin
11/29/2017, 9:02 PMedvin
11/29/2017, 9:02 PMkastork
11/29/2017, 9:03 PMkastork
11/29/2017, 9:03 PMkastork
11/29/2017, 9:08 PMaddChildInterceptor
I get the call twice with the same stack trace and the tests pass. The call comes from App#init
line 72 to App#importChildInterceptors()
line 77 to FX.addChildInterceptors
edvin
11/29/2017, 9:12 PMChildInterceptor
service even when the file is not present??edvin
11/29/2017, 9:13 PMkastork
11/29/2017, 9:16 PMedvin
11/29/2017, 9:32 PMkastork
11/29/2017, 9:33 PMkastork
11/29/2017, 9:34 PMfun addChildInterceptor(interceptor: ChildInterceptor) {
try {
childInterceptors.add(interceptor)
throw Exception()
} catch (ex: Exception) {
println(ex.stackTrace)
}
}
??edvin
11/29/2017, 9:39 PMThread.currentThread().getStackTrace()
as well 🙂