
4 changed files with 95 additions and 12 deletions
@ -0,0 +1,32 @@ |
|||
package foundation.pEp.jniadapter.test.templateAliceBob; |
|||
import static foundation.pEp.jniadapter.test.framework.TestLogger.*; |
|||
import foundation.pEp.jniadapter.test.framework.*; |
|||
import foundation.pEp.jniadapter.test.utils.*; |
|||
|
|||
class TestAlice { |
|||
public static void main(String[] args) throws Exception { |
|||
TestSuite.setVerbose(true); |
|||
TestSuite.setTestColor(TestUtils.TermColor.GREEN); |
|||
|
|||
new TestUnit<AdapterBaseTestContext>("Test Alice",new AdapterBaseTestContext() , ctx -> { |
|||
// do stuff using the context
|
|||
// Test FAILS on unhandled exception, otherwise SUCCESS
|
|||
|
|||
ctx.alice = ctx.engine.myself(ctx.alice); |
|||
|
|||
if(ctx.alice.fpr == null) { |
|||
throw new RuntimeException(); |
|||
} |
|||
|
|||
for(int i=0; i < 1000; i++ ) { |
|||
log("Alice is waiting..."); |
|||
TestUtils.sleep(1000); |
|||
} |
|||
|
|||
}).add(); |
|||
|
|||
TestSuite.run(); |
|||
} |
|||
} |
|||
|
|||
|
@ -0,0 +1,32 @@ |
|||
package foundation.pEp.jniadapter.test.templateAliceBob; |
|||
import static foundation.pEp.jniadapter.test.framework.TestLogger.*; |
|||
import foundation.pEp.jniadapter.test.framework.*; |
|||
import foundation.pEp.jniadapter.test.utils.*; |
|||
|
|||
class TestBob { |
|||
public static void main(String[] args) throws Exception { |
|||
TestSuite.setVerbose(true); |
|||
TestSuite.setTestColor(TestUtils.TermColor.YELLOW); |
|||
|
|||
new TestUnit<AdapterBaseTestContext>("Test Bob",new AdapterBaseTestContext() , ctx -> { |
|||
// do stuff using the context
|
|||
// Test FAILS on unhandled exception, otherwise SUCCESS
|
|||
|
|||
ctx.bob = ctx.engine.myself(ctx.bob); |
|||
|
|||
if(ctx.bob.fpr == null) { |
|||
throw new RuntimeException(); |
|||
} |
|||
|
|||
for(int i=0; i < 1000; i++ ) { |
|||
log("Bob is waiting..."); |
|||
TestUtils.sleep(1000); |
|||
} |
|||
|
|||
}).add(); |
|||
|
|||
TestSuite.run(); |
|||
} |
|||
} |
|||
|
|||
|
Loading…
Reference in new issue