public TopologyTestRunCase addOrUpdateTopologyTestRunCase(Long id, TopologyTestRunCase testCase) { testCase.setId(id); testCase.setTimestamp(System.currentTimeMillis()); dao.addOrUpdate(testCase); return testCase; }
@PUT @Path("/topologies/{topologyId}/testcases/{testCaseId}") public Response addOrUpdateTestRunCase(@PathParam("topologyId") Long topologyId, @PathParam("testCaseId") Long testCaseId, TopologyTestRunCase testRunCase, @Context SecurityContext securityContext) { SecurityUtil.checkRoleOrPermissions(authorizer, securityContext, Roles.ROLE_TOPOLOGY_USER, Topology.NAMESPACE, topologyId, WRITE); testRunCase.setTopologyId(topologyId); testRunCase.setId(testCaseId); TopologyTestRunCase updatedCase = catalogService.addOrUpdateTopologyTestRunCase(topologyId, testRunCase); return WSUtils.respondEntity(updatedCase, OK); }
private TopologyTestRunCase addTopologyTestRunCase(Long topologyId, Long newVersionId, TopologyTestRunCase testRunCase) { // unlike topology related entities, just issues a new id testRunCase.setId(null); testRunCase.setTopologyId(topologyId); testRunCase.setVersionId(newVersionId); return addTopologyTestRunCase(testRunCase); }
public TopologyTestRunCase addTopologyTestRunCase(TopologyTestRunCase testCase) { if (testCase.getId() == null) { testCase.setId(dao.nextId(TopologyTestRunCase.NAMESPACE)); } testCase.setTimestamp(System.currentTimeMillis()); dao.add(testCase); return testCase; }
public TopologyTestRunCase getTopologyTestRunCase(Long topologyId, Long testcaseId) { TopologyTestRunCase testCase = new TopologyTestRunCase(); testCase.setId(testcaseId); TopologyTestRunCase found = dao.get(new StorableKey(TopologyTestRunCase.NAMESPACE, testCase.getPrimaryKey())); if (found == null || !found.getTopologyId().equals(topologyId)) { return null; } return found; }
public TopologyTestRunCase(TopologyTestRunCase other) { if (other != null) { setId(other.getId()); setName(other.getName()); setTopologyId(other.getTopologyId()); setVersionId(other.getVersionId()); setTimestamp(other.getTimestamp()); } }