Search in sources :

Example 11 with UseCase

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[] {});
}
Also used : UseCase(org.obeonetwork.graal.UseCase) System(org.obeonetwork.graal.System) Test(org.junit.Test)

Example 12 with UseCase

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" });
}
Also used : UseCase(org.obeonetwork.graal.UseCase) System(org.obeonetwork.graal.System) Test(org.junit.Test)

Example 13 with UseCase

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" });
}
Also used : UseCase(org.obeonetwork.graal.UseCase) System(org.obeonetwork.graal.System) Test(org.junit.Test)

Example 14 with UseCase

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;
}
Also used : Setting(org.eclipse.emf.ecore.EStructuralFeature.Setting) EObject(org.eclipse.emf.ecore.EObject) GraalUsageCrossReferencer(org.obeonetwork.graal.util.GraalUsageCrossReferencer) Resource(org.eclipse.emf.ecore.resource.Resource) UseCase(org.obeonetwork.graal.UseCase) EReference(org.eclipse.emf.ecore.EReference) System(org.obeonetwork.graal.System)

Aggregations

UseCase (org.obeonetwork.graal.UseCase)14 System (org.obeonetwork.graal.System)12 Test (org.junit.Test)9 EObject (org.eclipse.emf.ecore.EObject)2 EReference (org.eclipse.emf.ecore.EReference)2 Setting (org.eclipse.emf.ecore.EStructuralFeature.Setting)2 Resource (org.eclipse.emf.ecore.resource.Resource)2 AbstractTask (org.obeonetwork.graal.AbstractTask)2 GraalUsageCrossReferencer (org.obeonetwork.graal.util.GraalUsageCrossReferencer)2 Date (java.util.Date)1 EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)1 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)1 InputDialog (org.eclipse.jface.dialogs.InputDialog)1 Entity (org.obeonetwork.dsl.entity.Entity)1 TasksContainer (org.obeonetwork.graal.TasksContainer)1 TasksGroup (org.obeonetwork.graal.TasksGroup)1 UseCasePropertiesEditionPart (org.obeonetwork.graal.parts.UseCasePropertiesEditionPart)1