From 8890408f38996cc85a2f6c8e5068a77019b810a9 Mon Sep 17 00:00:00 2001 From: Ace Date: Wed, 14 Jun 2017 12:37:46 +0530 Subject: [PATCH 1/4] Optimizing server start up time when running integration tests --- .../CarbonServerManagerExtension.java | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/CarbonServerManagerExtension.java b/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/CarbonServerManagerExtension.java index cbf21428..cc7f1576 100644 --- a/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/CarbonServerManagerExtension.java +++ b/modules/integration/tests-common/integration-common/src/main/java/org/wso2/iot/integration/common/extensions/CarbonServerManagerExtension.java @@ -106,16 +106,20 @@ public class CarbonServerManagerExtension { .automationContext.getInstance().getHosts().get("default")); long time = System.currentTimeMillis() + 60000L; - while(true) { - if(this.inputStreamHandler.getOutput().contains("Mgt Console URL") || System.currentTimeMillis() >= time) { - int httpsPort = defaultHttpsPort + this.portOffset; - String backendURL = this.automationContext.getContextUrls().getSecureServiceUrl().replaceAll("(:\\d+)", ":" + httpsPort); - User superUser = this.automationContext.getSuperTenant().getTenantAdmin(); - ClientConnectionUtil.waitForLogin(backendURL, superUser); - log.info("Server started successfully."); - break; - } - } +// while(true) { +// if(this.inputStreamHandler.getOutput().contains("Mgt Console URL") || System.currentTimeMillis() >= time) { +// int httpsPort = defaultHttpsPort + this.portOffset; +// String backendURL = this.automationContext.getContextUrls().getSecureServiceUrl().replaceAll("(:\\d+)", ":" + httpsPort); +// User superUser = this.automationContext.getSuperTenant().getTenantAdmin(); +// ClientConnectionUtil.waitForLogin(backendURL, superUser); +// log.info("Server started successfully."); +// break; +// } +// } + int httpsPort = defaultHttpsPort + this.portOffset; + String backendURL = this.automationContext.getContextUrls().getSecureServiceUrl().replaceAll("(:\\d+)", ":" + httpsPort); + User superUser = this.automationContext.getSuperTenant().getTenantAdmin(); + ClientConnectionUtil.waitForLogin(backendURL, superUser); } catch (XPathExpressionException | IOException var13) { throw new IllegalStateException("Unable to start server", var13); } @@ -212,9 +216,9 @@ public class CarbonServerManagerExtension { long time = System.currentTimeMillis() + 300000L; - while(!this.inputStreamHandler.getOutput().contains("Halting JVM") && System.currentTimeMillis() < time) { - ; - } +// while(!this.inputStreamHandler.getOutput().contains("Halting JVM") && System.currentTimeMillis() < time) { +// ; +// } log.info("Server stopped successfully..."); } @@ -261,9 +265,9 @@ public class CarbonServerManagerExtension { long time = System.currentTimeMillis() + 300000L; - while(!this.inputStreamHandler.getOutput().contains("Halting JVM") && System.currentTimeMillis() < time) { - ; - } +// while(!this.inputStreamHandler.getOutput().contains("Halting JVM") && System.currentTimeMillis() < time) { +// ; +// } time = System.currentTimeMillis(); From e2def31fdffee16e1110a63ac51dab97e7ab278d Mon Sep 17 00:00:00 2001 From: Ace Date: Wed, 14 Jun 2017 19:19:56 +0530 Subject: [PATCH 2/4] Increasing timeout --- .../mobileDevice/MobileDeviceManagementWithNoDevices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/integration/tests-integration/src/test/java/org/wso2/iot/integration/mobileDevice/MobileDeviceManagementWithNoDevices.java b/modules/integration/tests-integration/src/test/java/org/wso2/iot/integration/mobileDevice/MobileDeviceManagementWithNoDevices.java index 3f5ea20f..2f2b151e 100644 --- a/modules/integration/tests-integration/src/test/java/org/wso2/iot/integration/mobileDevice/MobileDeviceManagementWithNoDevices.java +++ b/modules/integration/tests-integration/src/test/java/org/wso2/iot/integration/mobileDevice/MobileDeviceManagementWithNoDevices.java @@ -58,7 +58,7 @@ public class MobileDeviceManagementWithNoDevices extends TestBase { while (!checkScopes(Constants.APIApplicationRegistration.PERMISSION_LIST)) { TimeUnit.SECONDS.sleep(5); - long WAIT_TIME = 40000; + long WAIT_TIME = 60000; if (System.currentTimeMillis() - startTime > WAIT_TIME) { Assert.fail("Required APIs are not deployed after waiting for " + WAIT_TIME + " time-out has happened"); } From fe00a52b5644d515a04d88d967abb175e569c38e Mon Sep 17 00:00:00 2001 From: Ruwan Date: Wed, 14 Jun 2017 21:19:42 +0530 Subject: [PATCH 3/4] Updated Readme Updated Readme to reflect change in jenkins build --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6dfa49cb..b706a997 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ # Welcome to WSO2 IoT Server
- - Java8 + - Java8 WSO2 IoT Server is a complete solution that enables device manufacturers and enterprises to connect and manage their devices, build apps, manage events, secure devices and data, and visualize sensor data in a scalable manner. From bf6e0f32bf11f1af3602c9322e9883f0c79283cf Mon Sep 17 00:00:00 2001 From: Ruwan Date: Wed, 14 Jun 2017 21:21:02 +0530 Subject: [PATCH 4/4] readme changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b706a997..cee990b0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ # Welcome to WSO2 IoT Server
- - Java8 + WSO2 IoT Server is a complete solution that enables device manufacturers and enterprises to connect and manage their devices, build apps, manage events, secure devices and data, and visualize sensor data in a scalable manner.