コード例 #1
0
 @Given("^I get the statisticaltest \"(.*)\"")
 public void I_get_the_statisticaltest(String statisticaltestId) throws AuthenticationException {
   JSONObject resource = BigMLClient.getInstance().getStatisticalTest(statisticaltestId);
   Integer code = (Integer) resource.get("code");
   assertEquals(AbstractResource.HTTP_OK, code.intValue());
   context.statisticaltest = (JSONObject) resource.get("object");
 }
コード例 #2
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);
  }
コード例 #3
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);
  }