|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcdx.scorebot.scoring.ScoringRule
public class ScoringRule
defines how to score a test or group of test(s) and any associated threshold(s)
Nested Class Summary | |
---|---|
static class |
ScoringRule.BASIC_METHOD_TYPE
defines the methods which may be used as actions in a basic rule |
class |
ScoringRule.BasicCodeGenerator
defines the fields which are used to generate the code for a basic rule |
Constructor Summary | |
---|---|
ScoringRule()
default constructor |
Method Summary | |
---|---|
boolean |
applies(TestItem ti)
Whether or not a specified TestItem applies here. |
static void |
checkCode(java.lang.String code,
TestSuite ts)
checks the specified code for compile-time errors |
void |
checkCode(TestSuite ts)
checks the code which describes this logic for compile-time errors |
java.lang.Object |
clone()
Returns a clone of this scoring rule. |
boolean |
equals(java.lang.Object o)
|
java.util.Vector<TestScoreEvent> |
executeLogic(TestSuite suite,
TestEvent t)
executes the scoring logic on the specified TestEvent and returns any resulting TestScoreEvents, or null if none was generated (this just passes the TestEvent to ScoringLogic's executeLogic method) |
ScoringRule.BasicCodeGenerator |
getBasicCode()
gets the basic code generator and information |
java.lang.String |
getCode()
gets the code which describes this logic |
java.lang.String |
getDescription()
gets explains what this rule does |
int |
getMaxBonus()
gets total points which can be gained by bonuses applied by this rule |
int |
getMaxDeduction()
gets total points which can be lost by penalties applied by this rule |
int |
getMaxPerTimeBonus()
gets maximum number of points which can be gained in maxPerTimeSecs seconds |
int |
getMaxPerTimeDeduction()
gets maximum number of points which can be lost in maxPerTimeSecs seconds |
int |
getMaxPerTimeMinutes()
gets number of minutes in which no more than maxPerTimeDeduction can be lost or maxPerTimeBonus can be gained |
int |
getMaxPerTimeSecs()
gets number of seconds in which no more than maxPerTimeDeduction can be lost or maxPerTimeBonus can be gained |
java.lang.String |
getName()
gets rule's name (user-defined) |
java.lang.String |
getNameNoSpaces()
gets rule's name with underscores in place of spaces (user-defined) |
java.util.HashMap<java.lang.String,TestNumPair> |
getTestsToTrack()
gets what tests are being tracked by this rule |
boolean |
getUseBasicCode()
sets whether or not to use the basic code (false => user-specified code) |
boolean |
getUseUniqueResults()
Gets whether or not results can only be used once in this scoring rule |
void |
prepareRule(TestSuite ts)
Prepare this rule for execution -- determines what tests need to be tracked and builds the logic |
void |
setCode(java.lang.String code)
sets the code which describes this logic |
void |
setCode(java.lang.String code,
TestSuite ts)
sets the code which describes this logic |
void |
setDescription(java.lang.String description)
sets explains what this rule does |
void |
setMaxBonus(int maxBonus)
sets total points which can be gained by bonuses applied by this rule |
void |
setMaxDeduction(int maxDeducation)
sets total points which can be lost by penalties applied by this rule (a negative magnitude) |
void |
setMaxPerTimeBonus(int maxPerTimeBonus)
sets maximum number of points which can be gained in maxPerTimeSecs seconds |
void |
setMaxPerTimeDeduction(int maxPerTimeDeduction)
sets maximum number of points which can be lost in maxPerTimeSecs seconds |
void |
setMaxPerTimeMinutes(int maxPerTimeMins)
sets number of minutes in which no more than maxPerTimeDeduction can be lost or maxPerTimeBonus can be gained |
void |
setMaxPerTimeSecs(int maxPerTimeSecs)
sets number of seconds in which no more than maxPerTimeDeduction can be lost or maxPerTimeBonus can be gained |
void |
setName(java.lang.String name)
sets rule's name (user-defined) |
void |
setUseBasicCode(boolean useBasicCode)
gets whether or not to use the basic code (false => user-specified code) |
void |
setUseUniqueResults(boolean useUniqueResults)
Sets whether or not results can only be used once in this scoring rule. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScoringRule()
Method Detail |
---|
public boolean applies(TestItem ti)
ti
- the TestItem to check
public java.lang.Object clone()
ScoringRule
object.
clone
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.util.Vector<TestScoreEvent> executeLogic(TestSuite suite, TestEvent t) throws LogicException
suite
- the suite which score events generated by this context refer tot
- the TestEvent whose result is to be considered by the logic
LogicException
- occurs if a runtime error occurs in the scoring languagepublic void prepareRule(TestSuite ts) throws LogicException, ParseException, TokenMgrError
ts
- the TestSuite which holds this
LogicException
- if there is a problem processing the code's logic
ParseException
- if there is a problem parsing the code
TokenMgrError
- if there is a problem parsing the codepublic static void checkCode(java.lang.String code, TestSuite ts) throws LogicException, ParseException, TokenMgrError
code
- the code to checkts
- the test suite to check
LogicException
- if there is a problem processing the code's logic
ParseException
- if there is a problem parsing the code
TokenMgrError
- if there is a problem parsing the codepublic void checkCode(TestSuite ts) throws LogicException, ParseException, TokenMgrError
ts
- the test suite to check
LogicException
- if there is a problem processing the code's logic
ParseException
- if there is a problem parsing the code
TokenMgrError
- if there is a problem parsing the codepublic java.lang.String getCode()
public void setCode(java.lang.String code) throws LogicException, ParseException, TokenMgrError
ParseException
- if there is a problem with the code (the code
will, however, still be saved even if it is invalid!)
TokenMgrError
- if there is a problem parsing the code
LogicException
public void setCode(java.lang.String code, TestSuite ts) throws LogicException, ParseException, TokenMgrError
LogicException
- if there is a problem processing the code's logic (the code
will, however, still be saved even if it is invalid!)
ParseException
- if there is a problem parsing the code (the code
will, however, still be saved even if it is invalid!)
TokenMgrError
- if there is a problem parsing the codepublic java.lang.String getName()
public java.lang.String getNameNoSpaces()
public void setName(java.lang.String name) throws IllegalArgValException
IllegalArgValException
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
public int getMaxDeduction()
public void setMaxDeduction(int maxDeducation)
public int getMaxPerTimeDeduction()
public int getMaxBonus()
public void setMaxBonus(int maxBonus)
public int getMaxPerTimeBonus()
public void setMaxPerTimeBonus(int maxPerTimeBonus)
public void setMaxPerTimeDeduction(int maxPerTimeDeduction)
public int getMaxPerTimeSecs()
public void setMaxPerTimeSecs(int maxPerTimeSecs)
public int getMaxPerTimeMinutes()
public void setMaxPerTimeMinutes(int maxPerTimeMins)
public java.util.HashMap<java.lang.String,TestNumPair> getTestsToTrack()
public boolean getUseUniqueResults()
public void setUseUniqueResults(boolean useUniqueResults)
useUniqueResults
- true means only test results which have not previously
contributed to a TestScoreEvent from this rule will be usedpublic boolean getUseBasicCode()
public void setUseBasicCode(boolean useBasicCode)
public ScoringRule.BasicCodeGenerator getBasicCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |