Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangList.arity()


    OtpErlangTuple knownScores = scoresMap.get(name);Assert.assertNotNull("missing entry for test"+ name,knownScores);
    Assert.assertEquals(knownScores.arity(),value.arity());
    for(int i=0;i<knownScores.arity();++i)
    {
      OtpErlangList listA=(OtpErlangList)knownScores.elementAt(i), listB= (OtpErlangList)value.elementAt(i);
      Assert.assertEquals(listA.arity(),listB.arity());
      for(int elem=0;elem<listA.arity();++elem)
        Assert.assertEquals(((OtpErlangDouble)listA.elementAt(elem)).doubleValue(),((OtpErlangDouble)listB.elementAt(elem)).doubleValue(),Configuration.fpAccuracy);
    }
  }
}
View Full Code Here


    Assert.assertEquals(knownScores.arity(),value.arity());
    for(int i=0;i<knownScores.arity();++i)
    {
      OtpErlangList listA=(OtpErlangList)knownScores.elementAt(i), listB= (OtpErlangList)value.elementAt(i);
      Assert.assertEquals(listA.arity(),listB.arity());
      for(int elem=0;elem<listA.arity();++elem)
        Assert.assertEquals(((OtpErlangDouble)listA.elementAt(elem)).doubleValue(),((OtpErlangDouble)listB.elementAt(elem)).doubleValue(),Configuration.fpAccuracy);
    }
  }
}
View Full Code Here

      }
      catch(Exception ex)
      {
        Helper.throwUnchecked("Failed to parse the structure returned from statechum-typer", ex);
      }
    if (attributes.arity() != 0) throw new IllegalArgumentException("FuncSignature does not accept attributes");
    lineNumber=extractedLineNumber;moduleName=extractedModuleName;funcName=extractedFuncName;

    if (otpConverter == null)
    {
      arity = ArgList.arity();assert arity == knownArity;
View Full Code Here

      response = ErlangRunner.getRunner().call(otpArgs,"Could not run typer for the second time");     
    }
    progress.next();// 6

    OtpErlangList analysisResults = (OtpErlangList) response.elementAt(1);
    Assert.assertEquals(1, analysisResults.arity());
    OtpErlangTuple fileDetails = (OtpErlangTuple) analysisResults.elementAt(0);
    OtpErlangList typeInformation = (OtpErlangList) fileDetails.elementAt(3);
    for (int i = 0; i < typeInformation.arity(); ++i) {
      //System.out.print("\n" + typeInformation.elementAt(i).toString());
      OtpErlangTuple functionDescr = (OtpErlangTuple) typeInformation.elementAt(i);
View Full Code Here

    OtpErlangList analysisResults = (OtpErlangList) response.elementAt(1);
    Assert.assertEquals(1, analysisResults.arity());
    OtpErlangTuple fileDetails = (OtpErlangTuple) analysisResults.elementAt(0);
    OtpErlangList typeInformation = (OtpErlangList) fileDetails.elementAt(3);
    for (int i = 0; i < typeInformation.arity(); ++i) {
      //System.out.print("\n" + typeInformation.elementAt(i).toString());
      OtpErlangTuple functionDescr = (OtpErlangTuple) typeInformation.elementAt(i);
      if (functionDescr.arity() > 3)
      {
        FuncSignature s = new FuncSignature(config,typeInformation.elementAt(i), null);
View Full Code Here

          tail = Signature.stringToList(tail);
       
        if (tail instanceof OtpErlangList)
        {// merge this into the current list.
          OtpErlangList tailAsList = (OtpErlangList)tail;
          for(int i=0;i<tailAsList.arity();++i)
            listComponents.add(tailAsList.elementAt(i));
          tail = tailAsList.getLastTail();
        }
      }
     
View Full Code Here

      if (name instanceof OtpErlangAtom && ((OtpErlangAtom) name).atomValue().equals("behaviour")) {// found the OTP behaviour attribute
        OtpErlangObject value = tuple.elementAt(1);
        if (value instanceof OtpErlangList) // list of behaviours
        {
          OtpErlangList behList = (OtpErlangList)value;
          for(int i=0;i<behList.arity();++i)
            if (behList.elementAt(i) instanceof OtpErlangAtom)
            {
              String bstring = ((OtpErlangAtom) (behList.elementAt(i))).atomValue();
              if (bstring.startsWith("gen_server")) {
                behaviour = new OTPGenServerBehaviour(mod);
View Full Code Here

      }
      catch(Exception ex)
      {
        Helper.throwUnchecked("Failed to parse the structure returned from statechum-typer", ex);
      }
    if (attributes.arity() != 0) throw new IllegalArgumentException("FuncSignature does not accept attributes");
    lineNumber=extractedLineNumber;moduleName=extractedModuleName;funcName=extractedFuncName;

    if (otpConverter == null)
    {
      arity = ArgList.arity();assert arity == knownArity;
View Full Code Here

     */
    public static void setStateNamesToBeIgnored(LayoutOptions options, OtpErlangObject stateNamesAsObject)
    {
     
      OtpErlangList statesToBeIgnored = (OtpErlangList)stateNamesAsObject;
      if (statesToBeIgnored.arity() > 0 && options != null)
      {
        if (options.ignoredStates == null)
          options.ignoredStates = new TreeSet<String>();
        for(OtpErlangObject obj:statesToBeIgnored)
          options.ignoredStates.add( ((OtpErlangAtom)obj).atomValue() );
View Full Code Here

    assertEquals(testArg.length, testResult.length);
    for (int i = 0; i < testArg.length; i++) {
      assertEquals(testArg[i], testResult[i]);
    }
    OtpErlangList received = (OtpErlangList) mboxListener.getMsg();
    assertEquals(testArg.length, received.arity());
    for (int i = 0; i < testArg.length; i++) {
      assertEquals(testArg[i], ((OtpErlangString) received.elementAt(i))
          .stringValue());
    }
  }
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.