-
Notifications
You must be signed in to change notification settings - Fork 9
0.7.x manual 11.annotations
As of now, JCUnit's annotation system became more complicated than it should be. Simplify this.
In the following example, users should not need to write @GenerateCoveringArrayWith
annotation every time because the setting is pretty typical. Let's make them (values set to checker
and reporters
) default of those attributes.
@RunWith(JCUnit.class)
@GenerateCoveringArrayWith(
checker = @Checker(value = SmartConstraintChecker.class),
reporters = {
@Reporter(value = CombinatorialMetrics.class, args = { @Value("2") })
})
public class QuadraticEquationSolverTest8 {
@FactorField
public int a;
@FactorField
public int b;
@FactorField
public int c;
@Uses({ "a" })
@Condition(constraint = true)
public boolean aIsNonZero() {
return this.a != 0;
}
...
@Test(expected = IllegalArgumentException.class)
@When({ "!aIsNonZero" })
public void solveEquation1$thenThrowIllegalArgumentException() {
new QuadraticEquationSolver(
a,
b,
c).solve();
}
...
(t.b.d.)
Copyright 2013 Hiroshi Ukai.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or 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.