Examples of OtpErlangInt


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

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

Examples of com.ericsson.otp.erlang.OtpErlangInt

      // The above loads a module, this one gets that module and subsequently updates its alphabet.
      ErlangModule mod = ErlangModule.findModule(evalConf.config.getErlangModuleName());
     
      final ErlangLabel initLabel = mod.behaviour.convertErlToMod(AbstractLearnerGraph.generateNewLabel("{"+ErlangLabel.missingFunction+",'init','AnyWibble','ok'}", evalConf.config)),
      labelLock = mod.behaviour.convertErlToMod(AbstractLearnerGraph.generateNewLabel("{"+ErlangLabel.missingFunction+",'call','lock',{'ok','locked'}}", evalConf.config));
    final ErlangLabel labelInvalidRead = new ErlangLabel(labelLock.function,labelLock.callName,labelLock.input,new OtpErlangInt(88));
    statechum.Helper.checkForCorrectException(new statechum.Helper.whatToRun() {
      public @Override void run() {
        learner.askErlang(Arrays.asList(new Label[]{initLabel,labelLock,labelInvalidRead}));
      }},IllegalArgumentException.class,"does not belong");
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangInt

            value = new OtpErlangDouble(
                ((Double) outcome).doubleValue());
          else if (outcome.getClass().equals(String.class))
            value = new OtpErlangAtom((String) outcome);
          else if (outcome.getClass().equals(Integer.class))
            value = new OtpErlangInt(((Integer) outcome).intValue());
          else if (outcome.getClass().equals(Long.class))
            value = new OtpErlangLong(((Long) outcome).longValue());
          else
            value = new OtpErlangAtom(outcome.toString());
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(ErlangRunner.getRunner().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(ErlangRunner.getRunner().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

                    val += "" + specbuf.substring(0, 1);
                    specbuf.delete(0, 1);
                }
                int upperValue = Integer.parseInt(val);
                sig = new IntSignature(new OtpErlangList(),new OtpErlangList(new OtpErlangObject[]{
                    new OtpErlangInt(lowerValue),new OtpErlangInt(upperValue)
                }));

            } else {
                sig = new LiteralSignature(val);
            }
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.