1 | public void testTolerance() throws Exception {↵ | | 1 | public void testNoTolerance() throws Exception {↵
|
2 | String data = "<html><head><title>testtitle</title></head>" + "<body>"↵ | | 2 | String data = "<html><head><title>testtitle</title></head>" + "<body>"↵
|
3 | + "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>";↵ | | 3 | + "<p><i><b>invalid tag nesting</i></b><hr>" + "</body></html>";↵
|
|
4 | result.setResponseData(data.getBytes());↵ | | 4 | result.setResponseData(data.getBytes());↵
|
5 | vars = new JMeterVariables();↵ | | 5 | vars = new JMeterVariables();↵
|
6 | jmctx.setVariables(vars);↵ | | 6 | jmctx.setVariables(vars);↵
|
7 | jmctx.setPreviousResult(result);↵ | | 7 | jmctx.setPreviousResult(result);↵
|
8 | assertion.setXPathString("/html/head/title");↵ | | 8 | assertion.setXPathString("/html/head/title");↵
|
9 | assertion.setValidating(true);↵ | | 9 | assertion.setValidating(false);↵
|
10 | assertion.setTolerant(true);↵ | | 10 | assertion.setTolerant(false);↵
|
11 | AssertionResult res = assertion.getResult(result);↵ | | 11 | AssertionResult res = assertion.getResult(result);↵
|
12 | log.debug("failureMessage: " + res.getFailureMessage());↵ | | 12 | log.debug("failureMessage: " + res.getFailureMessage());↵
|
13 | assertFalse(res.isFailure());↵ | | 13 | assertTrue(res.isError());↵
|
14 | assertFalse(res.isError());↵ | | 14 | assertFalse(res.isFailure());↵
|
15 | | | 15 |
|