From a157980b91dc7faf5fb9230368408464c3fc86f3 Mon Sep 17 00:00:00 2001 From: Maismaus Date: Thu, 17 Feb 2022 15:22:06 +0100 Subject: [PATCH] Decreased the sleep timers for JUnit tests --- src/javasource/unittesting/UnittestingUnitTest1.java | 6 +++--- src/javasource/unittesting/UnittestingUnitTest2.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/javasource/unittesting/UnittestingUnitTest1.java b/src/javasource/unittesting/UnittestingUnitTest1.java index 727f1a0..8c3fee1 100644 --- a/src/javasource/unittesting/UnittestingUnitTest1.java +++ b/src/javasource/unittesting/UnittestingUnitTest1.java @@ -12,14 +12,14 @@ public class UnittestingUnitTest1 @Before public void setup() throws InterruptedException { this.state = false; - Thread.sleep(1000); + Thread.sleep(10); } @Test - public void testOfOneSecondSetupAndOneSecundRun() throws InterruptedException { + public void testOfOneMsSecondSetupAndOneMsSecundRun() throws InterruptedException { this.state = true; TestManager.instance().reportStep("Sleeping a while"); - Thread.sleep(1000); + Thread.sleep(10); TestManager.instance().reportStep("Sleeping done!"); assertTrue(state); } diff --git a/src/javasource/unittesting/UnittestingUnitTest2.java b/src/javasource/unittesting/UnittestingUnitTest2.java index 88ca170..ab4ccda 100644 --- a/src/javasource/unittesting/UnittestingUnitTest2.java +++ b/src/javasource/unittesting/UnittestingUnitTest2.java @@ -11,12 +11,12 @@ public class UnittestingUnitTest2 extends AbstractUnitTest @Before public void setup() throws InterruptedException { - Thread.sleep(500); + Thread.sleep(5); } @After public void tearDown() throws InterruptedException { - Thread.sleep(500); + Thread.sleep(5); } @Test @@ -24,7 +24,7 @@ public void evenMoreUnitTests() throws InterruptedException { this.startTimeMeasure(); this.reportStep("By inheriting from AbstractUnitTest some utility methods are provided and time can be tracted in a more reliable way (without counting setup and teardown)"); - Thread.sleep(1000); + Thread.sleep(10); assertTrue(true);