1 | if (testFile != null) {↵ | | |
|
2 | FileInputStream reader = null;↵ | | |
|
3 | try {↵ | | |
|
4 | File f = new File(testFile.getArgument());↵ | | |
|
5 | log.info("Loading file: " + f);↵ | | |
|
6 | reader = new FileInputStream(f↵ | | 1 | res.sampleEnd();↵
|
| | | 2 | res.setResponseMessage("Number of samples in transaction : " + calls + ", number of failing samples : " + noFailingSamples);↵
|
| | | 3 | if(res.isSuccessful()) {↵
|
| | | 4 | res.setResponseCodeOK();↵
|
| | | 5 | }↵
|
|
| | | 6 | // TODO could these be done earlier (or just once?)↵
|
7 | );↵ | | 7 | JMeterContext threadContext = getThreadContext();↵
|
8 | HashTree tree = SaveService.loadTree(reader);↵ | | 8 | JMeterVariables thre↵
|
|
9 | ReportGuiPackage.getInstance().setReportPlanFile(f.getAbsolutePath());↵ | | |
|
|
10 | new ReportLoad().insertLoadedTree(1, tree);↵ | | |
|
11 | } catch (Exception e) {↵ | | |
|
12 | log.error("Failure loading test file", e);↵ | | |
|
13 | JMeterUtils.reportErrorToUser(e.toString());↵ | | 9 | adVars = threadContext.getVariables();↵
|
|
| | | 10 | SamplePackage pack = (SamplePackage) threadVars.getObject(JMeterThread.PACKAGE_OBJECT);↵
|
| | | 11 | if (pack == null) {↵
|
| | | 12 | log.warn("Could not fetch SamplePackage");↵
|
| | | 13 | } else {↵
|
| | | 14 | SampleEvent event = new SampleEvent(res, threadContext.getThreadGroup().getName(),threadVars);↵
|
| | | 15 | // We must set res to null now, before sending the event for the transaction,↵
|
| | | 16 | // so that we can ignore that event in our sampleOccured method ↵
|
14 | }↵ | | 17 | ↵
|
15 | finally{↵ | | 18 | ↵
|
16 | JOrphanUtils.closeQuietly(reader);↵ | | |
|
17 | | | 19 | res = null;↵
|
| | | 20 | lnf.notifyListeners(event, pack.getSampleListeners());↵
|
| | | 21 | }
|