target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test(enabled = true) private void test_IsNonHA() { plugin = new PlatformHADRCrawlerPlugin(); Platform platform = new Platform(); List<String> activeClouds = new ArrayList<String>(); activeClouds.add("dc1-TestCloud1"); platform.setActiveClouds(activeClouds); assertEquals(plugin.IsDR(platform), "Non-DR"); } | public String IsDR(Platform platform) { String activeCloudsListForPlatform = platform.getActiveClouds().toString().toLowerCase(); log.info("activeCloudsListForPlatform: " + activeCloudsListForPlatform.toString()); int i = 0; for (String dataCenter : dataCentersArr) { if (activeCloudsListForPlatform.contains(dataCenter)... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String IsDR(Platform platform) { String activeCloudsListForPlatform = platform.getActiveClouds().toString().toLowerCase(); log.info("activeCloudsListForPlatform: " + activeCloudsListForPlatform.toString()); int i = 0; for (String dataCenter : dataCentersA... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String IsDR(Platform platform) { String activeCloudsListForPlatform = platform.getActiveClouds().toString().toLowerCase(); log.info("activeCloudsListForPlatform: " + activeCloudsListForPlatform.toString()); int i = 0; for (String dataCenter : dataCentersA... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String IsDR(Platform platform) { String activeCloudsListForPlatform = platform.getActiveClouds().toString().toLowerCase(); log.info("activeCloudsListForPlatform: " + activeCloudsListForPlatform.toString()); int i = 0; for (String dataCenter : dataCentersA... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String IsDR(Platform platform) { String activeCloudsListForPlatform = platform.getActiveClouds().toString().toLowerCase(); log.info("activeCloudsListForPlatform: " + activeCloudsListForPlatform.toString()); int i = 0; for (String dataCenter : dataCentersA... |
@Test public void testCreateRelease() throws Exception { CmsRelease release = new CmsRelease(); release.setReleaseId(1); mapper.createRelease(release); assertEquals(mapper.getReleaseById(1), release); } | @Override public void createRelease(CmsRelease release) { this.release = release; } | InMemoryDJMapper implements DJMapper { @Override public void createRelease(CmsRelease release) { this.release = release; } } | InMemoryDJMapper implements DJMapper { @Override public void createRelease(CmsRelease release) { this.release = release; } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void createRelease(CmsRelease release) { this.release = release; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer ge... | InMemoryDJMapper implements DJMapper { @Override public void createRelease(CmsRelease release) { this.release = release; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer ge... |
@Test public void testBrushReleaseExecOrder() throws Exception { } | @Override public void brushReleaseExecOrder(long releaseId) { List<CmsRfcCI> orderedCIs = cis.values().stream() .sorted(Comparator.comparingInt(ci -> ci.getExecOrder())) .collect(Collectors.toList()); int lastExecOrder = 0; int newExecOrder = 0; for (CmsRfcCI ci : orderedCIs) { if (ci.getExecOrder() > lastExecOrder) { ... | InMemoryDJMapper implements DJMapper { @Override public void brushReleaseExecOrder(long releaseId) { List<CmsRfcCI> orderedCIs = cis.values().stream() .sorted(Comparator.comparingInt(ci -> ci.getExecOrder())) .collect(Collectors.toList()); int lastExecOrder = 0; int newExecOrder = 0; for (CmsRfcCI ci : orderedCIs) { if... | InMemoryDJMapper implements DJMapper { @Override public void brushReleaseExecOrder(long releaseId) { List<CmsRfcCI> orderedCIs = cis.values().stream() .sorted(Comparator.comparingInt(ci -> ci.getExecOrder())) .collect(Collectors.toList()); int lastExecOrder = 0; int newExecOrder = 0; for (CmsRfcCI ci : orderedCIs) { if... | InMemoryDJMapper implements DJMapper { @Override public void brushReleaseExecOrder(long releaseId) { List<CmsRfcCI> orderedCIs = cis.values().stream() .sorted(Comparator.comparingInt(ci -> ci.getExecOrder())) .collect(Collectors.toList()); int lastExecOrder = 0; int newExecOrder = 0; for (CmsRfcCI ci : orderedCIs) { if... | InMemoryDJMapper implements DJMapper { @Override public void brushReleaseExecOrder(long releaseId) { List<CmsRfcCI> orderedCIs = cis.values().stream() .sorted(Comparator.comparingInt(ci -> ci.getExecOrder())) .collect(Collectors.toList()); int lastExecOrder = 0; int newExecOrder = 0; for (CmsRfcCI ci : orderedCIs) { if... |
@Test public void testGetReleaseById() throws Exception { assertNull(mapper.getReleaseById(1)); CmsRelease release = new CmsRelease(); release.setReleaseId(1); mapper.createRelease(release); assertEquals(mapper.getReleaseById(1), release); } | @Override public CmsRelease getReleaseById(long releaseId) { return release; } | InMemoryDJMapper implements DJMapper { @Override public CmsRelease getReleaseById(long releaseId) { return release; } } | InMemoryDJMapper implements DJMapper { @Override public CmsRelease getReleaseById(long releaseId) { return release; } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public CmsRelease getReleaseById(long releaseId) { return release; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getRele... | InMemoryDJMapper implements DJMapper { @Override public CmsRelease getReleaseById(long releaseId) { return release; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getRele... |
@Test public void testGetReleaseBy3() throws Exception { assertEquals(mapper.getReleaseBy3("", "", ""), new ArrayList()); } | @Override public List<CmsRelease> getReleaseBy3(String nsPath, String releaseName, String releaseState) { return new ArrayList<>(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRelease> getReleaseBy3(String nsPath, String releaseName, String releaseState) { return new ArrayList<>(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRelease> getReleaseBy3(String nsPath, String releaseName, String releaseState) { return new ArrayList<>(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRelease> getReleaseBy3(String nsPath, String releaseName, String releaseState) { return new ArrayList<>(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); ... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRelease> getReleaseBy3(String nsPath, String releaseName, String releaseState) { return new ArrayList<>(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); ... |
@Test public void testUpdateRelease() throws Exception { assertNull(mapper.getReleaseById(1)); CmsRelease release = new CmsRelease(); release.setReleaseId(1); mapper.createRelease(release); assertEquals(mapper.getReleaseById(1), release); CmsRelease release2 = new CmsRelease(); release2.setReleaseId(2); mapper.updateRe... | @Override public int updateRelease(CmsRelease release) { this.release = release; return release.getReleaseStateId(); } | InMemoryDJMapper implements DJMapper { @Override public int updateRelease(CmsRelease release) { this.release = release; return release.getReleaseStateId(); } } | InMemoryDJMapper implements DJMapper { @Override public int updateRelease(CmsRelease release) { this.release = release; return release.getReleaseStateId(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public int updateRelease(CmsRelease release) { this.release = release; return release.getReleaseStateId(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long ... | InMemoryDJMapper implements DJMapper { @Override public int updateRelease(CmsRelease release) { this.release = release; return release.getReleaseStateId(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long ... |
@Test public void testDeleteRelease() throws Exception { } | @Override public int deleteRelease(long releaseId) { return 0; } | InMemoryDJMapper implements DJMapper { @Override public int deleteRelease(long releaseId) { return 0; } } | InMemoryDJMapper implements DJMapper { @Override public int deleteRelease(long releaseId) { return 0; } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public int deleteRelease(long releaseId) { return 0; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(Str... | InMemoryDJMapper implements DJMapper { @Override public int deleteRelease(long releaseId) { return 0; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(Str... |
@Test public void testCommitRelease() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.commitRelease(1, true, 1, true, "", "")); } | @Override public void commitRelease(long releaseId, Boolean setDfValue, Integer newCiState, boolean delete4real, String userId, String desc) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public void commitRelease(long releaseId, Boolean setDfValue, Integer newCiState, boolean delete4real, String userId, String desc) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public void commitRelease(long releaseId, Boolean setDfValue, Integer newCiState, boolean delete4real, String userId, String desc) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void commitRelease(long releaseId, Boolean setDfValue, Integer newCiState, boolean delete4real, String userId, String desc) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); C... | InMemoryDJMapper implements DJMapper { @Override public void commitRelease(long releaseId, Boolean setDfValue, Integer newCiState, boolean delete4real, String userId, String desc) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); C... |
@Test public void testCreateRfcCI() throws Exception { assertEquals(mapper.getCis().size(), 0); CmsRfcCI rfcCi = new CmsRfcCI(); rfcCi.setRfcId(1); mapper.createRfcCI(rfcCi); assertEquals(mapper.getCis().size(), 1); assertEquals(mapper.getCis().get(1L), rfcCi); } | @Override public void createRfcCI(CmsRfcCI rfcCi) { rfcCi.setIsActiveInRelease(true); cis.put(rfcCi.getRfcId(), rfcCi); } | InMemoryDJMapper implements DJMapper { @Override public void createRfcCI(CmsRfcCI rfcCi) { rfcCi.setIsActiveInRelease(true); cis.put(rfcCi.getRfcId(), rfcCi); } } | InMemoryDJMapper implements DJMapper { @Override public void createRfcCI(CmsRfcCI rfcCi) { rfcCi.setIsActiveInRelease(true); cis.put(rfcCi.getRfcId(), rfcCi); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void createRfcCI(CmsRfcCI rfcCi) { rfcCi.setIsActiveInRelease(true); cis.put(rfcCi.getRfcId(), rfcCi); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override lo... | InMemoryDJMapper implements DJMapper { @Override public void createRfcCI(CmsRfcCI rfcCi) { rfcCi.setIsActiveInRelease(true); cis.put(rfcCi.getRfcId(), rfcCi); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override lo... |
@Test public void testCreateRfcLog() throws Exception { } | @Override public void createRfcLog(CmsRfcCI rfcCi) { } | InMemoryDJMapper implements DJMapper { @Override public void createRfcLog(CmsRfcCI rfcCi) { } } | InMemoryDJMapper implements DJMapper { @Override public void createRfcLog(CmsRfcCI rfcCi) { } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void createRfcLog(CmsRfcCI rfcCi) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(String stateN... | InMemoryDJMapper implements DJMapper { @Override public void createRfcLog(CmsRfcCI rfcCi) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(String stateN... |
@Test public void testRmRfcCIfromRelease() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.rmRfcCIfromRelease(1)); } | @Override public int rmRfcCIfromRelease(long rfcId) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public int rmRfcCIfromRelease(long rfcId) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public int rmRfcCIfromRelease(long rfcId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public int rmRfcCIfromRelease(long rfcId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Over... | InMemoryDJMapper implements DJMapper { @Override public int rmRfcCIfromRelease(long rfcId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Over... |
@Test(enabled = true) private void test_parseAssemblyNameFromNsPath() { plugin = new PlatformHADRCrawlerPlugin(); String nsPath = "/orgname/assemblyname/platformname/bom/env-dev/1"; assertEquals(plugin.parseAssemblyNameFromNsPath(nsPath), "assemblyname"); } | public String parseAssemblyNameFromNsPath(String path) { if (path != null && !path.isEmpty()) { String[] parsedArray = path.split("/"); return parsedArray[2]; } else { return ""; } } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String parseAssemblyNameFromNsPath(String path) { if (path != null && !path.isEmpty()) { String[] parsedArray = path.split("/"); return parsedArray[2]; } else { return ""; } } } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String parseAssemblyNameFromNsPath(String path) { if (path != null && !path.isEmpty()) { String[] parsedArray = path.split("/"); return parsedArray[2]; } else { return ""; } } PlatformHADRCrawlerPlugin(); } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String parseAssemblyNameFromNsPath(String path) { if (path != null && !path.isEmpty()) { String[] parsedArray = path.split("/"); return parsedArray[2]; } else { return ""; } } PlatformHADRCrawlerPlugin(); SearchDal getSearchDal(); void setSearchDal(Search... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String parseAssemblyNameFromNsPath(String path) { if (path != null && !path.isEmpty()) { String[] parsedArray = path.split("/"); return parsedArray[2]; } else { return ""; } } PlatformHADRCrawlerPlugin(); SearchDal getSearchDal(); void setSearchDal(Search... |
@Test public void testUpdateRfcCI() throws Exception { assertEquals(mapper.getCis().size(), 0); CmsRfcCI rfcCi = new CmsRfcCI(); rfcCi.setRfcId(1); mapper.createRfcCI(rfcCi); assertEquals(mapper.getCis().size(), 1); assertEquals(mapper.getCis().get(1L), rfcCi); CmsRfcCI rfcCi2 = new CmsRfcCI(); rfcCi2.setRfcId(1); mapp... | @Override public void updateRfcCI(CmsRfcCI rfcCI) { cis.put(rfcCI.getRfcId(), rfcCI); } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcCI(CmsRfcCI rfcCI) { cis.put(rfcCI.getRfcId(), rfcCI); } } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcCI(CmsRfcCI rfcCI) { cis.put(rfcCI.getRfcId(), rfcCI); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcCI(CmsRfcCI rfcCI) { cis.put(rfcCI.getRfcId(), rfcCI); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Intege... | InMemoryDJMapper implements DJMapper { @Override public void updateRfcCI(CmsRfcCI rfcCI) { cis.put(rfcCI.getRfcId(), rfcCI); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Intege... |
@Test public void testUpdateRfcLog() throws Exception { } | @Override public void updateRfcLog(CmsRfcCI rfcCI) { } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcLog(CmsRfcCI rfcCI) { } } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcLog(CmsRfcCI rfcCI) { } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcLog(CmsRfcCI rfcCI) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(String stateN... | InMemoryDJMapper implements DJMapper { @Override public void updateRfcLog(CmsRfcCI rfcCI) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(String stateN... |
@Test public void testInsertRfcCIAttribute() throws Exception { } | @Override public void insertRfcCIAttribute(CmsRfcAttribute attr) { } | InMemoryDJMapper implements DJMapper { @Override public void insertRfcCIAttribute(CmsRfcAttribute attr) { } } | InMemoryDJMapper implements DJMapper { @Override public void insertRfcCIAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void insertRfcCIAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId... | InMemoryDJMapper implements DJMapper { @Override public void insertRfcCIAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId... |
@Test public void testUpdateRfcCIAttribute() throws Exception { } | @Override public void updateRfcCIAttribute(CmsRfcAttribute attr) { } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcCIAttribute(CmsRfcAttribute attr) { } } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcCIAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcCIAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId... | InMemoryDJMapper implements DJMapper { @Override public void updateRfcCIAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId... |
@Test public void testGetRfcCIById() throws Exception { CmsRfcCI rfcCi = new CmsRfcCI(); rfcCi.setRfcId(1); mapper.createRfcCI(rfcCi); assertEquals(mapper.getCis().size(), 1); assertEquals(mapper.getCis().get(1L), rfcCi); } | @Override public CmsRfcCI getRfcCIById(long rfcId) { return cis.get(rfcId); } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcCI getRfcCIById(long rfcId) { return cis.get(rfcId); } } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcCI getRfcCIById(long rfcId) { return cis.get(rfcId); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcCI getRfcCIById(long rfcId) { return cis.get(rfcId); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getRelea... | InMemoryDJMapper implements DJMapper { @Override public CmsRfcCI getRfcCIById(long rfcId) { return cis.get(rfcId); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getRelea... |
@Test public void testGetOpenRfcCIByCiId() throws Exception { CmsRfcCI rfcCi = new CmsRfcCI(); rfcCi.setRfcId(1); rfcCi.setCiId(1); mapper.createRfcCI(rfcCi); CmsRfcCI rfcCi2 = new CmsRfcCI(); rfcCi2.setRfcId(2); rfcCi2.setCiId(2); mapper.createRfcCI(rfcCi2); rfcCi2.setIsActiveInRelease(false); assertEquals(mapper.getO... | @Override public CmsRfcCI getOpenRfcCIByCiId(long ciId) { for (CmsRfcCI rfc : cis.values()) { if ((ciId == rfc.getCiId()) && rfc.getIsActiveInRelease()) return rfc; } return null; } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcCI getOpenRfcCIByCiId(long ciId) { for (CmsRfcCI rfc : cis.values()) { if ((ciId == rfc.getCiId()) && rfc.getIsActiveInRelease()) return rfc; } return null; } } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcCI getOpenRfcCIByCiId(long ciId) { for (CmsRfcCI rfc : cis.values()) { if ((ciId == rfc.getCiId()) && rfc.getIsActiveInRelease()) return rfc; } return null; } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcCI getOpenRfcCIByCiId(long ciId) { for (CmsRfcCI rfc : cis.values()) { if ((ciId == rfc.getCiId()) && rfc.getIsActiveInRelease()) return rfc; } return null; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRele... | InMemoryDJMapper implements DJMapper { @Override public CmsRfcCI getOpenRfcCIByCiId(long ciId) { for (CmsRfcCI rfc : cis.values()) { if ((ciId == rfc.getCiId()) && rfc.getIsActiveInRelease()) return rfc; } return null; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRele... |
@Test public void testGetOpenRfcCIByCiIdList() { CmsRfcCI rfcCi = new CmsRfcCI(); rfcCi.setRfcId(1); rfcCi.setCiId(1); mapper.createRfcCI(rfcCi); CmsRfcCI rfcCi2 = new CmsRfcCI(); rfcCi2.setRfcId(2); rfcCi2.setCiId(2); mapper.createRfcCI(rfcCi2); ArrayList<Long> ciIds = new ArrayList<>(); ciIds.add(1L); ciIds.add(2L); ... | @Override public List<CmsRfcCI> getOpenRfcCIByCiIdList(List<Long> ciIds) { return cis.values().stream() .filter(r -> (ciIds.contains(r.getCiId())) ) .collect(Collectors.toList()); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByCiIdList(List<Long> ciIds) { return cis.values().stream() .filter(r -> (ciIds.contains(r.getCiId())) ) .collect(Collectors.toList()); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByCiIdList(List<Long> ciIds) { return cis.values().stream() .filter(r -> (ciIds.contains(r.getCiId())) ) .collect(Collectors.toList()); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByCiIdList(List<Long> ciIds) { return cis.values().stream() .filter(r -> (ciIds.contains(r.getCiId())) ) .collect(Collectors.toList()); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRele... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByCiIdList(List<Long> ciIds) { return cis.values().stream() .filter(r -> (ciIds.contains(r.getCiId())) ) .collect(Collectors.toList()); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRele... |
@Test public void testGetRfcCIBy3() throws Exception { CmsRfcCI rfcCi = new CmsRfcCI(); rfcCi.setRfcId(1); rfcCi.setCiId(1); mapper.createRfcCI(rfcCi); CmsRfcCI rfcCi2 = new CmsRfcCI(); rfcCi2.setRfcId(2); rfcCi2.setCiId(2); mapper.createRfcCI(rfcCi2); List<CmsRfcCI> list = mapper.getRfcCIBy3(1, true, 2L); assertEquals... | @Override public List<CmsRfcCI> getRfcCIBy3(long releaseId, Boolean isActive, Long ciId) { return cis.values().stream() .filter(r -> (ciId == null || ciId.equals(r.getCiId())) && (isActive == null || isActive == r.getIsActiveInRelease())) .collect(Collectors.toList()); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRfcCIBy3(long releaseId, Boolean isActive, Long ciId) { return cis.values().stream() .filter(r -> (ciId == null || ciId.equals(r.getCiId())) && (isActive == null || isActive == r.getIsActiveInRelease())) .collect(Collectors.toList()); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRfcCIBy3(long releaseId, Boolean isActive, Long ciId) { return cis.values().stream() .filter(r -> (ciId == null || ciId.equals(r.getCiId())) && (isActive == null || isActive == r.getIsActiveInRelease())) .collect(Collectors.toList()); } InMemoryD... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRfcCIBy3(long releaseId, Boolean isActive, Long ciId) { return cis.values().stream() .filter(r -> (ciId == null || ciId.equals(r.getCiId())) && (isActive == null || isActive == r.getIsActiveInRelease())) .collect(Collectors.toList()); } InMemoryD... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRfcCIBy3(long releaseId, Boolean isActive, Long ciId) { return cis.values().stream() .filter(r -> (ciId == null || ciId.equals(r.getCiId())) && (isActive == null || isActive == r.getIsActiveInRelease())) .collect(Collectors.toList()); } InMemoryD... |
@Test public void testGetRfcCIByClazzAndName() throws Exception { CmsRfcCI rfcCi = new CmsRfcCI(); rfcCi.setRfcId(1); rfcCi.setCiId(1); rfcCi.setNsPath("/test"); rfcCi.setCiName("test"); rfcCi.setCiState("open"); rfcCi.setCiClassName("clazz"); CmsRfcCI rfcCi2 = new CmsRfcCI(); rfcCi2.setRfcId(2); rfcCi2.setCiId(2); rfc... | @Override public List<CmsRfcCI> getRfcCIByClazzAndName(String nsPath, String clazzName, String ciName, Boolean isActive, String state) { return cis.values().stream() .filter(r -> (nsPath == null || nsPath.equals(r.getNsPath())) && (clazzName == null || clazzName.equals(r.getCiClassName())) && (ciName == null || ciName.... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRfcCIByClazzAndName(String nsPath, String clazzName, String ciName, Boolean isActive, String state) { return cis.values().stream() .filter(r -> (nsPath == null || nsPath.equals(r.getNsPath())) && (clazzName == null || clazzName.equals(r.getCiClas... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRfcCIByClazzAndName(String nsPath, String clazzName, String ciName, Boolean isActive, String state) { return cis.values().stream() .filter(r -> (nsPath == null || nsPath.equals(r.getNsPath())) && (clazzName == null || clazzName.equals(r.getCiClas... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRfcCIByClazzAndName(String nsPath, String clazzName, String ciName, Boolean isActive, String state) { return cis.values().stream() .filter(r -> (nsPath == null || nsPath.equals(r.getNsPath())) && (clazzName == null || clazzName.equals(r.getCiClas... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRfcCIByClazzAndName(String nsPath, String clazzName, String ciName, Boolean isActive, String state) { return cis.values().stream() .filter(r -> (nsPath == null || nsPath.equals(r.getNsPath())) && (clazzName == null || clazzName.equals(r.getCiClas... |
@Test public void testGetOpenRfcCIByClazzAndNameLower() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getOpenRfcCIByClazzAndNameLower("", "", "")); } | @Override public List<CmsRfcCI> getOpenRfcCIByClazzAndNameLower(String nsPath, String clazzName, String ciName) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByClazzAndNameLower(String nsPath, String clazzName, String ciName) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByClazzAndNameLower(String nsPath, String clazzName, String ciName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByClazzAndNameLower(String nsPath, String clazzName, String ciName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Over... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByClazzAndNameLower(String nsPath, String clazzName, String ciName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Over... |
@Test(enabled = true) private void test_getOOURL() { System.setProperty("hadr.oo.baseurl", "https: plugin = new PlatformHADRCrawlerPlugin(); String nsPath = "/orgname/assemblyname/platformname/bom/env-dev/1"; String expectedOOURLString = "https: assertEquals(plugin.getOOURL(nsPath), expectedOOURLString); } | public String getOOURL(String path) { return oo_baseUrl + "/r/ns?path=" + path; } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String getOOURL(String path) { return oo_baseUrl + "/r/ns?path=" + path; } } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String getOOURL(String path) { return oo_baseUrl + "/r/ns?path=" + path; } PlatformHADRCrawlerPlugin(); } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String getOOURL(String path) { return oo_baseUrl + "/r/ns?path=" + path; } PlatformHADRCrawlerPlugin(); SearchDal getSearchDal(); void setSearchDal(SearchDal searchDal); void readConfig(); void processEnvironment(Environment env, Map<String, Organization>... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String getOOURL(String path) { return oo_baseUrl + "/r/ns?path=" + path; } PlatformHADRCrawlerPlugin(); SearchDal getSearchDal(); void setSearchDal(SearchDal searchDal); void readConfig(); void processEnvironment(Environment env, Map<String, Organization>... |
@Test public void testGetOpenRfcCIByNsLike() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getOpenRfcCIByNsLike("", "", "", "")); } | @Override public List<CmsRfcCI> getOpenRfcCIByNsLike(String ns, String nsLike, String clazzName, String ciName) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByNsLike(String ns, String nsLike, String clazzName, String ciName) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByNsLike(String ns, String nsLike, String clazzName, String ciName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByNsLike(String ns, String nsLike, String clazzName, String ciName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Over... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByNsLike(String ns, String nsLike, String clazzName, String ciName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Over... |
@Test public void testGetOpenRfcCIByClazzAnd2Names() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getOpenRfcCIByClazzAnd2Names("", "", "", "")); } | @Override public List<CmsRfcCI> getOpenRfcCIByClazzAnd2Names(String nsPath, String clazzName, String ciName, String altCiName) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByClazzAnd2Names(String nsPath, String clazzName, String ciName, String altCiName) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByClazzAnd2Names(String nsPath, String clazzName, String ciName, String altCiName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByClazzAnd2Names(String nsPath, String clazzName, String ciName, String altCiName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getR... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getOpenRfcCIByClazzAnd2Names(String nsPath, String clazzName, String ciName, String altCiName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getR... |
@Test public void testGetClosedRfcCIByCiId() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getClosedRfcCIByCiId(1)); } | @Override public List<CmsRfcCI> getClosedRfcCIByCiId(long ciId) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getClosedRfcCIByCiId(long ciId) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getClosedRfcCIByCiId(long ciId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getClosedRfcCIByCiId(long ciId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextC... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getClosedRfcCIByCiId(long ciId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextC... |
@Test public void testGetRollUpRfc() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getRollUpRfc(1L, 1)); } | @Override public List<CmsRfcCI> getRollUpRfc(long ciId, long rfcId) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRollUpRfc(long ciId, long rfcId) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRollUpRfc(long ciId, long rfcId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRollUpRfc(long ciId, long rfcId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getN... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcCI> getRollUpRfc(long ciId, long rfcId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getN... |
@Test public void testGetRfcCIAttributes() throws Exception { assertEquals(mapper.getRfcCIAttributes(1), new ArrayList()); } | @Override public List<CmsRfcAttribute> getRfcCIAttributes(long rfcId) { return new ArrayList<>(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcAttribute> getRfcCIAttributes(long rfcId) { return new ArrayList<>(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcAttribute> getRfcCIAttributes(long rfcId) { return new ArrayList<>(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcAttribute> getRfcCIAttributes(long rfcId) { return new ArrayList<>(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Ove... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcAttribute> getRfcCIAttributes(long rfcId) { return new ArrayList<>(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Ove... |
@Test public void testGetRfcCIAttributesByRfcIdList() throws Exception { assertEquals(mapper.getRfcCIAttributesByRfcIdList(new HashSet()), new ArrayList()); } | @Override public List<CmsRfcAttribute> getRfcCIAttributesByRfcIdList(Set<Long> rfcIds) { return new ArrayList<>(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcAttribute> getRfcCIAttributesByRfcIdList(Set<Long> rfcIds) { return new ArrayList<>(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcAttribute> getRfcCIAttributesByRfcIdList(Set<Long> rfcIds) { return new ArrayList<>(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcAttribute> getRfcCIAttributesByRfcIdList(Set<Long> rfcIds) { return new ArrayList<>(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long ge... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcAttribute> getRfcCIAttributesByRfcIdList(Set<Long> rfcIds) { return new ArrayList<>(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long ge... |
@Test public void testCreateRfcRelation() throws Exception { assertEquals(mapper.getRelations().size(), 0); CmsRfcRelation rfcRelation = new CmsRfcRelation(); rfcRelation.setRfcId(1); mapper.createRfcRelation(rfcRelation); assertEquals(mapper.getRelations().size(), 1); assertEquals(mapper.getRelations().get(1L), rfcRel... | @Override public void createRfcRelation(CmsRfcRelation rfcRelation) { rfcRelation.setIsActiveInRelease(true); relations.put(rfcRelation.getRfcId(), rfcRelation); } | InMemoryDJMapper implements DJMapper { @Override public void createRfcRelation(CmsRfcRelation rfcRelation) { rfcRelation.setIsActiveInRelease(true); relations.put(rfcRelation.getRfcId(), rfcRelation); } } | InMemoryDJMapper implements DJMapper { @Override public void createRfcRelation(CmsRfcRelation rfcRelation) { rfcRelation.setIsActiveInRelease(true); relations.put(rfcRelation.getRfcId(), rfcRelation); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void createRfcRelation(CmsRfcRelation rfcRelation) { rfcRelation.setIsActiveInRelease(true); relations.put(rfcRelation.getRfcId(), rfcRelation); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); ... | InMemoryDJMapper implements DJMapper { @Override public void createRfcRelation(CmsRfcRelation rfcRelation) { rfcRelation.setIsActiveInRelease(true); relations.put(rfcRelation.getRfcId(), rfcRelation); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); ... |
@Test public void testCreateRfcRelationLog() throws Exception { } | @Override public void createRfcRelationLog(CmsRfcRelation rel) { } | InMemoryDJMapper implements DJMapper { @Override public void createRfcRelationLog(CmsRfcRelation rel) { } } | InMemoryDJMapper implements DJMapper { @Override public void createRfcRelationLog(CmsRfcRelation rel) { } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void createRfcRelationLog(CmsRfcRelation rel) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(S... | InMemoryDJMapper implements DJMapper { @Override public void createRfcRelationLog(CmsRfcRelation rel) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(S... |
@Test public void testRmRfcRelationfromRelease() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.rmRfcRelationfromRelease(1)); } | @Override public int rmRfcRelationfromRelease(long rfcId) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public int rmRfcRelationfromRelease(long rfcId) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public int rmRfcRelationfromRelease(long rfcId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public int rmRfcRelationfromRelease(long rfcId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId();... | InMemoryDJMapper implements DJMapper { @Override public int rmRfcRelationfromRelease(long rfcId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId();... |
@Test public void testUpdateRfcRelation() throws Exception { assertEquals(mapper.getRelations().size(), 0); CmsRfcRelation rfcRelation = new CmsRfcRelation(); rfcRelation.setRfcId(1); mapper.createRfcRelation(rfcRelation); CmsRfcRelation rfcRelation2 = new CmsRfcRelation(); rfcRelation2.setRfcId(1); mapper.updateRfcRel... | @Override public int updateRfcRelation(CmsRfcRelation rel) { long rfcId = rel.getRfcId(); relations.put(rfcId, rel); return 0; } | InMemoryDJMapper implements DJMapper { @Override public int updateRfcRelation(CmsRfcRelation rel) { long rfcId = rel.getRfcId(); relations.put(rfcId, rel); return 0; } } | InMemoryDJMapper implements DJMapper { @Override public int updateRfcRelation(CmsRfcRelation rel) { long rfcId = rel.getRfcId(); relations.put(rfcId, rel); return 0; } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public int updateRfcRelation(CmsRfcRelation rel) { long rfcId = rel.getRfcId(); relations.put(rfcId, rel); return 0; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Over... | InMemoryDJMapper implements DJMapper { @Override public int updateRfcRelation(CmsRfcRelation rel) { long rfcId = rel.getRfcId(); relations.put(rfcId, rel); return 0; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Over... |
@Test(enabled = true) private void test_getOOURL_DefaultToBlank() { System.clearProperty("hadr.oo.baseurl"); plugin = new PlatformHADRCrawlerPlugin(); String nsPath = "/orgname/assemblyname/platformname/bom/env-dev/1"; String expectedOOURLString = "/r/ns?path=/orgname/assemblyname/platformname/bom/env-dev/1"; assertEqu... | public String getOOURL(String path) { return oo_baseUrl + "/r/ns?path=" + path; } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String getOOURL(String path) { return oo_baseUrl + "/r/ns?path=" + path; } } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String getOOURL(String path) { return oo_baseUrl + "/r/ns?path=" + path; } PlatformHADRCrawlerPlugin(); } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String getOOURL(String path) { return oo_baseUrl + "/r/ns?path=" + path; } PlatformHADRCrawlerPlugin(); SearchDal getSearchDal(); void setSearchDal(SearchDal searchDal); void readConfig(); void processEnvironment(Environment env, Map<String, Organization>... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public String getOOURL(String path) { return oo_baseUrl + "/r/ns?path=" + path; } PlatformHADRCrawlerPlugin(); SearchDal getSearchDal(); void setSearchDal(SearchDal searchDal); void readConfig(); void processEnvironment(Environment env, Map<String, Organization>... |
@Test public void testUpdateRfcRelationLog() throws Exception { } | @Override public void updateRfcRelationLog(CmsRfcRelation rel) { } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcRelationLog(CmsRfcRelation rel) { } } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcRelationLog(CmsRfcRelation rel) { } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcRelationLog(CmsRfcRelation rel) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(S... | InMemoryDJMapper implements DJMapper { @Override public void updateRfcRelationLog(CmsRfcRelation rel) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(S... |
@Test public void testInsertRfcRelationAttribute() throws Exception { } | @Override public void insertRfcRelationAttribute(CmsRfcAttribute attr) { } | InMemoryDJMapper implements DJMapper { @Override public void insertRfcRelationAttribute(CmsRfcAttribute attr) { } } | InMemoryDJMapper implements DJMapper { @Override public void insertRfcRelationAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void insertRfcRelationAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseS... | InMemoryDJMapper implements DJMapper { @Override public void insertRfcRelationAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseS... |
@Test public void testUpdateRfcRelationAttribute() throws Exception { } | @Override public void updateRfcRelationAttribute(CmsRfcAttribute attr) { } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcRelationAttribute(CmsRfcAttribute attr) { } } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcRelationAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void updateRfcRelationAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseS... | InMemoryDJMapper implements DJMapper { @Override public void updateRfcRelationAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseS... |
@Test public void testUpsertRfcRelationAttribute() throws Exception { } | @Override public void upsertRfcRelationAttribute(CmsRfcAttribute attr) { } | InMemoryDJMapper implements DJMapper { @Override public void upsertRfcRelationAttribute(CmsRfcAttribute attr) { } } | InMemoryDJMapper implements DJMapper { @Override public void upsertRfcRelationAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public void upsertRfcRelationAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseS... | InMemoryDJMapper implements DJMapper { @Override public void upsertRfcRelationAttribute(CmsRfcAttribute attr) { } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseS... |
@Test public void testGetRfcRelationById() throws Exception { CmsRfcRelation rfcRelation = new CmsRfcRelation(); rfcRelation.setRfcId(1); mapper.createRfcRelation(rfcRelation); assertEquals(mapper.getRfcRelationById(1), rfcRelation); } | @Override public CmsRfcRelation getRfcRelationById(long rfcId) { return relations.get(rfcId); } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcRelation getRfcRelationById(long rfcId) { return relations.get(rfcId); } } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcRelation getRfcRelationById(long rfcId) { return relations.get(rfcId); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcRelation getRfcRelationById(long rfcId) { return relations.get(rfcId); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Overrid... | InMemoryDJMapper implements DJMapper { @Override public CmsRfcRelation getRfcRelationById(long rfcId) { return relations.get(rfcId); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @Overrid... |
@Test public void testGetOpenRfcRelationByCiRelId() throws Exception { CmsRfcRelation rfcRelation = new CmsRfcRelation(); rfcRelation.setRfcId(1); rfcRelation.setCiRelationId(1); mapper.createRfcRelation(rfcRelation); assertEquals(mapper.getOpenRfcRelationByCiRelId(1), rfcRelation); } | @Override public CmsRfcRelation getOpenRfcRelationByCiRelId(long ciRelationId) { for (CmsRfcRelation rel : relations.values()) { if (rel.getCiRelationId() == ciRelationId && rel.getIsActiveInRelease()) return rel; } return null; } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcRelation getOpenRfcRelationByCiRelId(long ciRelationId) { for (CmsRfcRelation rel : relations.values()) { if (rel.getCiRelationId() == ciRelationId && rel.getIsActiveInRelease()) return rel; } return null; } } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcRelation getOpenRfcRelationByCiRelId(long ciRelationId) { for (CmsRfcRelation rel : relations.values()) { if (rel.getCiRelationId() == ciRelationId && rel.getIsActiveInRelease()) return rel; } return null; } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public CmsRfcRelation getOpenRfcRelationByCiRelId(long ciRelationId) { for (CmsRfcRelation rel : relations.values()) { if (rel.getCiRelationId() == ciRelationId && rel.getIsActiveInRelease()) return rel; } return null; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); ... | InMemoryDJMapper implements DJMapper { @Override public CmsRfcRelation getOpenRfcRelationByCiRelId(long ciRelationId) { for (CmsRfcRelation rel : relations.values()) { if (rel.getCiRelationId() == ciRelationId && rel.getIsActiveInRelease()) return rel; } return null; } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); ... |
@Test public void testGetRfcRelationByReleaseId() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getRfcRelationByReleaseId(1)); } | @Override public List<CmsRfcRelation> getRfcRelationByReleaseId(long releaseId) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationByReleaseId(long releaseId) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationByReleaseId(long releaseId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationByReleaseId(long releaseId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Overri... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationByReleaseId(long releaseId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Overri... |
@Test public void testGetClosedRfcRelationByCiId() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getClosedRfcCIByCiId(1)); } | @Override public List<CmsRfcRelation> getClosedRfcRelationByCiId(long ciId) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getClosedRfcRelationByCiId(long ciId) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getClosedRfcRelationByCiId(long ciId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getClosedRfcRelationByCiId(long ciId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override l... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getClosedRfcRelationByCiId(long ciId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override l... |
@Test public void testGetRfcRelationsByNs() throws Exception { CmsRfcRelation rfcRelation = new CmsRfcRelation(); rfcRelation.setRfcId(1); rfcRelation.setNsPath("/test"); mapper.createRfcRelation(rfcRelation); CmsRfcRelation rfcRelation2 = new CmsRfcRelation(); rfcRelation2.setRfcId(2); rfcRelation2.setNsPath("/test2")... | @Override public List<CmsRfcRelation> getRfcRelationsByNs(String nsPath, Boolean isActive, String state) { return relations.values().stream() .filter(r -> r.getNsPath().equals(nsPath) && (isActive == null || r.getIsActiveInRelease())) .collect(Collectors.toList()); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationsByNs(String nsPath, Boolean isActive, String state) { return relations.values().stream() .filter(r -> r.getNsPath().equals(nsPath) && (isActive == null || r.getIsActiveInRelease())) .collect(Collectors.toList()); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationsByNs(String nsPath, Boolean isActive, String state) { return relations.values().stream() .filter(r -> r.getNsPath().equals(nsPath) && (isActive == null || r.getIsActiveInRelease())) .collect(Collectors.toList()); } InMemoryDJMap... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationsByNs(String nsPath, Boolean isActive, String state) { return relations.values().stream() .filter(r -> r.getNsPath().equals(nsPath) && (isActive == null || r.getIsActiveInRelease())) .collect(Collectors.toList()); } InMemoryDJMap... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationsByNs(String nsPath, Boolean isActive, String state) { return relations.values().stream() .filter(r -> r.getNsPath().equals(nsPath) && (isActive == null || r.getIsActiveInRelease())) .collect(Collectors.toList()); } InMemoryDJMap... |
@Test public void testGetRfcRelationBy4() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getRfcRelationBy4(1, false, 1L, 1L)); } | @Override public List<CmsRfcRelation> getRfcRelationBy4(long releaseId, Boolean isActive, Long fromCiId, Long toCiId) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationBy4(long releaseId, Boolean isActive, Long fromCiId, Long toCiId) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationBy4(long releaseId, Boolean isActive, Long fromCiId, Long toCiId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationBy4(long releaseId, Boolean isActive, Long fromCiId, Long toCiId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease();... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationBy4(long releaseId, Boolean isActive, Long fromCiId, Long toCiId) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease();... |
@Test(enabled = true) private void testIsNonProdEnvUsingProdutionClouds() { plugin = new PlatformHADRCrawlerPlugin(); Map<String, Cloud> cloudsMap= new HashMap<String, Cloud>(); Cloud cloud1 = new Cloud(); cloud1.setId("dc1-ProdCloud1"); cloud1.setPriority(1); cloud1.setAdminstatus("active"); cloud1.setDeploymentorder(... | public boolean isNonProdEnvUsingProdutionClouds(Map<String, Cloud> cloudsMap) { for (String prodCloudName : produtionCloudsArr) { return cloudsMap.keySet().toString().toLowerCase().contains(prodCloudName); } return false; } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public boolean isNonProdEnvUsingProdutionClouds(Map<String, Cloud> cloudsMap) { for (String prodCloudName : produtionCloudsArr) { return cloudsMap.keySet().toString().toLowerCase().contains(prodCloudName); } return false; } } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public boolean isNonProdEnvUsingProdutionClouds(Map<String, Cloud> cloudsMap) { for (String prodCloudName : produtionCloudsArr) { return cloudsMap.keySet().toString().toLowerCase().contains(prodCloudName); } return false; } PlatformHADRCrawlerPlugin(); } | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public boolean isNonProdEnvUsingProdutionClouds(Map<String, Cloud> cloudsMap) { for (String prodCloudName : produtionCloudsArr) { return cloudsMap.keySet().toString().toLowerCase().contains(prodCloudName); } return false; } PlatformHADRCrawlerPlugin(); SearchDal... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public boolean isNonProdEnvUsingProdutionClouds(Map<String, Cloud> cloudsMap) { for (String prodCloudName : produtionCloudsArr) { return cloudsMap.keySet().toString().toLowerCase().contains(prodCloudName); } return false; } PlatformHADRCrawlerPlugin(); SearchDal... |
@Test public void testGetOpenRfcRelationBy2() throws Exception { CmsRfcRelation rfcRelation = new CmsRfcRelation(); rfcRelation.setRfcId(1); rfcRelation.setNsPath("/test"); rfcRelation.setRelationName("test"); rfcRelation.setFromCiId(1L); rfcRelation.setToCiId(1L); mapper.createRfcRelation(rfcRelation); CmsRfcRelation ... | @Override public List<CmsRfcRelation> getOpenRfcRelationBy2(Long fromCiId, Long toCiId, String relName, String shortRelName) { return relations.values().stream() .filter(r -> (relName == null || r.getRelationName().equals(relName)) && (fromCiId == null || fromCiId.equals(r.getFromCiId())) && (toCiId == null || toCiId.e... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenRfcRelationBy2(Long fromCiId, Long toCiId, String relName, String shortRelName) { return relations.values().stream() .filter(r -> (relName == null || r.getRelationName().equals(relName)) && (fromCiId == null || fromCiId.equals(r.getFrom... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenRfcRelationBy2(Long fromCiId, Long toCiId, String relName, String shortRelName) { return relations.values().stream() .filter(r -> (relName == null || r.getRelationName().equals(relName)) && (fromCiId == null || fromCiId.equals(r.getFrom... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenRfcRelationBy2(Long fromCiId, Long toCiId, String relName, String shortRelName) { return relations.values().stream() .filter(r -> (relName == null || r.getRelationName().equals(relName)) && (fromCiId == null || fromCiId.equals(r.getFrom... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenRfcRelationBy2(Long fromCiId, Long toCiId, String relName, String shortRelName) { return relations.values().stream() .filter(r -> (relName == null || r.getRelationName().equals(relName)) && (fromCiId == null || fromCiId.equals(r.getFrom... |
@Test public void testGetOpenFromRfcRelationByTargetClass() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getOpenFromRfcRelationByTargetClass(1L, "", "", "")); } | @Override public List<CmsRfcRelation> getOpenFromRfcRelationByTargetClass(long fromCiId, String relName, String shortRelName, String targetClassName) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenFromRfcRelationByTargetClass(long fromCiId, String relName, String shortRelName, String targetClassName) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenFromRfcRelationByTargetClass(long fromCiId, String relName, String shortRelName, String targetClassName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenFromRfcRelationByTargetClass(long fromCiId, String relName, String shortRelName, String targetClassName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelat... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenFromRfcRelationByTargetClass(long fromCiId, String relName, String shortRelName, String targetClassName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelat... |
@Test public void testGetOpenFromRfcRelationByAttrs() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getOpenFromRfcRelationByAttrs(1, "", "", "", null)); } | @Override public List<CmsRfcRelation> getOpenFromRfcRelationByAttrs(long fromCiId, String relName, String shortRelName, String targetClassName, List<CmsRfcBasicAttribute> attrList) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenFromRfcRelationByAttrs(long fromCiId, String relName, String shortRelName, String targetClassName, List<CmsRfcBasicAttribute> attrList) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenFromRfcRelationByAttrs(long fromCiId, String relName, String shortRelName, String targetClassName, List<CmsRfcBasicAttribute> attrList) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenFromRfcRelationByAttrs(long fromCiId, String relName, String shortRelName, String targetClassName, List<CmsRfcBasicAttribute> attrList) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenFromRfcRelationByAttrs(long fromCiId, String relName, String shortRelName, String targetClassName, List<CmsRfcBasicAttribute> attrList) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map... |
@Test public void testGetOpenToRfcRelationByTargetClass() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getOpenToRfcRelationByTargetClass(1, "", "", "")); } | @Override public List<CmsRfcRelation> getOpenToRfcRelationByTargetClass(long toCiId, String relName, String shortRelName, String targetClassName) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenToRfcRelationByTargetClass(long toCiId, String relName, String shortRelName, String targetClassName) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenToRfcRelationByTargetClass(long toCiId, String relName, String shortRelName, String targetClassName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenToRfcRelationByTargetClass(long toCiId, String relName, String shortRelName, String targetClassName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenToRfcRelationByTargetClass(long toCiId, String relName, String shortRelName, String targetClassName) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations... |
@Test public void testGetOpenToRfcRelationByAttrs() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getOpenToRfcRelationByAttrs(1, "", "", "", null)); } | @Override public List<CmsRfcRelation> getOpenToRfcRelationByAttrs(long toCiId, String relName, String shortRelName, String targetClassName, List<CmsRfcBasicAttribute> attrList) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenToRfcRelationByAttrs(long toCiId, String relName, String shortRelName, String targetClassName, List<CmsRfcBasicAttribute> attrList) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenToRfcRelationByAttrs(long toCiId, String relName, String shortRelName, String targetClassName, List<CmsRfcBasicAttribute> attrList) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenToRfcRelationByAttrs(long toCiId, String relName, String shortRelName, String targetClassName, List<CmsRfcBasicAttribute> attrList) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Lon... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getOpenToRfcRelationByAttrs(long toCiId, String relName, String shortRelName, String targetClassName, List<CmsRfcBasicAttribute> attrList) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Lon... |
@Test public void testGetRfcRelationBy3() throws Exception { CmsRfcRelation rfcRelation = new CmsRfcRelation(); rfcRelation.setRfcId(1); rfcRelation.setCiRelationId(1); rfcRelation.setNsPath("/test"); rfcRelation.setRelationName("test"); rfcRelation.setFromCiId(1L); rfcRelation.setToCiId(1L); mapper.createRfcRelation(r... | @Override public List<CmsRfcRelation> getRfcRelationBy3(long releaseId, Boolean isActive, Long ciRelationId) { return relations.values().stream() .filter(r -> (ciRelationId == null || ciRelationId.equals(r.getCiRelationId())) && (isActive == null || isActive == r.getIsActiveInRelease())) .collect(Collectors.toList()); ... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationBy3(long releaseId, Boolean isActive, Long ciRelationId) { return relations.values().stream() .filter(r -> (ciRelationId == null || ciRelationId.equals(r.getCiRelationId())) && (isActive == null || isActive == r.getIsActiveInRele... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationBy3(long releaseId, Boolean isActive, Long ciRelationId) { return relations.values().stream() .filter(r -> (ciRelationId == null || ciRelationId.equals(r.getCiRelationId())) && (isActive == null || isActive == r.getIsActiveInRele... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationBy3(long releaseId, Boolean isActive, Long ciRelationId) { return relations.values().stream() .filter(r -> (ciRelationId == null || ciRelationId.equals(r.getCiRelationId())) && (isActive == null || isActive == r.getIsActiveInRele... | InMemoryDJMapper implements DJMapper { @Override public List<CmsRfcRelation> getRfcRelationBy3(long releaseId, Boolean isActive, Long ciRelationId) { return relations.values().stream() .filter(r -> (ciRelationId == null || ciRelationId.equals(r.getCiRelationId())) && (isActive == null || isActive == r.getIsActiveInRele... |
@Test public void testGetAltNsBy() throws Exception { assertThrows(UnsupportedOperationException.class, () -> mapper.getAltNsBy(1)); } | @Override public List<CmsAltNs> getAltNsBy(long rfcCI) { throw new UnsupportedOperationException(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsAltNs> getAltNsBy(long rfcCI) { throw new UnsupportedOperationException(); } } | InMemoryDJMapper implements DJMapper { @Override public List<CmsAltNs> getAltNsBy(long rfcCI) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); } | InMemoryDJMapper implements DJMapper { @Override public List<CmsAltNs> getAltNsBy(long rfcCI) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @O... | InMemoryDJMapper implements DJMapper { @Override public List<CmsAltNs> getAltNsBy(long rfcCI) { throw new UnsupportedOperationException(); } InMemoryDJMapper(); Map<Long, CmsRfcCI> getCis(); Map<Long, CmsRfcRelation> getRelations(); CmsRelease getRelease(); @Override long getNextDjId(); @Override long getNextCiId(); @O... |
@Test public void testGet() throws Exception { assertEquals(tlmapper.getNextCiId(), 1); assertEquals(tlmapper.getNextCiId(), 2); Thread t = new Thread(() -> { tlmapper.set(new InMemoryDJMapper()); assertEquals(tlmapper.getNextCiId(), 1); }); t.start(); t.join(); assertEquals(tlmapper.getNextCiId(), 3); } | public InMemoryDJMapper get(){ return mapper.get(); } | ThreadLocalDJMapper implements DJMapper { public InMemoryDJMapper get(){ return mapper.get(); } } | ThreadLocalDJMapper implements DJMapper { public InMemoryDJMapper get(){ return mapper.get(); } } | ThreadLocalDJMapper implements DJMapper { public InMemoryDJMapper get(){ return mapper.get(); } InMemoryDJMapper get(); void set(InMemoryDJMapper mapper); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(String stateName); @Override Integer getRfcCiActionId(String stateNa... | ThreadLocalDJMapper implements DJMapper { public InMemoryDJMapper get(){ return mapper.get(); } InMemoryDJMapper get(); void set(InMemoryDJMapper mapper); @Override long getNextDjId(); @Override long getNextCiId(); @Override Integer getReleaseStateId(String stateName); @Override Integer getRfcCiActionId(String stateNa... |
@Test public void testAddTripplet() throws Exception { Set<String> existingGoIds = new HashSet<>(); List<ManifestRfcRelationTriplet> list = new ArrayList<>(); ManifestRfcRelationTriplet triplet = new ManifestRfcRelationTriplet(); CmsRfcRelation rfcRelation = new CmsRfcRelation(); rfcRelation.setRelationId(1); CmsRfcCI ... | protected void addTripplet(List<ManifestRfcRelationTriplet> rfcRelTripletList, ManifestRfcRelationTriplet manifestRfcRelationTriplet, Set<String> existingGoIds) { String goId = getGoId(manifestRfcRelationTriplet); if (!existingGoIds.contains(goId)){ rfcRelTripletList.add(manifestRfcRelationTriplet); existingGoIds.add(g... | ManifestRfcBulkProcessor { protected void addTripplet(List<ManifestRfcRelationTriplet> rfcRelTripletList, ManifestRfcRelationTriplet manifestRfcRelationTriplet, Set<String> existingGoIds) { String goId = getGoId(manifestRfcRelationTriplet); if (!existingGoIds.contains(goId)){ rfcRelTripletList.add(manifestRfcRelationTr... | ManifestRfcBulkProcessor { protected void addTripplet(List<ManifestRfcRelationTriplet> rfcRelTripletList, ManifestRfcRelationTriplet manifestRfcRelationTriplet, Set<String> existingGoIds) { String goId = getGoId(manifestRfcRelationTriplet); if (!existingGoIds.contains(goId)){ rfcRelTripletList.add(manifestRfcRelationTr... | ManifestRfcBulkProcessor { protected void addTripplet(List<ManifestRfcRelationTriplet> rfcRelTripletList, ManifestRfcRelationTriplet manifestRfcRelationTriplet, Set<String> existingGoIds) { String goId = getGoId(manifestRfcRelationTriplet); if (!existingGoIds.contains(goId)){ rfcRelTripletList.add(manifestRfcRelationTr... | ManifestRfcBulkProcessor { protected void addTripplet(List<ManifestRfcRelationTriplet> rfcRelTripletList, ManifestRfcRelationTriplet manifestRfcRelationTriplet, Set<String> existingGoIds) { String goId = getGoId(manifestRfcRelationTriplet); if (!existingGoIds.contains(goId)){ rfcRelTripletList.add(manifestRfcRelationTr... |
@Test(priority=1, expectedExceptions = JMSException.class ,enabled = false) public void testInitWithNoSetup() throws JMSException { SensorPublisher publisher = new SensorPublisher(); try { publisher.init(); } catch (JMSException e) { logger.info("I expected an exception, and yes I caught it " + e.getMessage()); assertE... | public void init() throws JMSException { Properties properties = new Properties(); try { properties.load(this.getClass().getResourceAsStream("/sink.properties")); } catch (IOException e) { logger.error("got: " + e.getMessage()); } user = properties.getProperty("amq.user"); password = System.getenv("KLOOPZ_AMQ_PASS"); i... | SensorPublisher { public void init() throws JMSException { Properties properties = new Properties(); try { properties.load(this.getClass().getResourceAsStream("/sink.properties")); } catch (IOException e) { logger.error("got: " + e.getMessage()); } user = properties.getProperty("amq.user"); password = System.getenv("KL... | SensorPublisher { public void init() throws JMSException { Properties properties = new Properties(); try { properties.load(this.getClass().getResourceAsStream("/sink.properties")); } catch (IOException e) { logger.error("got: " + e.getMessage()); } user = properties.getProperty("amq.user"); password = System.getenv("KL... | SensorPublisher { public void init() throws JMSException { Properties properties = new Properties(); try { properties.load(this.getClass().getResourceAsStream("/sink.properties")); } catch (IOException e) { logger.error("got: " + e.getMessage()); } user = properties.getProperty("amq.user"); password = System.getenv("KL... | SensorPublisher { public void init() throws JMSException { Properties properties = new Properties(); try { properties.load(this.getClass().getResourceAsStream("/sink.properties")); } catch (IOException e) { logger.error("got: " + e.getMessage()); } user = properties.getProperty("amq.user"); password = System.getenv("KL... |
@Test(enabled = true) public void testSetCloudCategories(){ plugin = new PlatformHADRCrawlerPlugin(); PlatformHADRRecord inputPlatformHADRRecord=new PlatformHADRRecord(); Map<String, Cloud> clouds=new HashMap<String, Cloud>(); Cloud activeCloud = new Cloud(); activeCloud.setId("dc1-TestCloud1"); activeCloud.setPriority... | public PlatformHADRRecord setCloudCategories(PlatformHADRRecord platformHADRRecord, Map<String, Cloud> clouds) { List<String> activeClouds = new ArrayList<String>(); List<String> primaryClouds = new ArrayList<String>(); List<String> secondaryClouds = new ArrayList<String>(); List<String> offlineClouds = new ArrayList<S... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public PlatformHADRRecord setCloudCategories(PlatformHADRRecord platformHADRRecord, Map<String, Cloud> clouds) { List<String> activeClouds = new ArrayList<String>(); List<String> primaryClouds = new ArrayList<String>(); List<String> secondaryClouds = new ArrayLi... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public PlatformHADRRecord setCloudCategories(PlatformHADRRecord platformHADRRecord, Map<String, Cloud> clouds) { List<String> activeClouds = new ArrayList<String>(); List<String> primaryClouds = new ArrayList<String>(); List<String> secondaryClouds = new ArrayLi... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public PlatformHADRRecord setCloudCategories(PlatformHADRRecord platformHADRRecord, Map<String, Cloud> clouds) { List<String> activeClouds = new ArrayList<String>(); List<String> primaryClouds = new ArrayList<String>(); List<String> secondaryClouds = new ArrayLi... | PlatformHADRCrawlerPlugin extends AbstractCrawlerPlugin { public PlatformHADRRecord setCloudCategories(PlatformHADRRecord platformHADRRecord, Map<String, Cloud> clouds) { List<String> activeClouds = new ArrayList<String>(); List<String> primaryClouds = new ArrayList<String>(); List<String> secondaryClouds = new ArrayLi... |
@Test(priority=2) public void testInitAfterSetup() throws Exception { SensorPublisher publisher = new SensorPublisher(); setIntoEnvVariables(); try { publisher.init(); } catch (JMSException e) { logger.info("I expected this, and yes I caught it " + e.getMessage()); throw e; } finally { setIntoEnvVariables(); } } | public void init() throws JMSException { Properties properties = new Properties(); try { properties.load(this.getClass().getResourceAsStream("/sink.properties")); } catch (IOException e) { logger.error("got: " + e.getMessage()); } user = properties.getProperty("amq.user"); password = System.getenv("KLOOPZ_AMQ_PASS"); i... | SensorPublisher { public void init() throws JMSException { Properties properties = new Properties(); try { properties.load(this.getClass().getResourceAsStream("/sink.properties")); } catch (IOException e) { logger.error("got: " + e.getMessage()); } user = properties.getProperty("amq.user"); password = System.getenv("KL... | SensorPublisher { public void init() throws JMSException { Properties properties = new Properties(); try { properties.load(this.getClass().getResourceAsStream("/sink.properties")); } catch (IOException e) { logger.error("got: " + e.getMessage()); } user = properties.getProperty("amq.user"); password = System.getenv("KL... | SensorPublisher { public void init() throws JMSException { Properties properties = new Properties(); try { properties.load(this.getClass().getResourceAsStream("/sink.properties")); } catch (IOException e) { logger.error("got: " + e.getMessage()); } user = properties.getProperty("amq.user"); password = System.getenv("KL... | SensorPublisher { public void init() throws JMSException { Properties properties = new Properties(); try { properties.load(this.getClass().getResourceAsStream("/sink.properties")); } catch (IOException e) { logger.error("got: " + e.getMessage()); } user = properties.getProperty("amq.user"); password = System.getenv("KL... |
@Test(priority=3, expectedExceptions = CmsAuthException.class) public void addConnectionBadPasswordTest() throws Exception{ try { this.oneopsAuthBroker.addConnection(connectionContextMock, connectionBadInfo); } catch (CmsAuthException e) { throw(e); } catch (Exception ee){ throw(ee); } } | public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getRemoteAddress() + ", User: " + usr + ", C... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... |
@Test(priority=3, expectedExceptions = CmsAuthException.class) public void addConnectionNullUserTest() throws Exception{ ConnectionInfo connWithNullUser = mock(ConnectionInfo.class); when(connWithNullUser.getClientId()).thenReturn(MOCK_CLIENT_ID); when(connWithNullUser.getUserName()).thenReturn(null); when(connWithNull... | public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getRemoteAddress() + ", User: " + usr + ", C... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... |
@Test(priority=3, expectedExceptions = CmsAuthException.class) public void addConnectionNullCloudTest() throws Exception{ Broker broker = mock(Broker.class); CMSClient oddClient = mock(CMSClient.class); CmsCISimple cmsCISimple = new CmsCISimple(); Map<String, String> ciAttributes = new HashMap<String, String>(1); ciAtt... | public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getRemoteAddress() + ", User: " + usr + ", C... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... |
@Test(priority=4) public void addConnectionTest(){ try { this.oneopsAuthBroker.addConnection(connectionContextMock, connectionInfoUser); } catch (Exception e) { logger.warn("caught exception, make sure Broker is mocked",e); throw new RuntimeException(e); } } | public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getRemoteAddress() + ", User: " + usr + ", C... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... | OneopsAuthBroker extends BrokerFilter { public void addConnection(ConnectionContext context, ConnectionInfo info) throws Exception { String clientId = info.getClientId(); String usr = info.getUserName(); String pass = info.getPassword(); logger.info("Add new connection { Remote Address: " + context.getConnection().getR... |
@Test(priority=5, expectedExceptions=RuntimeException.class) public void addConsumerTestDenied(){ try { this.oneopsAuthBroker.addConsumer(connectionContextMock, consumerInfo); } catch (Exception e) { logger.warn("caught exception, make sure Broker is mocked",e); throw new RuntimeException(e); } } | public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { ActiveMQDestination dest = info.getDestination(); Connection conn = context.getConnection(); if (dest != null) { String destName = info.getDestination().getPhysicalName(); String clientId = context.getClientId(); String all... | OneopsAuthBroker extends BrokerFilter { public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { ActiveMQDestination dest = info.getDestination(); Connection conn = context.getConnection(); if (dest != null) { String destName = info.getDestination().getPhysicalName(); String clie... | OneopsAuthBroker extends BrokerFilter { public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { ActiveMQDestination dest = info.getDestination(); Connection conn = context.getConnection(); if (dest != null) { String destName = info.getDestination().getPhysicalName(); String clie... | OneopsAuthBroker extends BrokerFilter { public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { ActiveMQDestination dest = info.getDestination(); Connection conn = context.getConnection(); if (dest != null) { String destName = info.getDestination().getPhysicalName(); String clie... | OneopsAuthBroker extends BrokerFilter { public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { ActiveMQDestination dest = info.getDestination(); Connection conn = context.getConnection(); if (dest != null) { String destName = info.getDestination().getPhysicalName(); String clie... |
@Test(priority=5) public void addConsumerTest(){ ActiveMQDestination activeMQDestinationMQ = ActiveMQDestination.createDestination("mockMQDestionation", (byte) 1 ); activeMQDestinationMQ.setPhysicalName(MQ_PHYSICAL_NAME); ConsumerInfo consumerInfoActiveMQ = mock(ConsumerInfo.class); when(consumerInfoActiveMQ.getDestina... | public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { ActiveMQDestination dest = info.getDestination(); Connection conn = context.getConnection(); if (dest != null) { String destName = info.getDestination().getPhysicalName(); String clientId = context.getClientId(); String all... | OneopsAuthBroker extends BrokerFilter { public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { ActiveMQDestination dest = info.getDestination(); Connection conn = context.getConnection(); if (dest != null) { String destName = info.getDestination().getPhysicalName(); String clie... | OneopsAuthBroker extends BrokerFilter { public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { ActiveMQDestination dest = info.getDestination(); Connection conn = context.getConnection(); if (dest != null) { String destName = info.getDestination().getPhysicalName(); String clie... | OneopsAuthBroker extends BrokerFilter { public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { ActiveMQDestination dest = info.getDestination(); Connection conn = context.getConnection(); if (dest != null) { String destName = info.getDestination().getPhysicalName(); String clie... | OneopsAuthBroker extends BrokerFilter { public Subscription addConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { ActiveMQDestination dest = info.getDestination(); Connection conn = context.getConnection(); if (dest != null) { String destName = info.getDestination().getPhysicalName(); String clie... |
@Test(priority = 6) public void addProducerTest() { try { this.oneopsAuthBroker.addProducer(connectionContextMock, producerInfo); } catch (Exception e) { logger.warn("caught exception, make sure Broker is mocked",e); throw new RuntimeException(e); } } | public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { Connection conn = context.getConnection(); ActiveMQDestination dest = info.getDestination(); if (dest != null) { String destName = dest.getPhysicalName(); String clientId = context.getClientId(); logger.info(">>> Got Producer Add r... | OneopsAuthBroker extends BrokerFilter { public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { Connection conn = context.getConnection(); ActiveMQDestination dest = info.getDestination(); if (dest != null) { String destName = dest.getPhysicalName(); String clientId = context.getClientI... | OneopsAuthBroker extends BrokerFilter { public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { Connection conn = context.getConnection(); ActiveMQDestination dest = info.getDestination(); if (dest != null) { String destName = dest.getPhysicalName(); String clientId = context.getClientI... | OneopsAuthBroker extends BrokerFilter { public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { Connection conn = context.getConnection(); ActiveMQDestination dest = info.getDestination(); if (dest != null) { String destName = dest.getPhysicalName(); String clientId = context.getClientI... | OneopsAuthBroker extends BrokerFilter { public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { Connection conn = context.getConnection(); ActiveMQDestination dest = info.getDestination(); if (dest != null) { String destName = dest.getPhysicalName(); String clientId = context.getClientI... |
@Test(priority = 6, expectedExceptions = RuntimeException.class) public void addProducerTestProducerDenied() { ConnectionContext ccForbidden = mock(ConnectionContext.class); when(ccForbidden.getClientId()).thenReturn("this-is-not-in-user-map"); final Connection connectionMock = mock(Connection.class); when(connectionMo... | public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { Connection conn = context.getConnection(); ActiveMQDestination dest = info.getDestination(); if (dest != null) { String destName = dest.getPhysicalName(); String clientId = context.getClientId(); logger.info(">>> Got Producer Add r... | OneopsAuthBroker extends BrokerFilter { public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { Connection conn = context.getConnection(); ActiveMQDestination dest = info.getDestination(); if (dest != null) { String destName = dest.getPhysicalName(); String clientId = context.getClientI... | OneopsAuthBroker extends BrokerFilter { public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { Connection conn = context.getConnection(); ActiveMQDestination dest = info.getDestination(); if (dest != null) { String destName = dest.getPhysicalName(); String clientId = context.getClientI... | OneopsAuthBroker extends BrokerFilter { public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { Connection conn = context.getConnection(); ActiveMQDestination dest = info.getDestination(); if (dest != null) { String destName = dest.getPhysicalName(); String clientId = context.getClientI... | OneopsAuthBroker extends BrokerFilter { public void addProducer(ConnectionContext context, ProducerInfo info) throws Exception { Connection conn = context.getConnection(); ActiveMQDestination dest = info.getDestination(); if (dest != null) { String destName = dest.getPhysicalName(); String clientId = context.getClientI... |
@Test(priority=1) public void initializationTests(){ this.cmsClient.setServiceUrl(SERVICE_URL); CmsAuthException tryConstructorResult = new CmsAuthException(); Assert.assertNotNull(tryConstructorResult); CmsAuthException e = new CmsAuthException(); Assert.assertNotNull(e); } | public void setServiceUrl(String serviceUrl) { this.serviceUrl = serviceUrl; } | CMSClient { public void setServiceUrl(String serviceUrl) { this.serviceUrl = serviceUrl; } } | CMSClient { public void setServiceUrl(String serviceUrl) { this.serviceUrl = serviceUrl; } } | CMSClient { public void setServiceUrl(String serviceUrl) { this.serviceUrl = serviceUrl; } void setRestTemplate(RestTemplate restTemplate); void setServiceUrl(String serviceUrl); CmsCISimple _getZoneCi(String ns, String ciName); CmsCISimple getCloudCi(String ns, String ciName); } | CMSClient { public void setServiceUrl(String serviceUrl) { this.serviceUrl = serviceUrl; } void setRestTemplate(RestTemplate restTemplate); void setServiceUrl(String serviceUrl); CmsCISimple _getZoneCi(String ns, String ciName); CmsCISimple getCloudCi(String ns, String ciName); } |
@Test public void testEvent(){ OpsEvent oe = new OpsEvent(); oe.setBucket(BUCKET); oe.setCiId(CI_ID); oe.setCiState(CI_STATE); oe.setManifestId(CI_MANIFEST_ID); oe.setSource(CI_SOURCE); oe.setType(CI_TYPE); oe.setTimestamp(CI_TIMESTAMP); PerfEventPayload metrics = new PerfEventPayload(); Map<String, Double> countMap = ... | public static OpsBaseEvent convert(OpsEvent oEvent) { OpsBaseEvent bEvent = new OpsBaseEvent(); bEvent.setCiId(oEvent.getCiId()); bEvent.setBucket(oEvent.getBucket()); bEvent.setCiState(oEvent.getCiState()); bEvent.setName(oEvent.getName()); bEvent.setManifestId(oEvent.getManifestId()); bEvent.setSource(oEvent.getSourc... | EventConverter { public static OpsBaseEvent convert(OpsEvent oEvent) { OpsBaseEvent bEvent = new OpsBaseEvent(); bEvent.setCiId(oEvent.getCiId()); bEvent.setBucket(oEvent.getBucket()); bEvent.setCiState(oEvent.getCiState()); bEvent.setName(oEvent.getName()); bEvent.setManifestId(oEvent.getManifestId()); bEvent.setSourc... | EventConverter { public static OpsBaseEvent convert(OpsEvent oEvent) { OpsBaseEvent bEvent = new OpsBaseEvent(); bEvent.setCiId(oEvent.getCiId()); bEvent.setBucket(oEvent.getBucket()); bEvent.setCiState(oEvent.getCiState()); bEvent.setName(oEvent.getName()); bEvent.setManifestId(oEvent.getManifestId()); bEvent.setSourc... | EventConverter { public static OpsBaseEvent convert(OpsEvent oEvent) { OpsBaseEvent bEvent = new OpsBaseEvent(); bEvent.setCiId(oEvent.getCiId()); bEvent.setBucket(oEvent.getBucket()); bEvent.setCiState(oEvent.getCiState()); bEvent.setName(oEvent.getName()); bEvent.setManifestId(oEvent.getManifestId()); bEvent.setSourc... | EventConverter { public static OpsBaseEvent convert(OpsEvent oEvent) { OpsBaseEvent bEvent = new OpsBaseEvent(); bEvent.setCiId(oEvent.getCiId()); bEvent.setBucket(oEvent.getBucket()); bEvent.setCiState(oEvent.getCiState()); bEvent.setName(oEvent.getName()); bEvent.setManifestId(oEvent.getManifestId()); bEvent.setSourc... |
@Test public void mustHaveDestination() throws ArchiverException, IOException { try { new Iso9660Archiver().execute(); fail("Should have noticed the destination was missing"); } catch (Iso9660ArchiverException e) { assertEquals(Iso9660ArchiverException.Type.MissingDestination, e.getType()); } } | @Override protected void execute() throws ArchiverException, IOException { File dest = getDestFile(); if (dest == null) { throw new Iso9660ArchiverException( Iso9660ArchiverException.Type.MissingDestination, "You must set the destination " + getArchiveType() + " file."); } if (dest.exists() && !dest.isFile()) { throw n... | Iso9660Archiver extends AbstractArchiver { @Override protected void execute() throws ArchiverException, IOException { File dest = getDestFile(); if (dest == null) { throw new Iso9660ArchiverException( Iso9660ArchiverException.Type.MissingDestination, "You must set the destination " + getArchiveType() + " file."); } if ... | Iso9660Archiver extends AbstractArchiver { @Override protected void execute() throws ArchiverException, IOException { File dest = getDestFile(); if (dest == null) { throw new Iso9660ArchiverException( Iso9660ArchiverException.Type.MissingDestination, "You must set the destination " + getArchiveType() + " file."); } if ... | Iso9660Archiver extends AbstractArchiver { @Override protected void execute() throws ArchiverException, IOException { File dest = getDestFile(); if (dest == null) { throw new Iso9660ArchiverException( Iso9660ArchiverException.Type.MissingDestination, "You must set the destination " + getArchiveType() + " file."); } if ... | Iso9660Archiver extends AbstractArchiver { @Override protected void execute() throws ArchiverException, IOException { File dest = getDestFile(); if (dest == null) { throw new Iso9660ArchiverException( Iso9660ArchiverException.Type.MissingDestination, "You must set the destination " + getArchiveType() + " file."); } if ... |
@Test public void shouldReadAllBytesWhenSeekableInputPartiallyReads() throws IOException { SeekableInputFile input = new PartiallyReadSeekableInput(); Iso9660FileSystem fs = new Iso9660FileSystem(input, true); Iso9660FileEntry entry = Iterables.getLast(fs); byte[] bytes = fs.getBytes(entry); assertThat("All bytes shoul... | byte[] getBytes(Iso9660FileEntry entry) throws IOException { int size = (int) entry.getSize(); byte[] buf = new byte[size]; readBytes(entry, 0, buf, 0, size); return buf; } | Iso9660FileSystem extends AbstractBlockFileSystem<Iso9660FileEntry> { byte[] getBytes(Iso9660FileEntry entry) throws IOException { int size = (int) entry.getSize(); byte[] buf = new byte[size]; readBytes(entry, 0, buf, 0, size); return buf; } } | Iso9660FileSystem extends AbstractBlockFileSystem<Iso9660FileEntry> { byte[] getBytes(Iso9660FileEntry entry) throws IOException { int size = (int) entry.getSize(); byte[] buf = new byte[size]; readBytes(entry, 0, buf, 0, size); return buf; } Iso9660FileSystem(File file, boolean readOnly); Iso9660FileSystem(SeekableIn... | Iso9660FileSystem extends AbstractBlockFileSystem<Iso9660FileEntry> { byte[] getBytes(Iso9660FileEntry entry) throws IOException { int size = (int) entry.getSize(); byte[] buf = new byte[size]; readBytes(entry, 0, buf, 0, size); return buf; } Iso9660FileSystem(File file, boolean readOnly); Iso9660FileSystem(SeekableIn... | Iso9660FileSystem extends AbstractBlockFileSystem<Iso9660FileEntry> { byte[] getBytes(Iso9660FileEntry entry) throws IOException { int size = (int) entry.getSize(); byte[] buf = new byte[size]; readBytes(entry, 0, buf, 0, size); return buf; } Iso9660FileSystem(File file, boolean readOnly); Iso9660FileSystem(SeekableIn... |
@Test public void testGetArchiveType() { assertEquals("iso9660", new Iso9660Archiver().getArchiveType()); } | @Override protected String getArchiveType() { return "iso9660"; } | Iso9660Archiver extends AbstractArchiver { @Override protected String getArchiveType() { return "iso9660"; } } | Iso9660Archiver extends AbstractArchiver { @Override protected String getArchiveType() { return "iso9660"; } } | Iso9660Archiver extends AbstractArchiver { @Override protected String getArchiveType() { return "iso9660"; } String getSystemId(); void setSystemId(String systemId); String getVolumeId(); void setVolumeId(String volumeId); String getVolumeSetId(); void setVolumeSetId(String volumeSetId); String getPublisher(); void se... | Iso9660Archiver extends AbstractArchiver { @Override protected String getArchiveType() { return "iso9660"; } String getSystemId(); void setSystemId(String systemId); String getVolumeId(); void setVolumeId(String volumeId); String getVolumeSetId(); void setVolumeSetId(String volumeSetId); String getPublisher(); void se... |
@Test public void canCreateAnEmptyIso() throws Exception { File outfile = new File(workDir, "empty.iso"); ISO9660RootDirectory.MOVED_DIRECTORIES_STORE_NAME = "rr_moved"; ISO9660RootDirectory root = new ISO9660RootDirectory(); StreamHandler streamHandler = new ISOImageFileHandler(outfile); CreateISO iso = new CreateISO(... | public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandler).setPadEn... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... |
@Test public void canCreateAnIsoWithOneFile() throws Exception { final String contentString = "This is a test file"; File outfile = new File(workDir, "one-file.iso"); File contents = new File(workDir, "readme.txt"); OutputStream os = new FileOutputStream(contents); IOUtil.copy(contentString, os); IOUtil.close(os); ISO9... | public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandler).setPadEn... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... |
@Test public void canCreateAnIsoWithSomeFiles() throws Exception { File outfile = new File(workDir, "test.iso"); File contentsA = new File(workDir, "a.txt"); OutputStream os = new FileOutputStream(contentsA); IOUtil.copy("Hello", os); IOUtil.close(os); File contentsB = new File(workDir, "b.txt"); os = new FileOutputStr... | public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandler).setPadEn... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... |
@Test public void canCreateAnIsoWithLoadsOfFiles() throws Exception { final int numFiles = entropy.nextInt(50) + 50; File outfile = new File(workDir, "big.iso"); File rootDir = new File(workDir, "big"); assertThat(rootDir.isDirectory() || rootDir.mkdirs(), is(true)); ISO9660RootDirectory.MOVED_DIRECTORIES_STORE_NAME = ... | public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandler).setPadEn... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... |
@Test public void canCreateAnIsoTopDownHierarchy() throws Exception { File outfile = new File(workDir, "test.iso"); File contentsA = new File(workDir, "a.txt"); OutputStream os = new FileOutputStream(contentsA); IOUtil.copy("Hello", os); IOUtil.close(os); File contentsB = new File(workDir, "b.txt"); os = new FileOutput... | public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandler).setPadEn... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... |
@Test public void canCreateAnIsoBottomUpHierarchy() throws Exception { File outfile = new File(workDir, "test.iso"); File contentsA = new File(workDir, "a.txt"); OutputStream os = new FileOutputStream(contentsA); IOUtil.copy("Hello", os); IOUtil.close(os); File contentsB = new File(workDir, "b.txt"); os = new FileOutpu... | public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandler).setPadEn... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... |
@Test public void cahShortenLongFileNames() throws Exception { File outfile = new File(workDir, "64chars.iso"); ISO9660RootDirectory root = new ISO9660RootDirectory(); root.addFile(new ISO9660File(new ByteArrayDataReference("Hello, world!".getBytes(StandardCharsets.UTF_8)) , "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... | public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandler).setPadEn... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... |
@Test public void canFailOnTruncatedName() throws Exception { File outfile = new File(workDir, "truncate.iso"); ISO9660RootDirectory root = new ISO9660RootDirectory(); root.addFile(new ISO9660File(new ByteArrayDataReference("Hello, world!".getBytes(StandardCharsets.UTF_8)) , "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... | public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandler).setPadEn... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... | CreateISO { public void process(ISO9660Config iso9660Config, RockRidgeConfig rrConfig, JolietConfig jolietConfig, ElToritoConfig elToritoConfig) throws HandlerException { if (iso9660Config == null) { throw new NullPointerException("Cannot create ISO without ISO9660Config."); } ((LogicalSectorPaddingHandler) streamHandl... |
@Test public void testGenerateKey()throws Exception { Map<String, Object> keys= RSAUtils.getKeys(); RSAPublicKey rsaPublicKey=(RSAPublicKey)keys.get("public"); System.out.println(rsaPublicKey.getAlgorithm()); System.out.println(rsaPublicKey.toString()); } | public static Map<String, Object> getKeys() throws NoSuchAlgorithmException { Map<String, Object> map = new HashMap<>(); KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); keyPairGen.initialize(1024); KeyPair keyPair = keyPairGen.generateKeyPair(); RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPubl... | RSAUtils { public static Map<String, Object> getKeys() throws NoSuchAlgorithmException { Map<String, Object> map = new HashMap<>(); KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); keyPairGen.initialize(1024); KeyPair keyPair = keyPairGen.generateKeyPair(); RSAPublicKey publicKey = (RSAPublicKey) keyP... | RSAUtils { public static Map<String, Object> getKeys() throws NoSuchAlgorithmException { Map<String, Object> map = new HashMap<>(); KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); keyPairGen.initialize(1024); KeyPair keyPair = keyPairGen.generateKeyPair(); RSAPublicKey publicKey = (RSAPublicKey) keyP... | RSAUtils { public static Map<String, Object> getKeys() throws NoSuchAlgorithmException { Map<String, Object> map = new HashMap<>(); KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); keyPairGen.initialize(1024); KeyPair keyPair = keyPairGen.generateKeyPair(); RSAPublicKey publicKey = (RSAPublicKey) keyP... | RSAUtils { public static Map<String, Object> getKeys() throws NoSuchAlgorithmException { Map<String, Object> map = new HashMap<>(); KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); keyPairGen.initialize(1024); KeyPair keyPair = keyPairGen.generateKeyPair(); RSAPublicKey publicKey = (RSAPublicKey) keyP... |
@Test public void testGeneratePassword() { String keys=RandomKeysUtil.getRandomString(128); System.out.println(keys); Assert.assertTrue(keys.length()==128); } | public static String getRandomString(int length) { Random random = new Random(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < length; i++) { int number = random.nextInt(base.length()); sb.append(base.charAt(number)); } return sb.toString(); } | RandomKeysUtil { public static String getRandomString(int length) { Random random = new Random(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < length; i++) { int number = random.nextInt(base.length()); sb.append(base.charAt(number)); } return sb.toString(); } } | RandomKeysUtil { public static String getRandomString(int length) { Random random = new Random(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < length; i++) { int number = random.nextInt(base.length()); sb.append(base.charAt(number)); } return sb.toString(); } } | RandomKeysUtil { public static String getRandomString(int length) { Random random = new Random(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < length; i++) { int number = random.nextInt(base.length()); sb.append(base.charAt(number)); } return sb.toString(); } static String getRandomString(int length); } | RandomKeysUtil { public static String getRandomString(int length) { Random random = new Random(); StringBuffer sb = new StringBuffer(); for (int i = 0; i < length; i++) { int number = random.nextInt(base.length()); sb.append(base.charAt(number)); } return sb.toString(); } static String getRandomString(int length); } |
@Test(expected = IllegalArgumentException.class) public void duplicatePlaceholderTest() { final HelperPlaceholder placeholder = new HelperPlaceholder("dummy", null); PlaceHolderManager.registerPlaceholder(placeholder, placeholder); } | public static void registerPlaceholder(BungeeChatPlaceHolder... placeholder) { for (BungeeChatPlaceHolder p : placeholder) { registerPlaceholder(p); } } | PlaceHolderManager { public static void registerPlaceholder(BungeeChatPlaceHolder... placeholder) { for (BungeeChatPlaceHolder p : placeholder) { registerPlaceholder(p); } } } | PlaceHolderManager { public static void registerPlaceholder(BungeeChatPlaceHolder... placeholder) { for (BungeeChatPlaceHolder p : placeholder) { registerPlaceholder(p); } } } | PlaceHolderManager { public static void registerPlaceholder(BungeeChatPlaceHolder... placeholder) { for (BungeeChatPlaceHolder p : placeholder) { registerPlaceholder(p); } } static Stream<BungeeChatPlaceHolder> getPlaceholderStream(); static Stream<BungeeChatPlaceHolder> getApplicableStream(BungeeChatContext context);... | PlaceHolderManager { public static void registerPlaceholder(BungeeChatPlaceHolder... placeholder) { for (BungeeChatPlaceHolder p : placeholder) { registerPlaceholder(p); } } static Stream<BungeeChatPlaceHolder> getPlaceholderStream(); static Stream<BungeeChatPlaceHolder> getApplicableStream(BungeeChatContext context);... |
@Test(timeout = TIMEOUT) public void escapeTest() { final String message = "Test %% Test"; assertEquals("Test % Test", PlaceHolderManager.processMessage(message, EMPTY_CONTEXT)); } | public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placeholders); return builder.... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... |
@Test(timeout = TIMEOUT) public void hangingPlaceholderTest() { final String message = "Test %xxx"; assertEquals(message, PlaceHolderManager.processMessage(message, EMPTY_CONTEXT)); } | public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placeholders); return builder.... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... |
@Test(timeout = TIMEOUT) public void hangingDelimiterTest() { final String message = "Test %"; assertEquals(message, PlaceHolderManager.processMessage(message, EMPTY_CONTEXT)); } | public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placeholders); return builder.... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... |
@Test(timeout = TIMEOUT) public void unknownPlaceholderTest() { final String message = "Test %xxx% %hi%"; assertEquals(message, PlaceHolderManager.processMessage(message, EMPTY_CONTEXT)); } | public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placeholders); return builder.... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... |
@Test(timeout = TIMEOUT) public void placeholderTest() { final String message = "Test %test% Test"; assertEquals("Test HAIII Test", PlaceHolderManager.processMessage(message, EMPTY_CONTEXT)); } | public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placeholders); return builder.... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... |
@Test(timeout = TIMEOUT) public void recusivePlaceholderTest() { final String message = "Test %recursive2% Test"; assertEquals( "Test hihi xxx HAIII xxx hihi Test", PlaceHolderManager.processMessage(message, EMPTY_CONTEXT)); } | public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placeholders); return builder.... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... | PlaceHolderManager { public static String processMessage(String message, BungeeChatContext context) { final StringBuilder builder = new StringBuilder(); final List<BungeeChatPlaceHolder> placeholders = getApplicableStream(context).collect(Collectors.toList()); processMessageInternal(message, context, builder, placehold... |
@Test public void callRealClient_NotInRegistry() throws Exception { givenEndpointInRegistry(false); testee.execute(REQUEST); verifyRealClientCalled(); verifyZeroInteractions(lookupFunction); } | @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } } | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } MockableClient(Registry registry,
Client realClient,
Cli... | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } MockableClient(Registry registry,
Client realClient,
Cli... | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } MockableClient(Registry registry,
Client realClient,
Cli... |
@Test public void callRealClient_WhenLookupFalse_InRegistry() throws Exception { givenEndpointInRegistry(true); givenWhenFunctionReturns(false); testee.execute(REQUEST); verifyRealClientCalled(); } | @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } } | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } MockableClient(Registry registry,
Client realClient,
Cli... | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } MockableClient(Registry registry,
Client realClient,
Cli... | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } MockableClient(Registry registry,
Client realClient,
Cli... |
@Test public void callMockClient_WhenLookupTrue_InRegistry() throws Exception { givenEndpointInRegistry(true); givenWhenFunctionReturns(true); testee.execute(REQUEST); verifyMockClientCalled(); } | @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } } | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } MockableClient(Registry registry,
Client realClient,
Cli... | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } MockableClient(Registry registry,
Client realClient,
Cli... | MockableClient implements Client { @Override public Response execute(Request request) throws IOException { if (shouldMockRequest(request)) { return mockClient.execute(request); } else { return realClient.execute(request); } } MockableClient(Registry registry,
Client realClient,
Cli... |
@Test public void replaceUrl() throws Exception { Request request = new Request("GET", "https: testee.execute(request); verify(realClient).execute(argThat(new ArgumentMatcher<Request>() { @Override public boolean matches(Request argument) { return argument.getUrl().equals("http: } })); } | @Override public Response execute(Request request) throws IOException { return realClient.execute( withReplacedEndpoint(request) ); } | ReplaceEndpointClient implements Client { @Override public Response execute(Request request) throws IOException { return realClient.execute( withReplacedEndpoint(request) ); } } | ReplaceEndpointClient implements Client { @Override public Response execute(Request request) throws IOException { return realClient.execute( withReplacedEndpoint(request) ); } ReplaceEndpointClient(String newEndpoint,
Client realClient); } | ReplaceEndpointClient implements Client { @Override public Response execute(Request request) throws IOException { return realClient.execute( withReplacedEndpoint(request) ); } ReplaceEndpointClient(String newEndpoint,
Client realClient); @Override Response execute(Request request); } | ReplaceEndpointClient implements Client { @Override public Response execute(Request request) throws IOException { return realClient.execute( withReplacedEndpoint(request) ); } ReplaceEndpointClient(String newEndpoint,
Client realClient); @Override Response execute(Request request); } |
@Test public void inRegistry_Yes_PartialMatch() throws Exception { MocksRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); } | public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ... | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ... |
@Test public void inRegistry_Yes_PathParameters() throws Exception { MocksRegistry.setRegistry(new HashSet<>(asList( "/path3/{parameterA}/{parameterB}", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); } | public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ... | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ... |
@Test public void inRegistry_Yes_QueryParameters() throws Exception { MocksRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertTrue(result); } | public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ... | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ... |
@Test public void inRegistry_No() throws Exception { MocksRegistry.setRegistry(new HashSet<>(asList( "/path3/path4", "/path1/path2" ))); boolean result = testee.isInRegistry("http: assertFalse(result); } | public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); } | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ... | Registry { public boolean isInRegistry(String url) { if (getMockedEndpointsMethod == null) { return false; } Set<String> mockedEndpoints = getMockedEndpoints(); for (String endpoint : mockedEndpoints) { if (endpointMatches(endpoint, url)) { return true; } } return false; } Registry(); boolean isInRegistry(String url); ... |
@Test public void testGetSha1Url() throws Exception { assertThat(Resolver.getSha1Url("http: .isEqualTo("http: assertThat(Resolver.getSha1Url("http: .isEqualTo("http: } | static String getSha1Url(String url, String extension) { return url.replaceAll(".pom$", "." + extension + ".sha1"); } | Resolver { static String getSha1Url(String url, String extension) { return url.replaceAll(".pom$", "." + extension + ".sha1"); } } | Resolver { static String getSha1Url(String url, String extension) { return url.replaceAll(".pom$", "." + extension + ".sha1"); } @VisibleForTesting Resolver(
DefaultModelResolver modelResolver, VersionResolver versionResolver, List<Rule> aliases); Resolver(DefaultModelResolver resolver, List<Rule> aliases); } | Resolver { static String getSha1Url(String url, String extension) { return url.replaceAll(".pom$", "." + extension + ".sha1"); } @VisibleForTesting Resolver(
DefaultModelResolver modelResolver, VersionResolver versionResolver, List<Rule> aliases); Resolver(DefaultModelResolver resolver, List<Rule> aliases); Col... | Resolver { static String getSha1Url(String url, String extension) { return url.replaceAll(".pom$", "." + extension + ".sha1"); } @VisibleForTesting Resolver(
DefaultModelResolver modelResolver, VersionResolver versionResolver, List<Rule> aliases); Resolver(DefaultModelResolver resolver, List<Rule> aliases); Col... |
@Test public void selectsHighestVersion() throws InvalidArtifactCoordinateException, VersionRangeResolutionException { Aether aether = Mockito.mock(Aether.class); Artifact artifact; artifact = ArtifactBuilder.fromCoords("com.hello:something:[,)"); Mockito.when( aether.requestVersionRange(artifact)).thenReturn(newArrayL... | String resolveVersion(String groupId, String artifactId, String versionSpec) throws InvalidArtifactCoordinateException { List<String> versions; try { versions = requestVersionList(groupId, artifactId, versionSpec); } catch (VersionRangeResolutionException e) { String errorMessage = messageForInvalidArtifact(groupId, ar... | VersionResolver { String resolveVersion(String groupId, String artifactId, String versionSpec) throws InvalidArtifactCoordinateException { List<String> versions; try { versions = requestVersionList(groupId, artifactId, versionSpec); } catch (VersionRangeResolutionException e) { String errorMessage = messageForInvalidAr... | VersionResolver { String resolveVersion(String groupId, String artifactId, String versionSpec) throws InvalidArtifactCoordinateException { List<String> versions; try { versions = requestVersionList(groupId, artifactId, versionSpec); } catch (VersionRangeResolutionException e) { String errorMessage = messageForInvalidAr... | VersionResolver { String resolveVersion(String groupId, String artifactId, String versionSpec) throws InvalidArtifactCoordinateException { List<String> versions; try { versions = requestVersionList(groupId, artifactId, versionSpec); } catch (VersionRangeResolutionException e) { String errorMessage = messageForInvalidAr... | VersionResolver { String resolveVersion(String groupId, String artifactId, String versionSpec) throws InvalidArtifactCoordinateException { List<String> versions; try { versions = requestVersionList(groupId, artifactId, versionSpec); } catch (VersionRangeResolutionException e) { String errorMessage = messageForInvalidAr... |
@Test public void identifiesVersionRange() { assertThat(isVersionRange("[3]")).isTrue(); assertThat(isVersionRange("[3,4]")).isTrue(); assertThat(isVersionRange("[3,4)")).isTrue(); assertThat(isVersionRange("(3,4)")).isTrue(); assertThat(isVersionRange("(3,4]")).isTrue(); assertThat(isVersionRange("(,)")).isTrue(); ass... | @VisibleForTesting static boolean isVersionRange(String versionSpec) { return versionSpec.charAt(0) == '(' || versionSpec.charAt(0) == '['; } | VersionResolver { @VisibleForTesting static boolean isVersionRange(String versionSpec) { return versionSpec.charAt(0) == '(' || versionSpec.charAt(0) == '['; } } | VersionResolver { @VisibleForTesting static boolean isVersionRange(String versionSpec) { return versionSpec.charAt(0) == '(' || versionSpec.charAt(0) == '['; } VersionResolver(Aether aether); } | VersionResolver { @VisibleForTesting static boolean isVersionRange(String versionSpec) { return versionSpec.charAt(0) == '(' || versionSpec.charAt(0) == '['; } VersionResolver(Aether aether); static VersionResolver defaultResolver(); } | VersionResolver { @VisibleForTesting static boolean isVersionRange(String versionSpec) { return versionSpec.charAt(0) == '(' || versionSpec.charAt(0) == '['; } VersionResolver(Aether aether); static VersionResolver defaultResolver(); } |
@Test public void testHeaders() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); WorkspaceWriter writer = new WorkspaceWriter( new String[]{"--artifact=x:y:1.2.3", "--artifact=a:b:3.2.1"}, System.getenv("TEST_TMPDIR")); writer.writeWorkspace(ps, Sets.n... | public void writeWorkspace(PrintStream outputStream, Collection<Rule> rules) { writeHeader(outputStream, args); for (Rule rule : rules) { outputStream.println(formatMavenJar(rule, "maven_jar", "")); } } | WorkspaceWriter extends AbstractWriter { public void writeWorkspace(PrintStream outputStream, Collection<Rule> rules) { writeHeader(outputStream, args); for (Rule rule : rules) { outputStream.println(formatMavenJar(rule, "maven_jar", "")); } } } | WorkspaceWriter extends AbstractWriter { public void writeWorkspace(PrintStream outputStream, Collection<Rule> rules) { writeHeader(outputStream, args); for (Rule rule : rules) { outputStream.println(formatMavenJar(rule, "maven_jar", "")); } } WorkspaceWriter(String[] args, String outputDirStr); } | WorkspaceWriter extends AbstractWriter { public void writeWorkspace(PrintStream outputStream, Collection<Rule> rules) { writeHeader(outputStream, args); for (Rule rule : rules) { outputStream.println(formatMavenJar(rule, "maven_jar", "")); } } WorkspaceWriter(String[] args, String outputDirStr); @Override void write(Co... | WorkspaceWriter extends AbstractWriter { public void writeWorkspace(PrintStream outputStream, Collection<Rule> rules) { writeHeader(outputStream, args); for (Rule rule : rules) { outputStream.println(formatMavenJar(rule, "maven_jar", "")); } } WorkspaceWriter(String[] args, String outputDirStr); @Override void write(Co... |
@Test public void writeEmpty() throws Exception { BzlWriter writer = new BzlWriter(new String[]{}, System.getenv("TEST_TMPDIR")); writer.write(createRules()); String fileContents = Files.toString( new File(System.getenv("TEST_TMPDIR") + "/generate_workspace.bzl"), Charset.defaultCharset()); assertThat(fileContents).con... | @Override public void write(Collection<Rule> rules) { try { createParentDirectory(generatedFile); } catch (IOException | NullPointerException e) { logger.severe("Could not create directories for " + generatedFile + ": " + e.getMessage()); return; } try (PrintStream outputStream = new PrintStream(generatedFile.toFile())... | BzlWriter extends AbstractWriter { @Override public void write(Collection<Rule> rules) { try { createParentDirectory(generatedFile); } catch (IOException | NullPointerException e) { logger.severe("Could not create directories for " + generatedFile + ": " + e.getMessage()); return; } try (PrintStream outputStream = new ... | BzlWriter extends AbstractWriter { @Override public void write(Collection<Rule> rules) { try { createParentDirectory(generatedFile); } catch (IOException | NullPointerException e) { logger.severe("Could not create directories for " + generatedFile + ": " + e.getMessage()); return; } try (PrintStream outputStream = new ... | BzlWriter extends AbstractWriter { @Override public void write(Collection<Rule> rules) { try { createParentDirectory(generatedFile); } catch (IOException | NullPointerException e) { logger.severe("Could not create directories for " + generatedFile + ": " + e.getMessage()); return; } try (PrintStream outputStream = new ... | BzlWriter extends AbstractWriter { @Override public void write(Collection<Rule> rules) { try { createParentDirectory(generatedFile); } catch (IOException | NullPointerException e) { logger.severe("Could not create directories for " + generatedFile + ": " + e.getMessage()); return; } try (PrintStream outputStream = new ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.