Package org.erlide.engine.model.erlang

Source Code of org.erlide.engine.model.erlang.ErlAttributeTests

package org.erlide.engine.model.erlang;

import static org.junit.Assert.assertEquals;

import org.erlide.engine.model.root.IErlElement;
import org.erlide.testing.utils.WorkspaceTest;
import org.junit.Before;
import org.junit.Test;

import com.ericsson.otp.erlang.OtpErlangAtom;
import com.ericsson.otp.erlang.OtpErlangString;

public class ErlAttributeTests extends WorkspaceTest {

    protected IErlModule module;

    @Before
    public void setup() throws Exception {
        setUpProject("testproject1");
        module = getErlModule("xx.erl");
    }

    @Test
    public void getValue() throws Exception {
        module.open(null);
        final IErlElement element = module.getElementAtLine(0);
        final IErlAttribute attribute = (IErlAttribute) element;
        final IErlElement element2 = module.getElementAtLine(1);
        final IErlAttribute attribute2 = (IErlAttribute) element2;
        final OtpErlangAtom xx = new OtpErlangAtom("xx");
        final OtpErlangString yyHrl = new OtpErlangString("yy.hrl");
        assertEquals(xx, attribute.getValue());
        assertEquals(yyHrl, attribute2.getValue());
    }

}
TOP

Related Classes of org.erlide.engine.model.erlang.ErlAttributeTests

TOP
Copyright © 2018 www.massapi.com. 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.