@Test
public void testCheckIfImpactReportAlreadyExists()
{
ReportContainer container = ReportModelFactory.eINSTANCE.createReportContainer();
ImpactReport r = ReportModelFactory.eINSTANCE.createImpactReport();
Actor a1 = URNModelFactory.eINSTANCE.createActor();
Actor a2 = URNModelFactory.eINSTANCE.createActor();
AtomicChangeType c = ChangeModelFactory.eINSTANCE.createAtomicChangeType();
LinkType t = LinkModelFactory.eINSTANCE.createLinkType();
List<EObject> l1 = new ArrayList<EObject>();
List<EObject> l2 = new ArrayList<EObject>();
l1.add(a1);
l2.add(a2);
t.setName("TestRelation");
c.setType(AtomicType.ADD);
r.getImpactSources().add(a1);
r.getAffectedElements().add(a2);
r.setChangeType(c);
r.setType(ReportType.IMPACT);
container.getReports().add(r);
accessLayer.addElement(project, container);
assertFalse(reportManager.checkIfImpactReportAlreadyExists(null, null, null, null));
assertFalse(reportManager.checkIfImpactReportAlreadyExists(project, null, null, null));
assertFalse(reportManager.checkIfImpactReportAlreadyExists(null, l1, null, null));
assertFalse(reportManager.checkIfImpactReportAlreadyExists(null, null, l2, null));
assertFalse(reportManager.checkIfImpactReportAlreadyExists(null, null, null, c));
assertFalse(reportManager.checkIfImpactReportAlreadyExists(null, null, null, null));
// ... continue this ...
Actor a3 = URNModelFactory.eINSTANCE.createActor();
r.getImpactSources().clear();
r.getImpactSources().add(a3);
assertFalse(reportManager.checkIfImpactReportAlreadyExists(project, l1, l2, c));
r.getImpactSources().clear();
r.getImpactSources().add(a1);