All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.conqat.engine.index.shared.tests.ETestExecutionResult Maven / Gradle / Ivy

/*-------------------------------------------------------------------------+
|                                                                          |
| Copyright (c) 2005-2018 The ConQAT Project                               |
|                                                                          |
| Licensed under the Apache License, Version 2.0 (the "License");          |
| you may not use this file except in compliance with the License.         |
| You may obtain a copy of the License at                                  |
|                                                                          |
|    http://www.apache.org/licenses/LICENSE-2.0                            |
|                                                                          |
| Unless required by applicable law or agreed to in writing, software      |
| distributed under the License is distributed on an "AS IS" BASIS,        |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and      |
| limitations under the License.                                           |
|                                                                          |
+-------------------------------------------------------------------------*/
package org.conqat.engine.index.shared.tests;

/**
 * The result of a test execution. The order of the test executions is important
 * when determining the
 * {@link #worst(ETestExecutionResult, ETestExecutionResult)}
 * {@link ETestExecutionResult}. The order must be from best to worst in order
 * of definition in the {@link Enum} (i.e. highest ordinal is worst
 * {@link ETestExecutionResult}).
 */
public enum ETestExecutionResult {

	/** Test execution was successful. */
	PASSED,

	/** The test is currently marked as "do not execute" (e.g. JUnit @Ignore). */
	IGNORED,

	/** Caused by a failing assumption. */
	SKIPPED,

	/** Caused by a failing assertion. */
	FAILURE,

	/** Caused by an error during test execution (e.g. exception thrown). */
	ERROR;

	/** The best {@link ETestExecutionResult}. */
	public static final ETestExecutionResult BEST_RESULT = ETestExecutionResult.values()[0];

	/**
	 * Returns the worst {@link ETestExecutionResult} between the two
	 * {@link ETestExecutionResult}s.
	 */
	public static ETestExecutionResult worst(ETestExecutionResult resultA, ETestExecutionResult resultB) {
		if (resultA.ordinal() < resultB.ordinal()) {
			return resultB;
		}
		return resultA;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy