Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangObject


    }

    @Test
    public void testToTerm_4() {
        final BooleanOption option = CompilerOption.DEBUG_INFO;
        final OtpErlangObject actual = option.toTerm(false);
        final String expected = null;
        Assert.assertEquals(expected, actual);
    }
View Full Code Here


    public void testToTerm_5() throws TermParserException {
        final DefineOption option = CompilerOption.DEFINE;
        @SuppressWarnings("unchecked")
        final List<Pair<String, String>> values = Lists
                .newArrayList(new Pair<String, String>("Macro", "[hej,1]"));
        final OtpErlangObject actual = option.toTerm(values);
        final String expected = "[{d,'Macro',[hej,1]}]";
        Assert.assertEquals(expected, actual.toString());
    }
View Full Code Here

    public void testToTerm_5a() throws TermParserException {
        final DefineOption option = CompilerOption.DEFINE;
        @SuppressWarnings("unchecked")
        final List<Pair<String, String>> values = Lists
                .newArrayList(new Pair<String, String>("Macro", ""));
        final OtpErlangObject actual = option.toTerm(values);
        final String expected = "[{d,'Macro'}]";
        Assert.assertEquals(expected, actual.toString());
    }
View Full Code Here

    }

    @Test
    public void testToTerm_6() {
        final BooleanOption option = CompilerOption.WARN_EXPORT_ALL;
        final OtpErlangObject actual = option.toTerm(false);
        final String expected = "nowarn_export_all";
        Assert.assertEquals(expected, actual.toString());
    }
View Full Code Here

                        Activator.getImage(Images.INFO_NODE));
            } else {
                index = 1;// tuple doesn't contain Pid element
            }

            final OtpErlangObject info = processTuple.elementAt(INDEX_PROCESS_INFO
                    - index);

            // process node
            final OtpErlangObject processNode = processTuple.elementAt(INDEX_PROCESS_NODE
                    - index);
            processNodeNode = new TreeNode("node: " + processNode,
                    Activator.getImage(Images.INFO_NODE));

            if (info instanceof OtpErlangTuple) {
View Full Code Here

                    .elementAt(INDEX_FUNCTION_NAME);

            // args or arity node
            final TreeNode argsNode = new TreeNode();
            argsNode.setImage(Activator.getImage(Images.INFO_NODE));
            final OtpErlangObject arityOrArgs = functionTuple
                    .elementAt(INDEX_FUNCTION_ARGS);
            int arityValue = -1;
            if (arityOrArgs instanceof OtpErlangList) {
                // last element is a list of arguments
                final OtpErlangList arguments = (OtpErlangList) arityOrArgs;
View Full Code Here

        node.addChildren(processNode);

        final OtpErlangList list = (OtpErlangList) tuple.elementAt(INDEX_INFO);
        for (final OtpErlangObject otpErlangObject : list) {
            final OtpErlangTuple infoTuple = (OtpErlangTuple) otpErlangObject;
            final OtpErlangObject key = infoTuple.elementAt(0);
            final OtpErlangObject value = infoTuple.elementAt(1);
            final TreeNode treeNode = new TreeNode(key.toString() + ": "
                    + value.toString());
            treeNode.setImage(Activator.getImage(Images.INFO_NODE));
            node.addChildren(treeNode);
        }
        return node;
    }
View Full Code Here

                tuple.elementAt(INDEX_PROCESS));
        processNode.setImage(Activator.getImage(Images.PROCESS_NODE));

        final OtpErlangTuple exceptionTuple = (OtpErlangTuple) tuple
                .elementAt(INDEX_EXCEPTION);
        final OtpErlangObject exceptionClass = exceptionTuple
                .elementAt(INDEX_EXCEPTION_CLASS);
        final OtpErlangObject exceptionValue = exceptionTuple
                .elementAt(INDEX_EXCEPTION_VALUE);
        labelBuilder.append(exceptionClass.toString());

        final ITreeNode exceptionClassNode = new TreeNode(exceptionClass.toString(),
                Activator.getImage(Images.INFO_NODE));
        exceptionClassNode.addChildren(new TreeNode(exceptionValue.toString()));

        final ITreeNode node = processReturnTrace(labelBuilder.toString(),
                Images.EXCEPTION_NODE, tuple, false);
        node.addChildren(processNode, exceptionClassNode);
        return node;
View Full Code Here

public class BeamLoader {

    public static boolean loadBeam(final IOtpRpc backend, final String moduleName,
            final OtpErlangBinary bin) {
        OtpErlangObject r = null;
        try {
            r = backend.call("code", "is_sticky", "a", moduleName);
            // TODO handle sticky directories
            if (!((OtpErlangAtom) r).booleanValue()) {
                r = backend.call("code", "load_binary", "asb", moduleName, moduleName
View Full Code Here

                        // net tick time
                        final int tickTimeValue = Activator.getDefault()
                                .getPreferenceStore().getInt(PreferenceNames.TICK_TIME);
                        final OtpErlangInt netTickTime = new OtpErlangInt(tickTimeValue);

                        final OtpErlangObject callResult = tracerBackend.getOtpRpc()
                                .call(Constants.ERLANG_HELPER_MODULE, FUN_START, "xsi",
                                        nodes, Constants.OUTPUT_FILE, netTickTime);
                        status = processResult(callResult);

                        if (TracingStatus.OK.equals(status)
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangObject

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.