Search in sources :

Example 31 with ProjectDescription

use of org.eclipse.n4js.n4mf.ProjectDescription in project n4js by eclipse.

the class AbstractInternalWorkspaceTest method testGetLocation_01.

@SuppressWarnings("javadoc")
@Test
public void testGetLocation_01() {
    ProjectDescription description = getWorkspace().getProjectDescription(myProjectURI);
    ProjectDependency dependency = description.getAllProjectDependencies().get(0);
    URI resolvedLocation = getWorkspace().getLocation(myProjectURI, dependency, N4JSSourceContainerType.PROJECT);
    assertEquals(libProjectURI, resolvedLocation);
}
Also used : ProjectDependency(org.eclipse.n4js.n4mf.ProjectDependency) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) URI(org.eclipse.emf.common.util.URI) Test(org.junit.Test)

Example 32 with ProjectDescription

use of org.eclipse.n4js.n4mf.ProjectDescription in project n4js by eclipse.

the class AbstractInternalWorkspaceTest method testGetProjectDescription_03.

@SuppressWarnings("javadoc")
@Test
public void testGetProjectDescription_03() {
    ProjectDescription description = getWorkspace().getProjectDescription(archiveFileURI);
    assertNotNull(description);
    assertEquals(archiveProjectId, description.getProjectId());
}
Also used : ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) Test(org.junit.Test)

Example 33 with ProjectDescription

use of org.eclipse.n4js.n4mf.ProjectDescription in project n4js by eclipse.

the class AbstractInternalWorkspaceTest method testGetLocation_02.

@SuppressWarnings("javadoc")
@Test
public void testGetLocation_02() {
    ProjectDescription description = getWorkspace().getProjectDescription(myProjectURI);
    ProjectDependency dependencyOnArchive = description.getAllProjectDependencies().get(1);
    URI resolvedArchiveLocation = getWorkspace().getLocation(myProjectURI, dependencyOnArchive, N4JSSourceContainerType.ARCHIVE);
    assertEquals(archiveFileURI, resolvedArchiveLocation);
}
Also used : ProjectDependency(org.eclipse.n4js.n4mf.ProjectDependency) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) URI(org.eclipse.emf.common.util.URI) Test(org.junit.Test)

Example 34 with ProjectDescription

use of org.eclipse.n4js.n4mf.ProjectDescription in project n4js by eclipse.

the class AbstractInternalWorkspaceTest method testGetLocation_03.

@SuppressWarnings("javadoc")
@Test
public void testGetLocation_03() {
    ProjectDescription description = getWorkspace().getProjectDescription(myProjectURI);
    ProjectDependency dependencyOnArchive = description.getAllProjectDependencies().get(1);
    URI expectedToBeNull = getWorkspace().getLocation(myProjectURI, dependencyOnArchive, N4JSSourceContainerType.PROJECT);
    assertNull(expectedToBeNull);
}
Also used : ProjectDependency(org.eclipse.n4js.n4mf.ProjectDependency) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) URI(org.eclipse.emf.common.util.URI) Test(org.junit.Test)

Example 35 with ProjectDescription

use of org.eclipse.n4js.n4mf.ProjectDescription in project n4js by eclipse.

the class N4MFSemanticSequencer method sequence.

