summaryrefslogtreecommitdiffstats
path: root/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java
diff options
context:
space:
mode:
Diffstat (limited to 'ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java')
-rw-r--r--ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java23
1 files changed, 20 insertions, 3 deletions
diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java
index 78cf2709af..6251d1e8b0 100644
--- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java
+++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/MobProxy.java
@@ -92,12 +92,29 @@ public class MobProxy {
server.start();
// filter firefox requests to mozilla when system proxy is absent
server.blacklistRequests(".*mozilla.*", 200);
- }
- mobProxyServerMap.put(Thread.currentThread().getId(), server);
+ }
+ addProxyServerToPull(Thread.currentThread().getId(), server);
}
public static synchronized BrowserMobProxyServer getPoxyServer() {
return mobProxyServerMap.get(Thread.currentThread().getId());
- }
+ }
+
+ public static void addProxyServerToPull(Long threadId, BrowserMobProxyServer server){
+ mobProxyServerMap.put(threadId, server);
+ }
+
+ public static synchronized void removePoxyServer() {
+ if (getPoxyServer() != null){
+ getPoxyServer().stop();
+ mobProxyServerMap.remove(Thread.currentThread().getId());
+ }
+ }
+
+ public static void removeAllProxyServers(){
+ for(Long threadNumber :mobProxyServerMap.keySet()){
+ mobProxyServerMap.get(threadNumber).stop();
+ }
+ }
}