public class SAFSTestLevelError extends SAFSTestLevelException
TestCycle
, TestSuite
or TestCase
to indicate the error of a certain test level.AbstractLogFacility.TESTLEVEL_ERRORED
, example as below:<LOG_MESSAGE type='TESTLEVEL_ERRORED' date='06-19-2018' time='10:32:42' > <MESSAGE_TEXT><![CDATA[{"propagate":false,"messages":[{"type":"NullPointerException","errorTrace":{"declaringClass":"a.testcase.Cases1","methodName":"case5","fileName":"Cases1.java","lineNumber":88}}],"stackTrace":[],"suppressedExceptions":[]}]]></MESSAGE_TEXT> </LOG_MESSAGE>Below is an example to throw this exception with a single error in test case.
@TestCase public void case3() throws SAFSTestLevelException{ String name = null; try{ name.length(); }catch(NullPointerException e){ throw new SAFSTestLevelError(e.getMessage(), null, e.getClass().getSimpleName()); } }
SAFSTestLevelException.TestLevelMessage
messages, returnObj
Constructor and Description |
---|
SAFSTestLevelError() |
SAFSTestLevelError(boolean propagate) |
SAFSTestLevelError(java.lang.String message,
java.lang.String details,
java.lang.String type) |
SAFSTestLevelError(java.lang.String message,
java.lang.String details,
java.lang.String type,
boolean propagate) |
Modifier and Type | Method and Description |
---|---|
void |
addError(java.lang.String message,
java.lang.String details,
java.lang.String type) |
java.util.List<SAFSTestLevelException.TestLevelMessage> |
getErrors() |
boolean |
isPropagate() |
addMessage, getMessages, getReturnObj, setReturnObj
public SAFSTestLevelError()
public SAFSTestLevelError(boolean propagate)
public SAFSTestLevelError(java.lang.String message, java.lang.String details, java.lang.String type)
public SAFSTestLevelError(java.lang.String message, java.lang.String details, java.lang.String type, boolean propagate)
public boolean isPropagate()
public void addError(java.lang.String message, java.lang.String details, java.lang.String type)
public java.util.List<SAFSTestLevelException.TestLevelMessage> getErrors()
Copyright © SAS Institute. All Rights Reserved.