Examples of optInt()


Examples of org.json.JSONObject.optInt()

  }

  public RemoteWebElement findElementByCSSSelector(String selector) {
    JSONObject response = inspector.sendCommand(DOM.querySelector(nodeId, selector));
    // TODO freynaud
    NodeId id = new NodeId(response.optInt("nodeId"));
    if (!id.exist()) {
      throw new NoSuchElementException("no element matching " + selector);
    }
    RemoteWebElement res = new RemoteWebElement(id, inspector);
    return res;
View Full Code Here

Examples of org.json.JSONObject.optInt()

        assertNotNull(converted);

        // with no embedded types the key (which is a vertex) simply serializes out to an id
        // {"result":{"1":1000},"code":200,"requestId":"2d62161b-9544-4f39-af44-62ec49f9a595","type":0}
        assertEquals(1000, converted.optInt("1"));
    }

    @Test
    public void deserializeRequestNicelyWithNoArgs() throws Exception {
        final UUID request = UUID.fromString("011CFEE9-F640-4844-AC93-034448AC0E80");
View Full Code Here

Examples of org.json.JSONObject.optInt()

    if (serviceType != null && serviceType.equalsIgnoreCase(INSERT_GOAL_DETAILS)) {
      logger.debug("Adding the details of the goal node: ");
      List<GoalKpi> kpisList = new ArrayList<GoalKpi>();
      JSONObject JSONGoalDetails =  getAttributeAsJSONObject("goalDetails");
      JSONObject goalNode =  JSONGoalDetails.optJSONObject("goalNode");
      Integer goalNodeId =  goalNode.optInt("id");
      String goalDesc =  goalNode.optString("goalDesc");
      String goalName =  goalNode.optString("name");
      logger.debug(goalNode);
      GoalNode gn = new GoalNode(goalName, "", goalDesc, null, null);
      gn.setId(goalNodeId);
View Full Code Here

Examples of org.slim3.repackaged.org.json.JSONObject.optInt()

    }

    @Test
    public void optInt() throws Exception {
        JSONObject j = new JSONObject("{str: \"hello\", int: 3}");
        Assert.assertEquals(0, j.optInt("v"));
        Assert.assertEquals(0, j.optInt("str"));
        Assert.assertEquals("hello", j.optString("str"));
        Assert.assertEquals("3", j.optString("int"));
    }
View Full Code Here

Examples of org.slim3.repackaged.org.json.JSONObject.optInt()

    @Test
    public void optInt() throws Exception {
        JSONObject j = new JSONObject("{str: \"hello\", int: 3}");
        Assert.assertEquals(0, j.optInt("v"));
        Assert.assertEquals(0, j.optInt("str"));
        Assert.assertEquals("hello", j.optString("str"));
        Assert.assertEquals("3", j.optString("int"));
    }

    @Test
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.