Search in sources :

Example 26 with ErlangProjectProperties

use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.

the class RebarConfiguratorTest method emptyInputShouldReturnDefaultConfig.

@Test
public void emptyInputShouldReturnDefaultConfig() {
    final ErlangProjectProperties expected = new ErlangProjectProperties();
    final Path _path = new Path("ebin");
    expected.setOutputDir(_path);
    final ErlangProjectProperties actual = configurator.decodeConfig("");
    Truth.assertThat(actual).isEqualTo(expected);
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) ErlangProjectProperties(org.erlide.engine.model.root.ErlangProjectProperties) Test(org.junit.Test)

Example 27 with ErlangProjectProperties

use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.

the class RebarConfiguratorTest method sourceDirectoriesShouldBeConfigured.

@Test
public void sourceDirectoriesShouldBeConfigured() {
    final StringConcatenation _builder = new StringConcatenation();
    _builder.append("{erl_opts, [{src_dirs, [\"src1\", \"src2\"]}]}.");
    _builder.newLine();
    final String input = _builder.toString();
    final ErlangProjectProperties actual = configurator.decodeConfig(input);
    final Path _path = new Path("src1");
    final Path _path_1 = new Path("src2");
    Truth.<IPath, Iterable<IPath>>assertThat(actual.getSourceDirs()).containsAtLeastElementsIn(Collections.<Object>unmodifiableList(CollectionLiterals.<Object>newArrayList(_path, _path_1)));
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPath(org.eclipse.core.runtime.IPath) ErlangProjectProperties(org.erlide.engine.model.root.ErlangProjectProperties) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Test(org.junit.Test)

Example 28 with ErlangProjectProperties

use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.

the class RebarConfiguratorTest method handleComplexInput.

@Test
public void handleComplexInput() {
    final StringConcatenation _builder = new StringConcatenation();
    _builder.append("something.");
    _builder.newLine();
    _builder.append("{erl_opts, [{src_dirs, [\"src1\", \"src2\"]}]}.");
    _builder.newLine();
    final String input = _builder.toString();
    final ErlangProjectProperties actual = configurator.decodeConfig(input);
    final Path _path = new Path("src1");
    final Path _path_1 = new Path("src2");
    Truth.<IPath, Iterable<IPath>>assertThat(actual.getSourceDirs()).containsAtLeastElementsIn(Collections.<Object>unmodifiableList(CollectionLiterals.<Object>newArrayList(_path, _path_1)));
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPath(org.eclipse.core.runtime.IPath) ErlangProjectProperties(org.erlide.engine.model.root.ErlangProjectProperties) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Test(org.junit.Test)

Example 29 with ErlangProjectProperties

use of org.erlide.engine.model.root.ErlangProjectProperties in project erlide_eclipse by erlang.

the class RebarConfiguratorTest method includeDirectoriesShouldBeConfigured.

@Test
public void includeDirectoriesShouldBeConfigured() {
    final StringConcatenation _builder = new StringConcatenation();
    _builder.append("{erl_opts, [{i, \"myinclude\"}]}.");
    _builder.newLine();
    final String input = _builder.toString();
    final ErlangProjectProperties actual = configurator.decodeConfig(input);
    final IterableSubject _assertThat = Truth.<IPath, Iterable<IPath>>assertThat(actual.getIncludeDirs());
    final Path _path = new Path("myinclude");
    _assertThat.contains(_path);
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IterableSubject(com.google.common.truth.IterableSubject) IPath(org.eclipse.core.runtime.IPath) ErlangProjectProperties(org.erlide.engine.model.root.ErlangProjectProperties) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Test(org.junit.Test)

Aggregations

ErlangProjectProperties (org.erlide.engine.model.root.ErlangProjectProperties)29 IPath (org.eclipse.core.runtime.IPath)21 Test (org.junit.Test)19 Path (org.eclipse.core.runtime.Path)18 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)10 IterableSubject (com.google.common.truth.IterableSubject)4 IErlProject (org.erlide.engine.model.root.IErlProject)4 IProjectConfigurator (org.erlide.engine.model.root.IProjectConfigurator)4 IProject (org.eclipse.core.resources.IProject)3 Subject (com.google.common.truth.Subject)2 File (java.io.File)2 ArrayList (java.util.ArrayList)2 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)2 CoreException (org.eclipse.core.runtime.CoreException)2 OtpErlangList (com.ericsson.otp.erlang.OtpErlangList)1 OtpErlangString (com.ericsson.otp.erlang.OtpErlangString)1 IResource (org.eclipse.core.resources.IResource)1 ProjectScope (org.eclipse.core.resources.ProjectScope)1 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)1 IEclipsePreferences (org.eclipse.core.runtime.preferences.IEclipsePreferences)1