diff options
author | Sven Gothel <[email protected]> | 2022-04-14 05:27:11 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-04-14 05:27:11 +0200 |
commit | 48221cbcae5ab772f418e77b7fe3320f7f3d0f2e (patch) | |
tree | 150bb78a0c813c62eb5c5657e2111ff0208a8acd /trial | |
parent | a86a1f6aae0c5152dfb0695a9bc4e02f3aadb967 (diff) |
Trial Tests: Extract the non-encryption tests to its own Test* unit file
Diffstat (limited to 'trial')
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; |