@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
    EPackage epackage = semanticObject.eClass().getEPackage();
    ParserRule rule = context.getParserRule();
    Action action = context.getAssignedAction();
    Set<Parameter> parameters = context.getEnabledBooleanParameters();
    if (epackage == N4mfPackage.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case N4mfPackage.BOOTSTRAP_MODULE:
                sequence_BootstrapModule(context, (BootstrapModule) semanticObject);
                return;
            case N4mfPackage.DECLARED_VERSION:
                sequence_DeclaredVersion(context, (DeclaredVersion) semanticObject);
                return;
            case N4mfPackage.EXEC_MODULE:
                sequence_ExecModule(context, (ExecModule) semanticObject);
                return;
            case N4mfPackage.EXTENDED_RUNTIME_ENVIRONMENT:
                sequence_ExtendedRuntimeEnvironment(context, (ExtendedRuntimeEnvironment) semanticObject);
                return;
            case N4mfPackage.IMPLEMENTED_PROJECTS:
                sequence_ImplementedProjects(context, (ImplementedProjects) semanticObject);
                return;
            case N4mfPackage.INIT_MODULES:
                sequence_InitModules(context, (InitModules) semanticObject);
                return;
            case N4mfPackage.MODULE_FILTER:
                sequence_ModuleFilter(context, (ModuleFilter) semanticObject);
                return;
            case N4mfPackage.MODULE_FILTER_SPECIFIER:
                sequence_ModuleFilterSpecifier(context, (ModuleFilterSpecifier) semanticObject);
                return;
            case N4mfPackage.PROJECT_DEPENDENCIES:
                sequence_ProjectDependencies(context, (ProjectDependencies) semanticObject);
                return;
            case N4mfPackage.PROJECT_DEPENDENCY:
                sequence_ProjectDependency(context, (ProjectDependency) semanticObject);
                return;
            case N4mfPackage.PROJECT_DESCRIPTION:
                sequence_ProjectDescription(context, (ProjectDescription) semanticObject);
                return;
            case N4mfPackage.PROJECT_REFERENCE:
                sequence_ProjectReference(context, (ProjectReference) semanticObject);
                return;
            case N4mfPackage.PROVIDED_RUNTIME_LIBRARIES:
                sequence_ProvidedRuntimeLibraries(context, (ProvidedRuntimeLibraries) semanticObject);
                return;
            case N4mfPackage.PROVIDED_RUNTIME_LIBRARY_DEPENDENCY:
                sequence_ProvidedRuntimeLibraryDependency(context, (ProvidedRuntimeLibraryDependency) semanticObject);
                return;
            case N4mfPackage.REQUIRED_RUNTIME_LIBRARIES:
                sequence_RequiredRuntimeLibraries(context, (RequiredRuntimeLibraries) semanticObject);
                return;
            case N4mfPackage.REQUIRED_RUNTIME_LIBRARY_DEPENDENCY:
                sequence_RequiredRuntimeLibraryDependency(context, (RequiredRuntimeLibraryDependency) semanticObject);
                return;
            case N4mfPackage.SIMPLE_PROJECT_DESCRIPTION:
                sequence_SimpleProjectDescription(context, (SimpleProjectDescription) semanticObject);
                return;
            case N4mfPackage.SOURCE_FRAGMENT:
                sequence_SourceFragment(context, (SourceFragment) semanticObject);
                return;
            case N4mfPackage.TESTED_PROJECT:
                sequence_TestedProject(context, (TestedProject) semanticObject);
                return;
            case N4mfPackage.TESTED_PROJECTS:
                sequence_TestedProjects(context, (TestedProjects) semanticObject);
                return;
            case N4mfPackage.VERSION_CONSTRAINT:
                sequence_VersionConstraint(context, (VersionConstraint) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ModuleFilterSpecifier(org.eclipse.n4js.n4mf.ModuleFilterSpecifier) ParserRule(org.eclipse.xtext.ParserRule) ImplementedProjects(org.eclipse.n4js.n4mf.ImplementedProjects) Action(org.eclipse.xtext.Action) ProjectReference(org.eclipse.n4js.n4mf.ProjectReference) VersionConstraint(org.eclipse.n4js.n4mf.VersionConstraint) TestedProjects(org.eclipse.n4js.n4mf.TestedProjects) SimpleProjectDescription(org.eclipse.n4js.n4mf.SimpleProjectDescription) ProjectDependencies(org.eclipse.n4js.n4mf.ProjectDependencies) RequiredRuntimeLibraryDependency(org.eclipse.n4js.n4mf.RequiredRuntimeLibraryDependency) EPackage(org.eclipse.emf.ecore.EPackage) SourceFragment(org.eclipse.n4js.n4mf.SourceFragment) ExecModule(org.eclipse.n4js.n4mf.ExecModule) ProjectDescription(org.eclipse.n4js.n4mf.ProjectDescription) SimpleProjectDescription(org.eclipse.n4js.n4mf.SimpleProjectDescription) BootstrapModule(org.eclipse.n4js.n4mf.BootstrapModule) TestedProject(org.eclipse.n4js.n4mf.TestedProject) ExtendedRuntimeEnvironment(org.eclipse.n4js.n4mf.ExtendedRuntimeEnvironment) ProvidedRuntimeLibraries(org.eclipse.n4js.n4mf.ProvidedRuntimeLibraries) ProvidedRuntimeLibraryDependency(org.eclipse.n4js.n4mf.ProvidedRuntimeLibraryDependency) ProjectDependency(org.eclipse.n4js.n4mf.ProjectDependency) RequiredRuntimeLibraries(org.eclipse.n4js.n4mf.RequiredRuntimeLibraries) ModuleFilter(org.eclipse.n4js.n4mf.ModuleFilter) InitModules(org.eclipse.n4js.n4mf.InitModules) Parameter(org.eclipse.xtext.Parameter) DeclaredVersion(org.eclipse.n4js.n4mf.DeclaredVersion)

Aggregations

ProjectDescription (org.eclipse.n4js.n4mf.ProjectDescription)37 URI (org.eclipse.emf.common.util.URI)19 SimpleProjectDescription (org.eclipse.n4js.n4mf.SimpleProjectDescription)11 Test (org.junit.Test)9 ImmutableList (com.google.common.collect.ImmutableList)7 File (java.io.File)6 EObject (org.eclipse.emf.ecore.EObject)6 ProjectDependency (org.eclipse.n4js.n4mf.ProjectDependency)6 Resource (org.eclipse.emf.ecore.resource.Resource)5 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)5 SourceFragment (org.eclipse.n4js.n4mf.SourceFragment)5 N4JSExternalProject (org.eclipse.n4js.external.N4JSExternalProject)4 IN4JSProject (org.eclipse.n4js.projectModel.IN4JSProject)4 IOException (java.io.IOException)3 IFile (org.eclipse.core.resources.IFile)3 ExtendedRuntimeEnvironment (org.eclipse.n4js.n4mf.ExtendedRuntimeEnvironment)3 ProjectReference (org.eclipse.n4js.n4mf.ProjectReference)3 XtextResourceSet (org.eclipse.xtext.resource.XtextResourceSet)3 Optional (com.google.common.base.Optional)2 IResource (org.eclipse.core.resources.IResource)2