From ad81d26d5ad2f76354bd0c7d5d21104131d5795b Mon Sep 17 00:00:00 2001 From: heck Date: Sun, 7 Jun 2020 18:16:12 +0200 Subject: [PATCH] FsMQManager test identities updated --- .../fsmqmanager/test/identities/TestMain.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/test/identities/TestMain.java b/test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/test/identities/TestMain.java index a2f1146..47c7e61 100644 --- a/test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/test/identities/TestMain.java +++ b/test/java/foundation/pEp/jniadapter/test/utils/transport/fsmqmanager/test/identities/TestMain.java @@ -38,10 +38,10 @@ class FsMQManagerIdentitiesTestContext extends AbstractTestContext { class TestMain { public static void main(String[] args) throws Exception { -// TestSuite.getDefault().setVerbose(true); + TestSuite.getDefault().setVerbose(false); FsMQManagerIdentitiesTestContext testCtx = new FsMQManagerIdentitiesTestContext(); - new TestUnit("Create own ident: " + testCtx.ownAddress, testCtx, ctx -> { + new TestUnit("Constructor, own ident: " + testCtx.ownAddress, testCtx, ctx -> { ctx.self = new FsMQIdentity(ctx.ownAddress, ctx.ownQDir); assert ctx.self != null : "null"; assert ctx.self.getAddress().equals(ctx.ownAddress) : "Address mismatch"; @@ -53,7 +53,7 @@ class TestMain { assert ctx.qm != null : "null"; }); - new TestUnit("getIdentities", testCtx, ctx -> { + new TestUnit("getAll", testCtx, ctx -> { List idents = ctx.qm.identities.getAll(); for (FsMQIdentity i : idents) { log(i.toString()); @@ -93,7 +93,7 @@ class TestMain { }); - new TestUnit("getIdentities", testCtx, ctx -> { + new TestUnit("getAll", testCtx, ctx -> { List idents = ctx.qm.identities.getAll(); for (FsMQIdentity i : idents) { log(i.toString()); @@ -101,7 +101,7 @@ class TestMain { assert idents.size() == 3 : "identity count wrong"; }); - new TestUnit("getIdents is copy", testCtx, ctx -> { + new TestUnit("getAll is copy", testCtx, ctx -> { List idents = ctx.qm.identities.getAll(); int identSize = idents.size(); idents.add(new FsMQIdentity("Eve", "EvilEveDir")); @@ -124,7 +124,7 @@ class TestMain { assert !ctx.qm.identities.update(ctx.self) : "upadted own ident"; }); - new TestUnit("getIdentities", testCtx, ctx -> { + new TestUnit("getAll", testCtx, ctx -> { List idents = ctx.qm.identities.getAll(); for (FsMQIdentity i : idents) { log(i.toString()); @@ -132,11 +132,11 @@ class TestMain { assert idents.size() == 3 : "identity count wrong"; }); - new TestUnit("removeAllIdents", testCtx, ctx -> { + new TestUnit("removeAll", testCtx, ctx -> { ctx.qm.identities.removeAll(); }); - new TestUnit("getIdentities", testCtx, ctx -> { + new TestUnit("getAll", testCtx, ctx -> { List idents = ctx.qm.identities.getAll(); for (FsMQIdentity i : idents) { log(i.toString()); @@ -144,7 +144,7 @@ class TestMain { assert idents.size() == 1 : "identity count wrong"; }); - new TestUnit("addIdentities", testCtx, ctx -> { + new TestUnit("addAll", testCtx, ctx -> { ctx.identList = new ArrayList<>(); ctx.identList.add(ctx.self); ctx.identList.add(ctx.bob); @@ -152,7 +152,7 @@ class TestMain { assert ctx.qm.identities.addAll(ctx.identList) == 2 : "indents added count wrong"; }); - new TestUnit("getIdentities", testCtx, ctx -> { + new TestUnit("getAll", testCtx, ctx -> { List idents = ctx.qm.identities.getAll(); for (FsMQIdentity i : idents) { log(i.toString()); @@ -173,7 +173,7 @@ class TestMain { } }); - new TestUnit("removeIdent" + testCtx.carolAddress, testCtx, ctx -> { + new TestUnit("remove: " + testCtx.carolAddress, testCtx, ctx -> { ctx.qm.identities.remove(ctx.carol.getAddress()); assert ctx.qm.identities.getAll().size() == 2 : "identity count wrong"; assert !ctx.qm.identities.exists(ctx.carol.getAddress()) : "Remove failed"; @@ -188,24 +188,24 @@ class TestMain { }); new TestUnit("cant remove own ident", testCtx, ctx -> { - ctx.qm.identities.remove(ctx.self.getAddress()); + assert !ctx.qm.identities.remove(ctx.self.getAddress()):"nothing should have been removed"; assert ctx.qm.identities.getAll().size() == 2 : "identity count wrong"; assert ctx.qm.identities.exists(ctx.self.getAddress()) : "removed own identity"; }); - new TestUnit("getIdentForAddr" + testCtx.bobAddress, testCtx, ctx -> { + new TestUnit("getByAddress: " + testCtx.bobAddress, testCtx, ctx -> { FsMQIdentity found = ctx.qm.identities.getByAddress(ctx.bob.getAddress()); assert found != null :"failed to find known address"; assert found.getAddress().equals(ctx.bob.getAddress()) :"found wrong ident"; }); - new TestUnit("getIdentForAdd" + testCtx.ownAddress, testCtx, ctx -> { + new TestUnit("getByAddress: " + testCtx.ownAddress, testCtx, ctx -> { FsMQIdentity found = ctx.qm.identities.getByAddress(ctx.self.getAddress()); assert found != null :"failed to find known address"; assert found.getAddress().equals(ctx.self.getAddress()) :"found wrong ident"; }); - new TestUnit("getIdentityForAddress not existing", testCtx, ctx -> { + new TestUnit("getByAddress not existing", testCtx, ctx -> { assert ctx.qm.identities.getByAddress("UNKNOWN") == null : "Found an unknown address"; });