Package com.google.testing.testify.risk.frontend.model

Examples of com.google.testing.testify.risk.frontend.model.DataRequest


  public void handleAddDataRequestButtonClicked(ClickEvent event) {
    if (presenter != null) {
      DataSource source = getSelectedSource();

      if (source != null) {
        DataRequest newRequest = new DataRequest();
        newRequest.setDataSourceName(source.getName());
        if (source.getParameters().size() < 1) {
          newRequest.setCustomName(dataSourceTextBox.getText());
        }
        presenter.addDataRequest(newRequest);
      }
    }
  }
View Full Code Here


    ServletUtils.requireAccess(userService.hasEditAccess(request.getParentProjectId()));

    log.info("Removing DataRequest: " + request.getRequestId().toString());
    PersistenceManager pm = pmf.getPersistenceManager();
    try {
      DataRequest requestToDelete = pm.getObjectById(DataRequest.class, request.getRequestId());
      pm.deletePersistent(requestToDelete);
    } finally {
      pm.close();
    }
  }
View Full Code Here

    Matcher matcher = pattern.matcher(result);
    assertTrue(matcher.matches());
  }

  public void testMultipleProjectsSameDataSource() {
    DataRequest project1Request = new DataRequest();
    project1Request.setParentProjectId(1L);
    project1Request.setDataSourceName("GoogleCodeBugs");

    DataRequest project2Request = new DataRequest();
    project2Request.setParentProjectId(2L);
    project2Request.setDataSourceName("GoogleCodeBugs");

    List<DataRequest> requests = Lists.newArrayList();
    requests.add(project1Request);
    requests.add(project2Request);
View Full Code Here

    }
  }

  public void testMultipleRequestsSameProject() {
    // Add two data requests to the same project. Both requesting from the same data source.
    DataRequest project1Request = new DataRequest();
    project1Request.setParentProjectId(1L);
    project1Request.setDataSourceName("GoogleCodeBugs");
    project1Request.getDataRequestOptions().add(new DataRequestOption("Alpha", "1111"));
    project1Request.getDataRequestOptions().add(new DataRequestOption("Beta", "3333"));

    DataRequest project2Request = new DataRequest();
    project2Request.setParentProjectId(1L);
    project2Request.setDataSourceName("GoogleCodeBugs");
    project2Request.getDataRequestOptions().add(new DataRequestOption("Alpha", "2222"));
    project2Request.getDataRequestOptions().add(new DataRequestOption("Beta", "4444"));

    List<DataRequest> requests = Lists.newArrayList();
    requests.add(project1Request);
    requests.add(project2Request);
View Full Code Here

    List<String> actual = Lists.newArrayList((matcher.group(1)).split("</.*?>"));
    assertContentsAnyOrder("Contents don't match", actual, expected);
  }

  public void testDataRequestFields() {
    DataRequest request = new DataRequest();
    assertEquals(null, request.getRequestId());
    request.setRequestId(123L);
    assertEquals(123, request.getRequestId().longValue());
    assertEquals(null, request.getCustomName());
    request.setCustomName("test name");
    assertEquals("test name", request.getCustomName());
    assertEquals(0, request.getDataRequestOptions().size());
    DataRequestOption option = new DataRequestOption();
    option.setName("name2");
    option.setValue("value2");
    option.setId("drq1");
    option.setDataRequest(request);
    request.setDataRequestOptions(Lists.newArrayList(option,
        new DataRequestOption("name1", "value1")));
    assertEquals(2, request.getDataRequestOptions().size());
    assertTrue(request.getDataRequestOptions().contains(option));
    assertEquals("drq1", option.getId());
    assertEquals("name2", option.getName());
    assertEquals("value2", option.getValue());
    assertEquals(request, option.getDataRequest());
  }
View Full Code Here

TOP

Related Classes of com.google.testing.testify.risk.frontend.model.DataRequest

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.