use of org.obeonetwork.graal.UseCase in project InformationSystem by ObeoNetwork.
the class UseCaseServicesTest method testNoDomainClasses.
@Test
public void testNoDomainClasses() {
System system = loadRoot("NoDomainClasses.graal", System.class);
UseCase useCase = query(() -> {
return (UseCase) system.getUseCases().get(0);
});
verifyAllDomainClasses(useCase, new String[] {});
}
use of org.obeonetwork.graal.UseCase in project InformationSystem by ObeoNetwork.
the class UseCaseServicesTest method testNamespacesAndSubnamespaces.
@Test
public void testNamespacesAndSubnamespaces() {
System system = loadRoot("NamespacesAndSubnamespaces.graal", System.class);
UseCase useCase = query(() -> {
return (UseCase) system.getUseCases().get(0);
});
verifyAllDomainClasses(useCase, new String[] { "ns1.DomainClass3", "ns1.DomainClass5", "ns1.ns3.DomainClass6", "ns1.ns3.DomainClass7" });
}
use of org.obeonetwork.graal.UseCase in project InformationSystem by ObeoNetwork.
the class UseCaseServicesTest method testDirectlyReferencedDomainClasses.
@Test
public void testDirectlyReferencedDomainClasses() {
System system = loadRoot("DirectlyReferencedDomainClasses.graal", System.class);
UseCase useCase = query(() -> {
return (UseCase) system.getUseCases().get(0);
});
verifyAllDomainClasses(useCase, new String[] { "ns1.DomainClass3", "ns1.ns3.DomainClass6", "ns2.DomainClass2" });
}
use of org.obeonetwork.graal.UseCase in project InformationSystem by ObeoNetwork.
the class TaskImpl method getUseCase.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public UseCase getUseCase() {
Collection<Setting> useCaseReferences = new GraalUsageCrossReferencer() {
@Override
protected boolean crossReference(EObject eObject, EReference eReference, EObject crossReferencedEObject) {
return eReference == GraalPackage.Literals.USE_CASE__TASKS;
}
@Override
protected boolean containment(EObject eObject) {
// (We use Resource instead of CDOResource to avoid dependency on CDO)
return (eObject instanceof Resource) || (eObject instanceof System) || (eObject instanceof UseCase);
}
}.findUsage(this);
UseCase useCase = null;
for (Setting setting : useCaseReferences) {
useCase = (UseCase) setting.getEObject();
break;
}
return useCase;
}
Aggregations