Search in sources :

Example 11 with Procedure0

use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-eclipse by eclipse.

the class AbstractFSSynchronizationTest method testUpdateFileContentWithProjectAsOutput.

@Test
public void testUpdateFileContentWithProjectAsOutput() {
    final Procedure1<OutputConfiguration> _function = (OutputConfiguration it) -> {
        it.setOutputDirectory("./");
    };
    final Procedure0 _function_1 = () -> {
        this.testUpdateFileContent(this.project);
    };
    this.withOutputConfiguration(_function, _function_1);
}
Also used : Procedure0(org.eclipse.xtext.xbase.lib.Procedures.Procedure0) OutputConfiguration(org.eclipse.xtext.generator.OutputConfiguration) AbstractBuilderParticipantTest(org.eclipse.xtext.builder.impl.AbstractBuilderParticipantTest) Test(org.junit.Test)

Example 12 with Procedure0

use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-eclipse by eclipse.

the class AbstractFSSynchronizationTest method testCleanUpProjectDerivedResourcesWithDeleteDerived.

@Test
public void testCleanUpProjectDerivedResourcesWithDeleteDerived() {
    final Procedure1<OutputConfiguration> _function = (OutputConfiguration it) -> {
        it.setOutputDirectory("./");
    };
    final Procedure0 _function_1 = () -> {
        this.testCleanUpDerivedResourcesWithDeleteDerived(this.project);
    };
    this.withOutputConfiguration(_function, _function_1);
}
Also used : Procedure0(org.eclipse.xtext.xbase.lib.Procedures.Procedure0) OutputConfiguration(org.eclipse.xtext.generator.OutputConfiguration) AbstractBuilderParticipantTest(org.eclipse.xtext.builder.impl.AbstractBuilderParticipantTest) Test(org.junit.Test)

Example 13 with Procedure0

use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-eclipse by eclipse.

the class AbstractFSSynchronizationTest method testDeleteUpdatedDerivedResourceWithProjectAsOutput.

@Test
public void testDeleteUpdatedDerivedResourceWithProjectAsOutput() {
    final Procedure1<OutputConfiguration> _function = (OutputConfiguration it) -> {
        it.setOutputDirectory("./");
    };
    final Procedure0 _function_1 = () -> {
        this.testDeleteUpdatedDerivedResource(this.project);
    };
    this.withOutputConfiguration(_function, _function_1);
}
Also used : Procedure0(org.eclipse.xtext.xbase.lib.Procedures.Procedure0) OutputConfiguration(org.eclipse.xtext.generator.OutputConfiguration) AbstractBuilderParticipantTest(org.eclipse.xtext.builder.impl.AbstractBuilderParticipantTest) Test(org.junit.Test)

Example 14 with Procedure0

use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-eclipse by eclipse.

the class AbstractFSSynchronizationTest method testCreateFileWithProjectAsOutput.

@Test
public void testCreateFileWithProjectAsOutput() {
    final Procedure1<OutputConfiguration> _function = (OutputConfiguration it) -> {
        it.setOutputDirectory("./");
    };
    final Procedure0 _function_1 = () -> {
        this.testCreateFile(this.project);
    };
    this.withOutputConfiguration(_function, _function_1);
}
Also used : Procedure0(org.eclipse.xtext.xbase.lib.Procedures.Procedure0) OutputConfiguration(org.eclipse.xtext.generator.OutputConfiguration) AbstractBuilderParticipantTest(org.eclipse.xtext.builder.impl.AbstractBuilderParticipantTest) Test(org.junit.Test)

Example 15 with Procedure0

use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-eclipse by eclipse.

the class AbstractFSSynchronizationTest method testCleanOutput_02.

@Test
public void testCleanOutput_02() {
    final Procedure1<OutputConfiguration> _function = (OutputConfiguration it) -> {
        it.setCanClearOutputDirectory(true);
        it.setCleanUpDerivedResources(false);
    };
    final Procedure0 _function_1 = () -> {
        try {
            final File srcGenDirectory = this.project.getFolder("src-gen").getLocation().toFile();
            Assert.assertFalse(srcGenDirectory.exists());
            IResourcesSetupUtil.createFile(this.project.getFile(("src/Foo" + this.F_EXT)).getFullPath(), "object Foo");
            IResourcesSetupUtil.reallyWaitForAutoBuild();
            Assert.assertTrue(srcGenDirectory.exists());
            Assert.assertFalse(((List<File>) Conversions.doWrapArray(srcGenDirectory.listFiles())).isEmpty());
            this.createJavaIoFile(this.project.getFile("src-gen/Lalala.txt").getLocation());
            IResourcesSetupUtil.cleanBuild();
            Assert.assertTrue(srcGenDirectory.exists());
            Assert.assertTrue(((List<File>) Conversions.doWrapArray(srcGenDirectory.listFiles())).isEmpty());
        } catch (Throwable _e) {
            throw Exceptions.sneakyThrow(_e);
        }
    };
    this.withOutputConfiguration(_function, _function_1);
}
Also used : Procedure0(org.eclipse.xtext.xbase.lib.Procedures.Procedure0) OutputConfiguration(org.eclipse.xtext.generator.OutputConfiguration) List(java.util.List) File(java.io.File) IFile(org.eclipse.core.resources.IFile) AbstractBuilderParticipantTest(org.eclipse.xtext.builder.impl.AbstractBuilderParticipantTest) Test(org.junit.Test)

Aggregations

Procedure0 (org.eclipse.xtext.xbase.lib.Procedures.Procedure0)102 Test (org.junit.Test)79 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)53 AbstractQueuedBuildDataTest (org.eclipse.xtend.ide.tests.builder.AbstractQueuedBuildDataTest)50 AbstractBuilderParticipantTest (org.eclipse.xtext.builder.impl.AbstractBuilderParticipantTest)13 OutputConfiguration (org.eclipse.xtext.generator.OutputConfiguration)13 BadLocationException (org.eclipse.jface.text.BadLocationException)11 IFile (org.eclipse.core.resources.IFile)6 Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)6 LocalArgumentsVariable (org.eclipse.n4js.n4JS.LocalArgumentsVariable)5 ITextEditor (org.eclipse.ui.texteditor.ITextEditor)5 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)5 List (java.util.List)4 TypeReference (org.eclipse.xtend.lib.macro.declaration.TypeReference)4 File (java.io.File)3 IResourceDescription (org.eclipse.xtext.resource.IResourceDescription)3 Matcher (java.util.regex.Matcher)2 JavaModelException (org.eclipse.jdt.core.JavaModelException)2 MutableFieldDeclaration (org.eclipse.xtend.lib.macro.declaration.MutableFieldDeclaration)2 MutableInterfaceDeclaration (org.eclipse.xtend.lib.macro.declaration.MutableInterfaceDeclaration)2