Package org.dtk.analysis.script.node

Examples of org.dtk.analysis.script.node.ObjectLiteral


    assertValues(lit, getPrepopulatedMap("key", 0.0, "an", 1.0));
  }
 
  @Test
  public void detectsArrayValuesInObjectLiteral() throws InvalidLiteralNode
    ObjectLiteral lit = getLiteralNode("{ key: []}");           
    assertEquals(Arrays.asList("key"), lit.getKeys());
   
    Object arrayLit = lit.getValue("key")
    assertTrue(arrayLit instanceof ArrayLiteral);
   
    assertEquals(Collections.EMPTY_LIST, ((ArrayLiteral) arrayLit).getValueList());
 
View Full Code Here


    assertEquals(Collections.EMPTY_LIST, ((ArrayLiteral) arrayLit).getValueList());
 
 
  @Test
  public void detectsInnerObjLiteralValuesInObjectLiteral() throws InvalidLiteralNode
    ObjectLiteral lit = getLiteralNode("{ key: { num: 1, str: 'str', b: true }}");           
    assertEquals(Arrays.asList("key"), lit.getKeys());   
    Object innerObjLit = lit.getValue("key")
    assertTrue(innerObjLit instanceof ObjectLiteral);
   
    assertValues((ObjectLiteral) innerObjLit, getPrepopulatedMap("num", 1.0, "str", "str", "b", true));
  }     
View Full Code Here

  }     
 
  @Test(expected=InvalidLiteralNode.class)
  public void throwsExceptionWhenPassingNonLiteralNode() throws InvalidLiteralNode {         
    Node node = new Node(Token.SCRIPT);
    ObjectLiteral lit = new ObjectLiteral(node);   
  }
View Full Code Here

TOP

Related Classes of org.dtk.analysis.script.node.ObjectLiteral

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.