Examples of OtpErlangInt


Examples of com.ericsson.otp.erlang.OtpErlangInt

      if (rnd.nextInt(100) > 1)
      {
        int numA = rnd.nextInt(10000)-5000, numB=rnd.nextInt(10000)-5000;
        ErlangRunner rn = new ErlangRunner(r.traceRunnerNode);rn.forceReady();// only using default instances
        OtpErlangTuple response = (OtpErlangTuple)rn.call(new OtpErlangObject[]{new OtpErlangAtom("echo"),
            new OtpErlangList(new OtpErlangObject[]{ new OtpErlangAtom(dataHead), new OtpErlangInt(numA), new OtpErlangInt(numB),new OtpErlangAtom(dataC)})},
            0);

        Assert.assertEquals(dataHead,((OtpErlangAtom)response.elementAt(0)).atomValue());
        Assert.assertEquals(processNames[runnerNumber],((OtpErlangAtom)response.elementAt(1)).atomValue());
        OtpErlangObject [] list = ((OtpErlangList)response.elementAt(2)).elements();
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

          partA = partA.substring(1);
        long outcome = Long.parseLong(partA);
        if (outcome > Integer.MAX_VALUE || outcome < Integer.MIN_VALUE)
          result = new OtpErlangLong(outcome);
        else
          result = new OtpErlangInt((int) outcome);
      } else {// floating - point number.
        String textToParse = partA + "."
            + (partB == null ? "0" : partB)
            + (partExp == null ? "" : ("e" + partExp));
        if (partExp != null) {
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

      return singleton;
    }

    @Override
    public void dump(OtpErlangObject arg, StringBuffer resultHolder) {
      OtpErlangInt longValue = (OtpErlangInt) arg;
      resultHolder.append(longValue.longValue());
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

  }
 
  @Test
  public void testToString8()
  {
    Assert.assertEquals("-234",ErlangLabel.dumpErlangObject(new OtpErlangInt(-234)));
  }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

        ErlangLabel.dumpErlangObject(new OtpErlangTuple(new OtpErlangObject[]{
            new OtpErlangAtom("this is an atom"),
            new OtpErlangString("this is a string"),
            new OtpErlangList(new OtpErlangObject[]{
                new OtpErlangList(new OtpErlangObject[]{
                    new OtpErlangInt(-234)
                }),
                new OtpErlangTuple(new OtpErlangObject[]{
                })
            })
        })));
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

 
  @Test
  public void testParse3()
  {
    String text = " -45 ";
    OtpErlangInt number = (OtpErlangInt)ErlangLabel.parseText(text);
    Assert.assertEquals(-45,number.longValue());
    Assert.assertEquals(text.trim(),ErlangLabel.dumpErlangObject(runner.evaluateString(text)));
  }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

 
  @Test
  public void testParse4()
  {
    String text = " 45 ";
    OtpErlangInt number = (OtpErlangInt)ErlangLabel.parseText(text);
    Assert.assertEquals(45,number.longValue());
    Assert.assertEquals(text.trim(),ErlangLabel.dumpErlangObject(runner.evaluateString(text)));
  }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

    Assert.assertEquals(new OtpErlangTuple(new OtpErlangObject[]{
            new OtpErlangAtom("this is an atom"),
            new OtpErlangString("this is a string"),
            new OtpErlangList(new OtpErlangObject[]{
                new OtpErlangList(new OtpErlangObject[]{
                    new OtpErlangInt(-234)
                }),
                new OtpErlangTuple(new OtpErlangObject[]{
                })
            })
        }),obtained);
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

      if (rnd.nextInt(100) > 1)
      {
        int numA = rnd.nextInt(10000)-5000, numB=rnd.nextInt(10000)-5000;
        ErlangRunner rn = new ErlangRunner(r.traceRunnerNode);rn.forceReady();// only using default instances
        OtpErlangTuple response = (OtpErlangTuple)rn.call(new OtpErlangObject[]{new OtpErlangAtom("echo"),
            new OtpErlangList(new OtpErlangObject[]{ new OtpErlangAtom(dataHead), new OtpErlangInt(numA), new OtpErlangInt(numB),new OtpErlangAtom(dataC)})},
            0);

        Assert.assertEquals(dataHead,((OtpErlangAtom)response.elementAt(0)).atomValue());
        Assert.assertEquals(processNames[runnerNumber],((OtpErlangAtom)response.elementAt(1)).atomValue());
        OtpErlangObject [] list = ((OtpErlangList)response.elementAt(2)).elements();
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

      ErlangRunner r = runners[runnerNumber];
      if (rnd.nextInt(100) > 1)
      {
        int numA = rnd.nextInt(10000)-5000, numB=rnd.nextInt(10000)-5000;
        OtpErlangTuple response = (OtpErlangTuple)r.call(new OtpErlangObject[]{new OtpErlangAtom("echo"),
            new OtpErlangList(new OtpErlangObject[]{ new OtpErlangAtom(dataHead), new OtpErlangInt(numA), new OtpErlangInt(numB),new OtpErlangAtom(dataC)})},
            0);

        Assert.assertEquals(dataHead,((OtpErlangAtom)response.elementAt(0)).atomValue());
        Assert.assertEquals(processNames[runnerNumber],((OtpErlangAtom)response.elementAt(1)).atomValue());
        OtpErlangObject [] list = ((OtpErlangList)response.elementAt(2)).elements();
View Full Code Here
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.