|
1 | 1 | package util.validator; |
2 | 2 |
|
| 3 | +import http.helpers.Helper; |
3 | 4 | import org.apache.commons.io.FileUtils; |
4 | 5 | import org.apache.log4j.Logger; |
5 | 6 | import org.json.simple.JSONArray; |
|
23 | 24 | import java.util.concurrent.atomic.AtomicLong; |
24 | 25 |
|
25 | 26 | import static environment.EnvironmentFactory.*; |
26 | | -import static util.general.SystemHelper.isAutomotionFolderExists; |
27 | 27 | import static util.general.SystemHelper.isRetinaDisplay; |
28 | 28 | import static util.validator.Constants.*; |
29 | 29 | import static util.validator.ResponsiveUIValidator.Units.PX; |
@@ -202,15 +202,16 @@ public boolean validate() { |
202 | 202 | } |
203 | 203 |
|
204 | 204 | long ms = System.currentTimeMillis(); |
205 | | - String jsonFileName = rootElementReadableName.replace(" ", "") + "-automotion" + ms + ".json"; |
| 205 | + String uuid = Helper.getGeneratedStringWithLength(7); |
| 206 | + String jsonFileName = rootElementReadableName.replace(" ", "") + "-automotion" + ms + uuid + ".json"; |
206 | 207 | try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(TARGET_AUTOMOTION_JSON + jsonFileName), StandardCharsets.UTF_8))) { |
207 | 208 | writer.write(jsonResults.toJSONString()); |
208 | 209 | } catch (IOException ex) { |
209 | 210 | LOG.error("Cannot create json report: " + ex.getMessage()); |
210 | 211 | } |
211 | 212 | jsonFiles.add(jsonFileName); |
212 | 213 | try { |
213 | | - File file = new File(TARGET_AUTOMOTION_JSON + rootElementReadableName.replace(" ", "") + "-automotion" + ms + ".json"); |
| 214 | + File file = new File(TARGET_AUTOMOTION_JSON + rootElementReadableName.replace(" ", "") + "-automotion" + ms + uuid + ".json"); |
214 | 215 | if (file.getParentFile().mkdirs()) { |
215 | 216 | if (file.createNewFile()) { |
216 | 217 | BufferedWriter writer = new BufferedWriter(new FileWriter(file)); |
|
0 commit comments