// Preferences
HashSet prefs = new HashSet();
// InvocationConstraints object #1 (argument #1)
InvocationConstraints icArg1;
// InvocationConstraints object #2 (argument #2)
InvocationConstraints icArg2;
// The expected InvocationConstraints object
InvocationConstraints icExp;
/*
* +++++ TestCase #1 +++++
*/
tc[0] = new TestCase(null, null, InvocationConstraints.EMPTY);
/*
* +++++ TestCase #2 +++++
*/
tc[1] = new TestCase(InvocationConstraints.EMPTY,
InvocationConstraints.EMPTY, InvocationConstraints.EMPTY);
/*
* +++++ TestCase #3 +++++
*/
tc[2] = new TestCase(null, InvocationConstraints.EMPTY,
InvocationConstraints.EMPTY);
/*
* +++++ TestCase #4 +++++
*/
tc[3] = new TestCase(InvocationConstraints.EMPTY, null,
InvocationConstraints.EMPTY);
/*
* +++++ TestCase #5 +++++
*/
// Requirements
reqs.clear();
reqs.add(ClientAuthentication.YES);
reqs.add(Confidentiality.YES);
reqs.add(Delegation.YES);
reqs.add(Integrity.YES);
reqs.add(ServerAuthentication.YES);
// Preferences
prefs.clear();
prefs.add(ClientAuthentication.NO);
prefs.add(Confidentiality.NO);
prefs.add(Delegation.NO);
prefs.add(Integrity.NO);
prefs.add(ServerAuthentication.NO);
tc[4] = new TestCase(null, new InvocationConstraints(reqs, prefs),
new InvocationConstraints(reqs, prefs));
/*
* +++++ TestCase #6 +++++
*/
// Requirements
reqs.clear();
reqs.add(ClientAuthentication.YES);
reqs.add(Confidentiality.YES);
reqs.add(Delegation.YES);
reqs.add(Integrity.YES);
reqs.add(ServerAuthentication.YES);
// Preferences
prefs.clear();
prefs.add(ClientAuthentication.NO);
prefs.add(Confidentiality.NO);
prefs.add(Delegation.NO);
prefs.add(Integrity.NO);
prefs.add(ServerAuthentication.NO);
tc[5] = new TestCase(InvocationConstraints.EMPTY,
new InvocationConstraints(reqs, prefs),
new InvocationConstraints(reqs, prefs));
/*
* +++++ TestCase #7 +++++
*/
// Requirements
reqs.clear();
reqs.add(ClientAuthentication.YES);
reqs.add(Confidentiality.YES);
reqs.add(Delegation.YES);
reqs.add(Integrity.YES);
reqs.add(ServerAuthentication.YES);
// Preferences
prefs.clear();
prefs.add(ClientAuthentication.NO);
prefs.add(Confidentiality.NO);
prefs.add(Delegation.NO);
prefs.add(Integrity.NO);
prefs.add(ServerAuthentication.NO);
tc[6] = new TestCase(new InvocationConstraints(reqs, prefs), null,
new InvocationConstraints(reqs, prefs));
/*
* +++++ TestCase #8 +++++
*/
// Requirements
reqs.clear();
reqs.add(ClientAuthentication.YES);
reqs.add(Confidentiality.YES);
reqs.add(Delegation.YES);
reqs.add(Integrity.YES);
reqs.add(ServerAuthentication.YES);
// Preferences
prefs.clear();
prefs.add(ClientAuthentication.NO);
prefs.add(Confidentiality.NO);
prefs.add(Delegation.NO);
prefs.add(Integrity.NO);
prefs.add(ServerAuthentication.NO);
tc[7] = new TestCase(new InvocationConstraints(reqs, prefs),
InvocationConstraints.EMPTY, new InvocationConstraints(reqs,
prefs));
/*
* +++++ TestCase #9 +++++
*/
// Reqs for InvocationConstraints #1
reqs.clear();
reqs.add(ClientAuthentication.YES);
reqs.add(Confidentiality.YES);
reqs.add(Delegation.YES);
// Prefs for InvocationConstraints #1
prefs.clear();
prefs.add(ClientAuthentication.NO);
prefs.add(Confidentiality.NO);
prefs.add(Delegation.NO);
// InvocationConstraints #1
icArg1 = new InvocationConstraints(reqs, prefs);
// Reqs for InvocationConstraints #2
reqs.clear();
reqs.add(Integrity.YES);
reqs.add(ServerAuthentication.YES);
// Prefs for InvocationConstraints #2
prefs.clear();
prefs.add(Integrity.NO);
prefs.add(ServerAuthentication.NO);
// InvocationConstraints #2
icArg2 = new InvocationConstraints(reqs, prefs);
// Reqs for the expected InvocationConstraints object
reqs.clear();
reqs.add(ClientAuthentication.YES);
reqs.add(Confidentiality.YES);
reqs.add(Delegation.YES);
reqs.add(Integrity.YES);
reqs.add(ServerAuthentication.YES);
// Prefs for the expected InvocationConstraints object
prefs.clear();
prefs.add(ClientAuthentication.NO);
prefs.add(Confidentiality.NO);
prefs.add(Delegation.NO);
prefs.add(Integrity.NO);
prefs.add(ServerAuthentication.NO);
// The expected InvocationConstraints object
icExp = new InvocationConstraints(reqs, prefs);
tc[8] = new TestCase(icArg1, icArg2, icExp);
/*
* +++++ TestCase #10 +++++
*/
// Reqs for InvocationConstraints #1
reqs.clear();
reqs.add(ClientAuthentication.YES);
reqs.add(Confidentiality.YES);
reqs.add(Delegation.YES);
// Duplicate req
reqs.add(Integrity.YES);
// Prefs for InvocationConstraints #1
prefs.clear();
prefs.add(ClientAuthentication.NO);
prefs.add(Confidentiality.NO);
prefs.add(Delegation.NO);
// Duplicate pref
prefs.add(Integrity.NO);
// Pref that is duplicate of reqs in InvocationConstraints #2
prefs.add(Integrity.YES);
// InvocationConstraints #1
icArg1 = new InvocationConstraints(reqs, prefs);
// Reqs for InvocationConstraints #2
reqs.clear();
// Duplicate req
reqs.add(Delegation.YES);
reqs.add(Integrity.YES);
reqs.add(ServerAuthentication.YES);
// Prefs for InvocationConstraints #2
prefs.clear();
// Pref that is duplicate of reqs in InvocationConstraints #1
prefs.add(ClientAuthentication.YES);
// Duplicate pref
prefs.add(Delegation.NO);
prefs.add(Integrity.NO);
prefs.add(ServerAuthentication.NO);
// InvocationConstraints #2
icArg2 = new InvocationConstraints(reqs, prefs);
// Reqs for the expected InvocationConstraints object
reqs.clear();
reqs.add(ClientAuthentication.YES);
reqs.add(Confidentiality.YES);
reqs.add(Delegation.YES);
reqs.add(Integrity.YES);
reqs.add(ServerAuthentication.YES);
// Prefs for the expected InvocationConstraints object
prefs.clear();
prefs.add(ClientAuthentication.NO);
prefs.add(Confidentiality.NO);
prefs.add(Delegation.NO);
prefs.add(Integrity.NO);
prefs.add(ServerAuthentication.NO);
// The expected InvocationConstraints object
icExp = new InvocationConstraints(reqs, prefs);
tc[9] = new TestCase(icArg1, icArg2, icExp);
}