M
mike
Hi,
Today we have an annotation for each test called Info. I need to check
this information. Information is different depending if it is a
create, get, set, update operation.
@Info(
time = Time.ISO9600,
attr = {
AREA,
SERVICE,
ROUTING,
}, type = TestCaseType.CREATE, positive = false,
description = ""
)
Then I have a testsummary class that access to all this information
for each test case using a HashMap containing "TestCaseName",Info.
<String, Info>
What I want to do is to check information in @Info -tag depending if
it is a create, get, set, update test case type.
The idea I have is to have an abstract base class like:
public abstract AbstractInfoChecker{
public abstract boolean checkInfo(Info info);
}
and impl classes for each operation tests:
public class Create extends AbstractInfoChecker{
public boolean checkInfo(Info info){
if(info.time().equalsIngoreCase("ISO9600"){
//check other
return true;
}
return false;
}
Q: How do a create an instance of right type depending on
TestCaseType.nnn e.g. CREATE --> instance of
Create.
I have my Info stored in testsummary like this: Info info =
(Info) entry.getValue();
I can access the different values Info object.
All comments and hints are much appreciated.
br,
//mike
Today we have an annotation for each test called Info. I need to check
this information. Information is different depending if it is a
create, get, set, update operation.
@Info(
time = Time.ISO9600,
attr = {
AREA,
SERVICE,
ROUTING,
}, type = TestCaseType.CREATE, positive = false,
description = ""
)
Then I have a testsummary class that access to all this information
for each test case using a HashMap containing "TestCaseName",Info.
<String, Info>
What I want to do is to check information in @Info -tag depending if
it is a create, get, set, update test case type.
The idea I have is to have an abstract base class like:
public abstract AbstractInfoChecker{
public abstract boolean checkInfo(Info info);
}
and impl classes for each operation tests:
public class Create extends AbstractInfoChecker{
public boolean checkInfo(Info info){
if(info.time().equalsIngoreCase("ISO9600"){
//check other
return true;
}
return false;
}
Q: How do a create an instance of right type depending on
TestCaseType.nnn e.g. CREATE --> instance of
Create.
I have my Info stored in testsummary like this: Info info =
(Info) entry.getValue();
I can access the different values Info object.
All comments and hints are much appreciated.
br,
//mike