public static class MultipleActionMethodsDefined { @TagValue(type = "T1", injectionStrategy = TagValue.InjectionStrategy.BY_TAG) public Tag t; @Action(resultTag = "T1") public String execute() { return "executed"; } @Action(resultTag = "T2") public String execut2() { return "executed"; } }
@Override public TagInjection visit(TagValue annotation, Field field) { return new TagInjection(annotation.type(), field, annotation.injectionStrategy()); } });
public static class NoActionMethodDefined { @TagValue(type = "T1", injectionStrategy = TagValue.InjectionStrategy.BY_TAG) public Tag t; }
/** * @author Alexander Wert * */ public class NoDefaultConstructorClass { @TagValue(type = "Test") public int par3 = 1; @TagValue(type = "Test") protected int par4 = 2; /** * */ public NoDefaultConstructorClass(int x) { par3 = x; } @Action(resultTag = "Test2") public void actionC() { } @Action(resultTag = "Test2") private void actionD() { } }
public static class MissingAnnotation { @TagValue(type = "root", injectionStrategy = TagValue.InjectionStrategy.BY_TAG) private Tag rootTag; @TagValue(type = "T1") private String t1Value; @SessionVariable(name = "baseline", optional = false) private int baseline; @Action(resultTag = "T2") public String execute() { return "executed"; } }
/** * @author Alexander Wert * */ @Rule public class TestClass extends NoDefaultConstructorClass { @TagValue(type = "Test") public int par1 = 1; @TagValue(type = "Test") public int par2 = 2; /** * @param x */ public TestClass() { super(2); } @Action(resultTag = "Test2") public void actionA() { } @Action(resultTag = "Test2") private void actionB() { } }
@TagValue(type = RuleConstants.DIAGNOSIS_TAG_PROBLEM_CONTEXT) private CauseCluster problemContext;
/** * @author Alexander Wert * */ @Rule(name = "RuleA", description = "RuleADescription") public class RuleA { @TagValue(type = Tags.ROOT_TAG) String input; @Action(resultTag = "A") public String action() { return input + input; } }
/** * @author Alexander Wert * */ @Rule(name = "RuleA", description = "RuleADescription") public class RuleA { @TagValue(type = Tags.ROOT_TAG) String input; @Action(resultTag = "A") public String action() { return input + input; } }
/** * @author Alexander Wert * */ @Rule(name = "RuleB") public class RuleB { @TagValue(type = "A") String input; @Action(resultTag = "B") public int action() { return input.length(); } }
/** * @author Alexander Wert * */ @Rule(name = "RuleB") public class RuleB { @TagValue(type = "A") String input; @Action(resultTag = "B") public int action() { return input.length(); } }
/** * @author Alexander Wert * */ @Rule(name = "RuleE") public class RuleE { @TagValue(type = Tags.ROOT_TAG) String input; @Action(resultTag = "E") public String action() { return input + "E"; } }
/** * @author Alexander Wert * */ @Rule(name = "RuleD") public class RuleD { @TagValue(type = Tags.ROOT_TAG) String input; @Action(resultTag = "D") public int action() { throw new RuntimeException("Expected Rule exception"); } }
/** * @author Alexander Wert * */ @Rule(name = "RuleD") public class RuleD { @TagValue(type = Tags.ROOT_TAG) String input; @Action(resultTag = "D") public int action() { throw new RuntimeException("Expected Rule exception"); } }
/** * @author Alexander Wert * */ @Rule public class AnnotatedSuperClass { @TagValue(type = "Test") public int par3 = 1; /** * */ public AnnotatedSuperClass(int x) { par3 = x; } @Action(resultTag = "Test2") private void actionD() { } }