diff options
6 files changed, 116 insertions, 32 deletions
diff --git a/trial/java/trial/org/direct_bt/TestDBTClientServer01_NoEnc.java b/trial/java/trial/org/direct_bt/TestDBTClientServer01_NoEnc.java new file mode 100644 index 00000000..87dda4fc --- /dev/null +++ b/trial/java/trial/org/direct_bt/TestDBTClientServer01_NoEnc.java @@ -0,0 +1,58 @@ +/** + * Author: Sven Gothel <[email protected]> + * Copyright (c) 2022 Gothel Software e.K. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package trial.org.direct_bt; + +import org.direct_bt.BTSecurityLevel; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +/** + * Testing a full Bluetooth server and client lifecycle of operations, requiring two BT adapter: + * - operating w/o encryption + * - start server advertising + * - start client discovery and connect to server when discovered + * - client/server processing of connection when ready + * - client disconnect + * - server stop advertising + * - security-level: NONE, ENC_ONLY freshly-paired and ENC_ONLY pre-paired + * - reuse server-adapter for client-mode discovery (just toggle on/off) + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class TestDBTClientServer01_NoEnc extends DBTClientServer1x { + static final boolean serverSC = true; + + @Test(timeout = 30000) + public final void test00_FullCycle_EncNone() { + final boolean serverShallHaveKeys = false; + final boolean clientShallHaveKeys = false; + test8x_fullCycle("00", true /* server_client_order */, serverSC, + BTSecurityLevel.NONE, serverShallHaveKeys, BTSecurityLevel.NONE, clientShallHaveKeys); + } + + public static void main(final String args[]) { + org.junit.runner.JUnitCore.main(TestDBTClientServer01_NoEnc.class.getName()); + } +} diff --git a/trial/java/trial/org/direct_bt/TestDBTClientServer02_NoEnc.java b/trial/java/trial/org/direct_bt/TestDBTClientServer02_NoEnc.java new file mode 100644 index 00000000..c0b36285 --- /dev/null +++ b/trial/java/trial/org/direct_bt/TestDBTClientServer02_NoEnc.java @@ -0,0 +1,58 @@ +/** + * Author: Sven Gothel <[email protected]> + * Copyright (c) 2022 Gothel Software e.K. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package trial.org.direct_bt; + +import org.direct_bt.BTSecurityLevel; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +/** + * Testing a full Bluetooth server and client lifecycle of operations, requiring two BT adapter: + * - operating w/o encryption + * - start server advertising + * - start client discovery and connect to server when discovered + * - client/server processing of connection when ready + * - client disconnect + * - server stop advertising + * - security-level: NONE, ENC_ONLY freshly-paired and ENC_ONLY pre-paired + * - reuse server-adapter for client-mode discovery (just toggle on/off) + */ +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class TestDBTClientServer02_NoEnc extends DBTClientServer1x { + static final boolean serverSC = true; + + @Test(timeout = 30000) + public final void test01_FullCycle_EncNone() { + final boolean serverShallHaveKeys = false; + final boolean clientShallHaveKeys = false; + test8x_fullCycle("01", false /* server_client_order */, serverSC, + BTSecurityLevel.NONE, serverShallHaveKeys, BTSecurityLevel.NONE, clientShallHaveKeys); + } + + public static void main(final String args[]) { + org.junit.runner.JUnitCore.main(TestDBTClientServer02_NoEnc.class.getName()); + } +} diff --git a/trial/java/trial/org/direct_bt/TestDBTClientServer10_SC0.java b/trial/java/trial/org/direct_bt/TestDBTClientServer10_SC0.java index 21635985..dedd8e19 100644 --- a/trial/java/trial/org/direct_bt/TestDBTClientServer10_SC0.java +++ b/trial/java/trial/org/direct_bt/TestDBTClientServer10_SC0.java @@ -44,14 +44,6 @@ import org.junit.runners.MethodSorters; public class TestDBTClientServer10_SC0 extends DBTClientServer1x { static final boolean serverSC = false; - @Test(timeout = 30000) - public final void test00_FullCycle_EncNone() { - final boolean serverShallHaveKeys = false; - final boolean clientShallHaveKeys = false; - test8x_fullCycle("00", true /* server_client_order */, serverSC, - BTSecurityLevel.NONE, serverShallHaveKeys, BTSecurityLevel.NONE, clientShallHaveKeys); - } - @Test(timeout = 40000) public final void test10_FullCycle_EncOnlyNo1() { final boolean serverShallHaveKeys = false; diff --git a/trial/java/trial/org/direct_bt/TestDBTClientServer11_SC0.java b/trial/java/trial/org/direct_bt/TestDBTClientServer11_SC0.java index cbbca552..2d9271d7 100644 --- a/trial/java/trial/org/direct_bt/TestDBTClientServer11_SC0.java +++ b/trial/java/trial/org/direct_bt/TestDBTClientServer11_SC0.java @@ -44,14 +44,6 @@ import org.junit.runners.MethodSorters; public class TestDBTClientServer11_SC0 extends DBTClientServer1x { static final boolean serverSC = false; - @Test(timeout = 30000) - public final void test01_FullCycle_EncNone() { - final boolean serverShallHaveKeys = false; - final boolean clientShallHaveKeys = false; - test8x_fullCycle("01", false /* server_client_order */, serverSC, - BTSecurityLevel.NONE, serverShallHaveKeys, BTSecurityLevel.NONE, clientShallHaveKeys); - } - @Test(timeout = 40000) public final void test11_FullCycle_EncOnlyNo1() { final boolean serverShallHaveKeys = false; diff --git a/trial/java/trial/org/direct_bt/TestDBTClientServer12_SC1.java b/trial/java/trial/org/direct_bt/TestDBTClientServer12_SC1.java index b3374c62..0f8a37dd 100644 --- a/trial/java/trial/org/direct_bt/TestDBTClientServer12_SC1.java +++ b/trial/java/trial/org/direct_bt/TestDBTClientServer12_SC1.java @@ -44,14 +44,6 @@ import org.junit.runners.MethodSorters; public class TestDBTClientServer12_SC1 extends DBTClientServer1x { static final boolean serverSC = true; - @Test(timeout = 30000) - public final void test00_FullCycle_EncNone() { - final boolean serverShallHaveKeys = false; - final boolean clientShallHaveKeys = false; - test8x_fullCycle("00", true /* server_client_order */, serverSC, - BTSecurityLevel.NONE, serverShallHaveKeys, BTSecurityLevel.NONE, clientShallHaveKeys); - } - @Test(timeout = 40000) public final void test10_FullCycle_EncOnlyNo1() { final boolean serverShallHaveKeys = false; diff --git a/trial/java/trial/org/direct_bt/TestDBTClientServer13_SC1.java b/trial/java/trial/org/direct_bt/TestDBTClientServer13_SC1.java index fcb9d11e..40d83e75 100644 --- a/trial/java/trial/org/direct_bt/TestDBTClientServer13_SC1.java +++ b/trial/java/trial/org/direct_bt/TestDBTClientServer13_SC1.java @@ -44,14 +44,6 @@ import org.junit.runners.MethodSorters; public class TestDBTClientServer13_SC1 extends DBTClientServer1x { static final boolean serverSC = true; - @Test(timeout = 30000) - public final void test01_FullCycle_EncNone() { - final boolean serverShallHaveKeys = false; - final boolean clientShallHaveKeys = false; - test8x_fullCycle("01", false /* server_client_order */, serverSC, - BTSecurityLevel.NONE, serverShallHaveKeys, BTSecurityLevel.NONE, clientShallHaveKeys); - } - @Test(timeout = 40000) public final void test11_FullCycle_EncOnlyNo1() { final boolean serverShallHaveKeys = false; |