* </ol>
*/
@Test
public void testEquivalence() {
// load equivalences using PhaseTwo
final DefaultPhaseTwo p2 = new PhaseTwoImpl(
new DefaultCacheableResourceService(),
new EquivalenceIndexerServiceImpl(),
new ProtoNetworkServiceImpl());
assertThat("test protonetwork is null", pn, notNullValue());
final Set<EquivalenceDataIndex> equivs;
try {
equivs = p2.stage2LoadNamespaceEquivalences();
} catch (EquivalenceMapResolutionFailure e) {
e.printStackTrace();
fail("encountered exception when loading equivalences");
return;
}
assertThat("equivs are null", equivs, notNullValue());
assertThat("equivs set is empty", equivs.size(), greaterThan(0));
// test equivalencing
try {
// test parameter equivalencer
int params = p2.stage3EquivalenceParameters(pn, equivs);
assertThat("incorrect number of parmeter equivalences", params, is(9));
// test term equivalencer
int terms = p2.stage3EquivalenceTerms(pn);
assertThat("incorrect number of term equivalences", terms, is(5));
// test statement equivalencer
int statements = p2.stage3EquivalenceStatements(pn);
assertThat("incorrect number of statement equivalences", statements, is(3));
} catch (IOException e) {
e.printStackTrace();
fail("encountered exception running parmaeter equivalencer");
}