Package org.erlide.engine.model.root

Examples of org.erlide.engine.model.root.IErlProject


    // throws BackingStoreException;
    @Test
    public void getExternalIncludes() throws Exception {
        File externalFile = null;
        File externalsFile = null;
        final IErlProject aProject = project2;
        final String externalIncludesString = aProject.getProperties()
                .getExternalIncludes();
        try {
            // given
            // an erlang project and an external file not in any project
            final String externalFileName = "external.hrl";
            externalFile = createTmpFile(externalFileName, "-define(E, hej).\n");
            final String absolutePath = externalFile.getAbsolutePath();
            final String externalsFileName = XX_ERLIDEX;
            externalsFile = createTmpFile(externalsFileName, absolutePath);
            aProject.open(null);
            final Collection<IErlModule> otpIncludes = aProject.getExternalIncludes();
            ((ErlProject) aProject).setExternalIncludesFile(externalsFile
                    .getAbsolutePath());
            aProject.open(null);
            // when
            // fetching all external includes
            final Collection<IErlModule> externalIncludes = aProject
                    .getExternalIncludes();
            // then
            // the external file should be returned
            final Set<IErlModule> otpSet = Sets.newHashSet(otpIncludes);
            final Set<IErlModule> externalSet = Sets.newHashSet(externalIncludes);
View Full Code Here


    }

    @Test
    public void moduleCompletion2Test() throws Exception {
        final String name1 = "completion2";
        final IErlProject project = createProject(name1, getTmpPath(name1));
        completionTest(project, "a.erl", "'CosEventChannelAdmin_A", 23,
                Lists.newArrayList("'CosEventChannelAdmin_AlreadyConnected':"), false);
    }
View Full Code Here

    }

    @Test
    public void recordCompletionLettersTest() throws Exception {
        final String name1 = "completion3";
        final IErlProject project = createProject(name1, getTmpPath(name1));
        final String initialText = "-record(aa, {a, b}).\n-record(ab, {a, b}).\n-record(bb, {a, b}).\nf() ->\n#a";
        completionTest(project, "w.erl", initialText, initialText.length() - 1,
                Lists.newArrayList("aa", "ab", "bb"), false);
        completionTest(project, "w2.erl", initialText, initialText.length(),
                Lists.newArrayList("aa", "ab"), false);
View Full Code Here

    }

    @Test
    public void recordCompletionSingleQuoteTest() throws Exception {
        final String name1 = "completion";
        final IErlProject project = createProject(name1, getTmpPath(name1));
        final String initialText = "-record('AA', {a, b}).\n-record('B', {a, b}).\n"
                + "-record(ab, {a, b}).\nf() ->\n#'A";
        final int len = initialText.length();
        completionTest(project, "a1.erl", initialText, len - 2,
                Lists.newArrayList("'AA'", "'B'", "ab"), false);
View Full Code Here

    }

    @Test
    public void caseInsensitiveProposalsTest() throws Exception {
        final String name1 = "completion";
        final IErlProject project = createProject(name1, getTmpPath(name1));
        final String initialText1 = "-define(abc,abc). -define(aBc, aBc). f()->?ab";
        completionTest(project, "w3.erl", initialText1, initialText1.length(),
                Lists.newArrayList("abc", "aBc"), false);
        final String initialText2 = "-define(abc,abc). -define(aBc, aBc). f()->?aB";
        completionTest(project, "w4.erl", initialText2, initialText2.length(),
View Full Code Here

    }

    @Test
    public void getExternalIncludes_includeDirs() throws Exception {
        File externalFile = null;
        final IErlProject aProject = project2;
        final Collection<IPath> includeDirs = aProject.getProperties().getIncludeDirs();
        try {
            // given
            // an erlang project and an external file not in any project, but on
            // the include-path
            final String externalFileName = "external.hrl";
            externalFile = createTmpFile(externalFileName, "-define(E, hej).\n");
            final String absolutePath = externalFile.getAbsolutePath();
            final List<IPath> newIncludeDirs = Lists.newArrayList(includeDirs);
            aProject.open(null);
            final Collection<IErlModule> otpIncludes = aProject.getExternalIncludes();
            final IPath absoluteDir = new Path(absolutePath).removeLastSegments(1);
            newIncludeDirs.add(absoluteDir);
            ((ErlProject) aProject).setIncludeDirs(newIncludeDirs);
            aProject.open(null);
            // when
            // fetching all external includes
            final Collection<IErlModule> externalIncludes = aProject
                    .getExternalIncludes();
            // then
            // the external file should be returned
            final Set<IErlModule> otpSet = Sets.newHashSet(otpIncludes);
            final Set<IErlModule> externalSet = Sets.newHashSet(externalIncludes);
View Full Code Here

    }

    @Test
    public void caseInsensitiveProposalsTest1() throws Exception {
        final String name1 = "completion";
        final IErlProject project = createProject(name1, getTmpPath(name1));
        final String initialText1 = "zabc()->ok. zaBc()->ok. f()->zab";
        completionTest(project, "w1.erl", initialText1, initialText1.length(),
                Lists.newArrayList("zabc/0", "zaBc/0"), false);
        final String initialText2 = "zabc()->ok. zaBc()->ok. f()->zaB";
        completionTest(project, "w2.erl", initialText2, initialText2.length(),
View Full Code Here

    // http://www.assembla.com/spaces/erlide/tickets/947
    // completion of include and include_lib
    @Test
    public void includeCompletionTest() throws Exception {
        final String name1 = "completion";
        final IErlProject project = createProject(name1, getTmpPath(name1));
        createInclude(project, "a.hrl", "-define(A, a).\n");
        // check that quotes are added if needed
        completionTest(project, "a.erl", "-include(", 9, Lists.newArrayList("\"a.hrl\""),
                false);
        // check that completion works in strings
View Full Code Here

        creator = new ProjectCreator(name, location, new IProject[] {}, info, context,
                null);
        prj = creator.createProject();
        assertThat(prj, is(not(nullValue())));

        final IErlProject erlPrj = ErlangEngine.getInstance().getModel().findProject(prj);
        assertThat(erlPrj, is(not(nullValue())));

        final ErlangProjectProperties props = erlPrj.getProperties();
        assertThat(props.getOutputDir(), is((IPath) new Path("ebin")));

    }
View Full Code Here

    }

    // String getExternalModulesString();
    @Test
    public void getExternalModulesString() throws Exception {
        final IErlProject aProject = project2;
        final String externalIncludesString = aProject.getProperties()
                .getExternalIncludes();
        try {
            final String s = "/hej";
            ((ErlProject) aProject).setExternalModulesFile(s);
            assertEquals(s, aProject.getProperties().getExternalModules());
        } finally {
            ((ErlProject) aProject).setExternalModulesFile(externalIncludesString);
        }
    }
View Full Code Here

TOP

Related Classes of org.erlide.engine.model.root.IErlProject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.