Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangAtom.atomValue()


  @Test
  public void testParseUnquotedAtom1a()
  {
    String text = "eatom";
    OtpErlangAtom atom = (OtpErlangAtom)ErlangLabel.parseText(text);
    Assert.assertEquals(text.trim(),atom.atomValue());
  }
 
  @Test
  public void testParseUnquotedAtom1b()
  {
View Full Code Here


  @Test
  public void testParseUnquotedAtom1b()
  {
    String text = "eateom";
    OtpErlangAtom atom = (OtpErlangAtom)ErlangLabel.parseText(text);
    Assert.assertEquals(text.trim(),atom.atomValue());
  }
 
  @Test
  public void testParseUnquotedAtom1c()
  {
View Full Code Here

  @Test
  public void testParseUnquotedAtom1c()
  {
    String text = "eat...om";
    OtpErlangAtom atom = (OtpErlangAtom)ErlangLabel.parseText(text);
    Assert.assertEquals(text.trim(),atom.atomValue());
  }
 
  @Test
  public void testParseUnquotedAtom2()
  {
View Full Code Here

  @Test
  public void testParseUnquotedAtom2()
  {
    String text = " atom ";
    OtpErlangAtom atom = (OtpErlangAtom)ErlangLabel.parseText(text);
    Assert.assertEquals(text.trim(),atom.atomValue());
  }
  @Test
  public void testParseUnquotedAtom3()
  {
    String text = "atom ";
View Full Code Here

  @Test
  public void testParseUnquotedAtom3()
  {
    String text = "atom ";
    OtpErlangAtom atom = (OtpErlangAtom)ErlangLabel.parseText(text);
    Assert.assertEquals(text.trim(),atom.atomValue());
  }
 
  /** Invalid characters after backslash. */
  @Test
  public void testParseUnquotedAtomFail1()
View Full Code Here

    final String text = " aa junk";
    checkForCorrectException(new whatToRun() { public @Override void run() {
      ErlangLabel.parseText(text);
    }},IllegalArgumentException.class,"unexpected characters at the end of string to parse");
    OtpErlangAtom atom = (OtpErlangAtom)ErlangLabel.parseFirstTermInText(ErlangLabel.buildLexer(text));
    Assert.assertEquals("aa",atom.atomValue());
  }
 
  /** Atom cannot begin with a dot. */
  @Test
  public void testParseUnquotedAtomFail6()
View Full Code Here

  @Test
  public void testParse1c()
  {
    String text = " \'this \\'is an\\\\  \"atom\'   ";
    OtpErlangAtom atom = (OtpErlangAtom)ErlangLabel.parseText(text);
    Assert.assertEquals("this 'is an\\  \"atom",atom.atomValue());
    checkResponse(runner, text.trim(),ErlangLabel.dumpErlangObject(atom));
  }
 
  /** Quoted characters. */
  @Test
 
View Full Code Here

        if (entry.arity() != 2)
          throw new IllegalArgumentException("invalid trace: more than a pair of pos/neg and data");
       
        boolean positive = false;
        OtpErlangAtom traceType = (OtpErlangAtom)entry.elementAt(0);
        if (traceType.atomValue().equals("pos"))
          positive = true;
        else
          if (traceType.atomValue().equals("neg"))
            positive = false;
          else
View Full Code Here

        boolean positive = false;
        OtpErlangAtom traceType = (OtpErlangAtom)entry.elementAt(0);
        if (traceType.atomValue().equals("pos"))
          positive = true;
        else
          if (traceType.atomValue().equals("neg"))
            positive = false;
          else
            throw new IllegalArgumentException("invalid trace: got "+entry.elementAt(0)+" instead of pos/neg");
       
        OtpErlangList traceData = (OtpErlangList)entry.elementAt(1);
View Full Code Here

      {
        OtpErlangTuple transition = (OtpErlangTuple) transitionObj;
        if (transition.arity() != 3)
          throw new IllegalArgumentException("expected 3 components in transition "+transition);
        OtpErlangAtom from = (OtpErlangAtom)transition.elementAt(0),label = (OtpErlangAtom)transition.elementAt(1),to = (OtpErlangAtom)transition.elementAt(2);
        CmpVertex fromState = gr.findVertex(VertexID.parseID(from.atomValue())), toState = gr.findVertex(VertexID.parseID(to.atomValue()));
        if (fromState == null)
          if (!checkStates)
          {
            String state = from.atomValue();if (state.isEmpty()) throw new IllegalArgumentException("empty source state");
            fromState = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID( state), gr.config );
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.