/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/**
*
* This rule can be added to a Junit test and will look for the annotation
* {@link ConditionalRun} on either the test class or method. The test is then
* skipped through Junit's {@link Assume} capabilities if the
* {@link RunCondition} provided in the annotation is not satisfied.
*
* Cobbled together from:
*/
if (!condition.isSatisfied()) {
return new IgnoreStatement(condition);
}
}
if (!condition.isSatisfied()) {
return new IgnoreStatement(condition);
}
}
return aStatement;
}
}
}
}
}
private static class IgnoreConditionCreator {
this.mTestClass = aTestClass;
}
try {
return createCondition();
} catch (RuntimeException re) {
throw re;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
if (isConditionTypeStandalone()) {
} else {
}
return result;
}
private void checkConditionType() {
if (!isConditionTypeStandalone() && !isConditionTypeDeclaredInTarget()) {
= "Conditional class '%s' is a member class "
+ "but was not declared inside the test case using it.\n"
+ "Either make this class a static class, "
+ "standalone class (by declaring it in it's own file) "
+ "or move it inside the test case using it";
}
}
private boolean isConditionTypeStandalone() {
return !conditionType.isMemberClass()
}
private boolean isConditionTypeDeclaredInTarget() {
}
}
}
public void evaluate() {
}
}
}