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

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


        bug.setState(item.getString("status"));
        bug.setStateDate(item.getLong("statusDate"));
        dataService.addBug(bug);
      } else if (json.has("test")) {
        item = json.getJSONObject("test");
        TestCase test = new TestCase();
        test.setParentProjectId(item.getLong("projectId"));
        test.setExternalId(item.getLong("testId"));
        test.setTitle(item.getString("title"));
        test.setTags(Sets.newHashSet(StringUtil.csvToList(item.getString("tags"))));
        test.setTestCaseUrl(item.getString("url"));
        test.setState(item.getString("result"));
        test.setStateDate(item.getLong("resultDate"));
        dataService.addTestCase(test);
      } else if (json.has("checkin")) {
        item = json.getJSONObject("checkin");
        Checkin checkin = new Checkin();
        checkin.setParentProjectId(item.getLong("projectId"));
View Full Code Here


    checkin2.setSummary("Search engine optimizations");
    dataService.addCheckin(checkin2);

    // Tests.
    LOG.info("Creating tests.");
    TestCase testcase1 = new TestCase();
    testcase1.setParentProjectId(projectId);
    testcase1.setExternalId(1042L);
    testcase1.setTestCaseUrl("http://example/test/1042");
    testcase1.setTitle("Search for 'dogfood'");
    testcase1.setTargetAttributeId(attributes.get(1).getAttributeId());
    testcase1.setTargetComponentId(components.get(1).getComponentId());
    dataService.addTestCase(testcase1);

    TestCase testcase2 = new TestCase();
    testcase2.setParentProjectId(projectId);
    testcase2.setExternalId(1043L);
    testcase2.setTestCaseUrl("http://example/test/1043");
    testcase2.setTitle("Post an item to your favorite social network via sharing functions");
    testcase2.setTargetCapabilityId(capabilities.get(3).getCapabilityId());
    dataService.addTestCase(testcase2);

    for (int i = 0; i < 6; i++) {
      TestCase testcase3 = new TestCase();
      testcase3.setParentProjectId(projectId);
      testcase3.setExternalId(Long.valueOf(1044 + i * 100));
      testcase3.setTestCaseUrl("http://example/test/" + i);
      testcase3.setTitle("Some Random Automated Test " + i);
      testcase3.setState("Passed");
      testcase3.setStateDate(System.currentTimeMillis() - (84000000L * i));
      testcase3.setTargetCapabilityId(capabilities.get(0).getCapabilityId());
      dataService.addTestCase(testcase3);
    }

    for (int i = 0; i < 4; i++) {
      TestCase testcase4 = new TestCase();
      testcase4.setParentProjectId(projectId);
      testcase4.setExternalId(Long.valueOf(1045 + i * 100));
      testcase4.setTestCaseUrl("http://example/test/" + i);
      testcase4.setTitle("Some Random Manual Test " + i);
      testcase4.setState("Failed");
      testcase4.setStateDate(System.currentTimeMillis() - (84000000L * i));
      testcase4.setTargetCapabilityId(capabilities.get(0).getCapabilityId());
      dataService.addTestCase(testcase4);
    }

    for (int i = 0; i < 2; i++) {
      TestCase testcase5 = new TestCase();
      testcase5.setParentProjectId(projectId);
      testcase5.setExternalId(Long.valueOf(1046 + i * 100));
      testcase5.setTestCaseUrl("http://example/test/" + i);
      testcase5.setTitle("Test We Never Run " + i);
      testcase5.setTargetCapabilityId(capabilities.get(0).getCapabilityId());
      dataService.addTestCase(testcase5);
    }

    LOG.info("Done.  Returning created project.");
    return project;
View Full Code Here

        @Override
        public void onClick(ClickEvent event) {
          long id = Long.parseLong((options.getValue(options.getSelectedIndex())));
          presenter.assignTestCaseToCapability(capability.getCapabilityId(), id);
          disclosure.setOpen(false);
          TestCase test = getTestCaseById(id);
          test.setTargetCapabilityId(capability.getCapabilityId());
          refresh();
        }
      });
    addForm.add(button);
    disclosure.setAnimationEnabled(true);
View Full Code Here

    testGrid.resize(capabilityTests.size() + 1, 1);
    testGrid.setWidget(0, 0, buildTestHeaderWidget("Recent Test Activity", "add test"));

    int passed = 0, failed = 0, notRun = 0;
    for (int i = 0; i < capabilityTests.size(); i++) {
      TestCase test = capabilityTests.get(i);
      HorizontalPanel panel = new HorizontalPanel();
      panel.add(getTestStateImage(test.getState()));
      Anchor anchor = new Anchor(test.getLinkText(), test.getLinkUrl());
      anchor.setTarget("_blank");
      panel.add(anchor);
      Label statusLabel = new Label();

      int state = getTestState(test.getState());
      if (state < 0) {
        statusLabel.setText(" - failed " + getDateText(test.getStateDate()));
        failed++;
      } else if (state > 0) {
        statusLabel.setText(" - passed " + getDateText(test.getStateDate()));
        passed++;
      } else {
        statusLabel.setText(" - no result");
        notRun++;
      }
View Full Code Here

TOP

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

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.