protected Result createFailedResult(Status status) { if (status.getStatusCode() != zzNm.getStatus().getStatusCode()) { throw new UnsupportedOperationException("Creating failed results is not supported"); } else { return zzNm; } }
private Util.Status getInternalStatus() { if (result == null) { System.out.println( "[WARNING] Line " + line + " : " + "Step is missing Result: " + keyword + " : " + name); return Util.Status.MISSING; } else { return Util.resultMap.get(result.getStatus()); } }
@Override public void result(Result result) { if (result.getError() != null) { // If the result contains an error, report a failure. testResult.putString(REPORT_KEY_STACK, result.getErrorMessage()); resultCode = REPORT_VALUE_RESULT_FAILURE; testResult.putString(Instrumentation.REPORT_KEY_STREAMRESULT, result.getErrorMessage()); } else if (result.getStatus().equals("undefined")) { // There was a missing step definition, report an error. List<String> snippets = runtime.getSnippets(); String report = String.format( "Missing step-definition\n\n%s\nfor step '%s'", snippets.get(snippets.size() - 1), currentStep.getName()); testResult.putString(REPORT_KEY_STACK, report); resultCode = REPORT_VALUE_RESULT_ERROR; testResult.putString( Instrumentation.REPORT_KEY_STREAMRESULT, String.format("Missing step-definition: %s", currentStep.getName())); } }
/** * Enterprise Bean's business(...) methods argument RMI IIOP test. Each enterprise Bean class must * define zero or more business(...) methods. The method signatures must follow these rules: * * <p>The methods return value must be legal types for RMI-IIOP. * * @param descriptor the Enterprise Java Bean deployment descriptor * @return <code>Result</code> the results for this assertion */ public Result check(EjbDescriptor descriptor) { result = getInitializedResult(); compName = getVerifierContext().getComponentNameConstructor(); if ((descriptor instanceof EjbSessionDescriptor) || (descriptor instanceof EjbEntityDescriptor)) { if (descriptor.getRemoteClassName() != null && !"".equals(descriptor.getRemoteClassName())) commonToBothInterfaces(descriptor.getRemoteClassName(), descriptor); Set<String> remoteInterfaces = descriptor.getRemoteBusinessClassNames(); for (String remoteIntf : remoteInterfaces) commonToBothInterfaces(remoteIntf, descriptor); } if (result.getStatus() != Result.FAILED) { addGoodDetails(result, compName); result.passed( smh.getLocalString( getClass().getName() + ".passed", "Proper declaration of business method(s) found.")); } return result; }
public void testGetStatusShouldGiveExpectedValue() { assertEquals(Status.DOWN, result.getStatus()); }