Search in sources :

Example 1 with TestProjectDescriptor

use of org.eclipse.xtext.xtext.wizard.TestProjectDescriptor in project xtext-core by eclipse.

the class WizardConfigurationTest method allJavaProjects.

public List<? extends ProjectDescriptor> allJavaProjects() {
    RuntimeProjectDescriptor _runtimeProject = this.config.getRuntimeProject();
    TestProjectDescriptor _testProject = this.config.getRuntimeProject().getTestProject();
    UiProjectDescriptor _uiProject = this.config.getUiProject();
    TestProjectDescriptor _testProject_1 = this.config.getUiProject().getTestProject();
    IdeProjectDescriptor _ideProject = this.config.getIdeProject();
    IntellijProjectDescriptor _intellijProject = this.config.getIntellijProject();
    WebProjectDescriptor _webProject = this.config.getWebProject();
    return Collections.<ProjectDescriptor>unmodifiableList(CollectionLiterals.<ProjectDescriptor>newArrayList(_runtimeProject, _testProject, _uiProject, _testProject_1, _ideProject, _intellijProject, _webProject));
}
Also used : UiProjectDescriptor(org.eclipse.xtext.xtext.wizard.UiProjectDescriptor) IntellijProjectDescriptor(org.eclipse.xtext.xtext.wizard.IntellijProjectDescriptor) WebProjectDescriptor(org.eclipse.xtext.xtext.wizard.WebProjectDescriptor) TestProjectDescriptor(org.eclipse.xtext.xtext.wizard.TestProjectDescriptor) TestedProjectDescriptor(org.eclipse.xtext.xtext.wizard.TestedProjectDescriptor) ProjectDescriptor(org.eclipse.xtext.xtext.wizard.ProjectDescriptor) IdeProjectDescriptor(org.eclipse.xtext.xtext.wizard.IdeProjectDescriptor) RuntimeProjectDescriptor(org.eclipse.xtext.xtext.wizard.RuntimeProjectDescriptor) IntellijProjectDescriptor(org.eclipse.xtext.xtext.wizard.IntellijProjectDescriptor) UiProjectDescriptor(org.eclipse.xtext.xtext.wizard.UiProjectDescriptor) RuntimeProjectDescriptor(org.eclipse.xtext.xtext.wizard.RuntimeProjectDescriptor) TestProjectDescriptor(org.eclipse.xtext.xtext.wizard.TestProjectDescriptor) WebProjectDescriptor(org.eclipse.xtext.xtext.wizard.WebProjectDescriptor) IdeProjectDescriptor(org.eclipse.xtext.xtext.wizard.IdeProjectDescriptor)

Example 2 with TestProjectDescriptor

use of org.eclipse.xtext.xtext.wizard.TestProjectDescriptor in project xtext-core by eclipse.

the class WizardConfigurationTest method inlinedTestProjectsAddTheirDependenciesToTheMainProject.

@Test
public void inlinedTestProjectsAddTheirDependenciesToTheMainProject() {
    TestProjectDescriptor _testProject = this.config.getRuntimeProject().getTestProject();
    _testProject.setEnabled(true);
    this.config.setSourceLayout(SourceLayout.MAVEN);
    final Consumer<ExternalDependency> _function = (ExternalDependency testDependency) -> {
        final Function1<ExternalDependency, Boolean> _function_1 = (ExternalDependency it) -> {
            return Boolean.valueOf(((Objects.equal(it.getMaven().getArtifactId(), testDependency.getMaven().getArtifactId()) && Objects.equal(it.getP2().getBundleId(), testDependency.getP2().getBundleId())) && Objects.equal(it.getP2().getPackages(), testDependency.getP2().getPackages())));
        };
        Assert.assertTrue(IterableExtensions.<ExternalDependency>exists(this.config.getRuntimeProject().getExternalDependencies(), _function_1));
    };
    this.config.getRuntimeProject().getTestProject().getExternalDependencies().forEach(_function);
}
Also used : ExternalDependency(org.eclipse.xtext.xtext.wizard.ExternalDependency) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) TestProjectDescriptor(org.eclipse.xtext.xtext.wizard.TestProjectDescriptor) Test(org.junit.Test)

Example 3 with TestProjectDescriptor

use of org.eclipse.xtext.xtext.wizard.TestProjectDescriptor in project xtext-core by eclipse.

the class WizardConfigurationTest method testProjectIsPluginProjectWhenRuntimeProjectIsPluginProject.

@Test
public void testProjectIsPluginProjectWhenRuntimeProjectIsPluginProject() {
    TestProjectDescriptor _testProject = this.config.getRuntimeProject().getTestProject();
    _testProject.setEnabled(true);
    Assert.assertTrue(this.config.getRuntimeProject().getTestProject().isEclipsePluginProject());
}
Also used : TestProjectDescriptor(org.eclipse.xtext.xtext.wizard.TestProjectDescriptor) Test(org.junit.Test)

