From 69bd9a1f6ae3b30827bed1bfcb253e1bd1a75117 Mon Sep 17 00:00:00 2001 From: Matteo Bitussi Date: Tue, 21 Nov 2023 10:29:19 +0100 Subject: [PATCH] added default port to config --- tool/src/main/java/migt/DecodeOperation.java | 1 - tool/src/main/java/migt/GUI.java | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tool/src/main/java/migt/DecodeOperation.java b/tool/src/main/java/migt/DecodeOperation.java index 2772ddc..edb0e8e 100644 --- a/tool/src/main/java/migt/DecodeOperation.java +++ b/tool/src/main/java/migt/DecodeOperation.java @@ -1,6 +1,5 @@ package migt; -import com.jayway.jsonpath.JsonPath; import org.json.JSONArray; import org.json.JSONObject; diff --git a/tool/src/main/java/migt/GUI.java b/tool/src/main/java/migt/GUI.java index 1327dd0..dedb594 100644 --- a/tool/src/main/java/migt/GUI.java +++ b/tool/src/main/java/migt/GUI.java @@ -120,6 +120,7 @@ public class GUI extends JSplitPane { private String DRIVER_PATH = ""; private Thread active_ex; private boolean active_ex_finished = false; + private Integer DEFAULT_PORT = 8080; /** * Constructor of the plugin UI @@ -284,6 +285,8 @@ private void readConfigFile() { JSONObject obj = new JSONObject(tmp); String last_driver_path = obj.getString("last_driver_path"); String last_used_browser = obj.getString("last_browser_used"); + DEFAULT_PORT = obj.getInt("default_port"); + if (!last_driver_path.equals("")) { DRIVER_PATH = last_driver_path; @@ -397,7 +400,7 @@ private void readJSONinput(String jsonInput) { for (Session s : test.sessions) { if (!sessions_names.contains(s.name)) { sessions_names.add(s.name); - session_port.put(s.name, "8080"); // set default port to session + session_port.put(s.name, DEFAULT_PORT.toString()); // set default port to session } } } @@ -1000,7 +1003,7 @@ public void onSetVar(Var v) { !btnselectChrome.isEnabled(), DRIVER_PATH, track, - "8080", + DEFAULT_PORT.toString(), "test"); ex.registerExecuteTrackListener(listener); new Thread(ex).start();