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;