Example 4 with TestProjectDescriptor

use of org.eclipse.xtext.xtext.wizard.TestProjectDescriptor in project xtext-core by eclipse.

the class WizardConfigurationTest method tychoDoesNotFailOnMissingTests.

@Test
public void tychoDoesNotFailOnMissingTests() {
    this.config.setPreferredBuildSystem(BuildSystem.MAVEN);
    UiProjectDescriptor _uiProject = this.config.getUiProject();
    _uiProject.setEnabled(true);
    final Function1<TestProjectDescriptor, Boolean> _function = (TestProjectDescriptor it) -> {
        return Boolean.valueOf(it.isEclipsePluginProject());
    };
    final Function1<TestProjectDescriptor, PomFile> _function_1 = (TestProjectDescriptor it) -> {
        return it.pom();
    };
    final Iterable<PomFile> poms = IterableExtensions.<TestProjectDescriptor, PomFile>map(IterableExtensions.<TestProjectDescriptor>filter(Iterables.<TestProjectDescriptor>filter(this.allJavaProjects(), TestProjectDescriptor.class), _function), _function_1);
    final Consumer<PomFile> _function_2 = (PomFile it) -> {
        Assert.assertTrue(it.getContent().contains("failIfNoTests"));
    };
    poms.forEach(_function_2);
}
Also used : UiProjectDescriptor(org.eclipse.xtext.xtext.wizard.UiProjectDescriptor) PomFile(org.eclipse.xtext.xtext.wizard.PomFile) TestProjectDescriptor(org.eclipse.xtext.xtext.wizard.TestProjectDescriptor) Test(org.junit.Test)

Example 5 with TestProjectDescriptor

use of org.eclipse.xtext.xtext.wizard.TestProjectDescriptor in project xtext-core by eclipse.

the class WizardConfigurationTest method inlinedTestProjectsDontOverrideMainSources.

@Test
public void inlinedTestProjectsDontOverrideMainSources() {
    TestProjectDescriptor _testProject = this.config.getRuntimeProject().getTestProject();
    _testProject.setEnabled(true);
    this.config.setPreferredBuildSystem(BuildSystem.MAVEN);
    this.config.setSourceLayout(SourceLayout.MAVEN);
    final Function1<AbstractFile, Boolean> _function = (AbstractFile it) -> {
        String _relativePath = it.getRelativePath();
        return Boolean.valueOf(Objects.equal(_relativePath, "pom.xml"));
    };
    final AbstractFile pom = IterableExtensions.findFirst(this.config.getRuntimeProject().getFiles(), _function);
    Assert.assertTrue((pom instanceof PomFile));
    Assert.assertTrue(((PomFile) pom).getContent().toString().contains("<artifactId>org.example.mydsl</artifactId>"));
}
Also used : AbstractFile(org.eclipse.xtext.xtext.wizard.AbstractFile) PomFile(org.eclipse.xtext.xtext.wizard.PomFile) TestProjectDescriptor(org.eclipse.xtext.xtext.wizard.TestProjectDescriptor) Test(org.junit.Test)

Aggregations

TestProjectDescriptor (org.eclipse.xtext.xtext.wizard.TestProjectDescriptor)7 Test (org.junit.Test)5 UiProjectDescriptor (org.eclipse.xtext.xtext.wizard.UiProjectDescriptor)3 IdeProjectDescriptor (org.eclipse.xtext.xtext.wizard.IdeProjectDescriptor)2 PomFile (org.eclipse.xtext.xtext.wizard.PomFile)2 ProjectDescriptor (org.eclipse.xtext.xtext.wizard.ProjectDescriptor)2 TestedProjectDescriptor (org.eclipse.xtext.xtext.wizard.TestedProjectDescriptor)2 WebProjectDescriptor (org.eclipse.xtext.xtext.wizard.WebProjectDescriptor)2 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 Set (java.util.Set)1 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)1 Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)1 AbstractFile (org.eclipse.xtext.xtext.wizard.AbstractFile)1 BuildSystem (org.eclipse.xtext.xtext.wizard.BuildSystem)1 ExternalDependency (org.eclipse.xtext.xtext.wizard.ExternalDependency)1 IntellijProjectDescriptor (org.eclipse.xtext.xtext.wizard.IntellijProjectDescriptor)1 RuntimeProjectDescriptor (org.eclipse.xtext.xtext.wizard.RuntimeProjectDescriptor)1 RuntimeTestProjectDescriptor (org.eclipse.xtext.xtext.wizard.RuntimeTestProjectDescriptor)1