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