コード例 #1
0
  @Given("^I create a statisticaltest from a dataset$")
  public void I_create_a_statisticaltest_from_a_dataset() throws AuthenticationException {
    String datasetId = (String) context.dataset.get("resource");

    JSONObject args = new JSONObject();
    args.put("tags", Arrays.asList("unitTest"));

    JSONObject resource = BigMLClient.getInstance().createStatisticalTest(datasetId, args, 5, null);
    context.status = (Integer) resource.get("code");
    context.location = (String) resource.get("location");
    context.statisticaltest = (JSONObject) resource.get("object");
    commonSteps.the_resource_has_been_created_with_status(context.status);
  }
コード例 #2
0
  @Given("^I update the statisticaltest name to \"([^\"]*)\"$")
  public void I_update_the_statisticaltest_name_to(String statisticaltestName) throws Throwable {
    String statisticaltestId = (String) context.statisticaltest.get("resource");

    JSONObject args = new JSONObject();
    args.put("name", statisticaltestName);

    JSONObject resource =
        BigMLClient.getInstance().updateStatisticalTest(statisticaltestId, args.toString());
    context.status = (Integer) resource.get("code");
    context.location = (String) resource.get("location");
    context.statisticaltest = (JSONObject) resource.get("object");
    commonSteps.the_resource_has_been_updated_with_status(context.status);
  }