sft.result.ContextResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of SimpleFunctionalTest Show documentation
Show all versions of SimpleFunctionalTest Show documentation
A JUnit extension to easily adopt functional testing and acceptance testing
/*******************************************************************************
* Copyright (c) 2013, 2014 Sylvain Lézier.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Sylvain Lézier - initial implementation
*******************************************************************************/
package sft.result;
import sft.ContextHandler;
import static sft.result.Issue.FAILED;
import static sft.result.Issue.IGNORED;
import static sft.result.Issue.SUCCEEDED;
public class ContextResult {
public final ContextHandler contextHandler;
public final Throwable exception;
public final Issue issue;
private ContextResult(ContextHandler contextHandler,Issue issue, Throwable throwable) {
this.contextHandler = contextHandler;
this.issue = issue;
this.exception = throwable;
}
public boolean isSuccessful(){
return issue == SUCCEEDED;
}
public static ContextResult success(ContextHandler contextHandler) {
return new ContextResult(contextHandler, SUCCEEDED,null);
}
public static ContextResult failed(ContextHandler contextHandler, Throwable e) {
return new ContextResult(contextHandler,FAILED,e);
}
public static ContextResult ignored(ContextHandler contextHandler) {
return new ContextResult(contextHandler,IGNORED,null);
}
}