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 public void testUpsertFailureWithEmptyIdentifier() { try { esService.update("test", "", new HashMap<>()); } catch (ProjectCommonException e) { assertEquals(e.getResponseCode(), ResponseCode.invalidData.getResponseCode()); } }
@Override public Future<Boolean> update(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:update: method started at ==" + startTime + " for Index " + index, LoggerEnum.PERF_LOG.name()); Promise<Boolean> promise = Futur...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> update(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:update: method started at ==" + startTime + " for Index " + index, L...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> update(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:update: method started at ==" + startTime + " for Index " + index, L...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> update(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:update: method started at ==" + startTime + " for Index " + index, L...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> update(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:update: method started at ==" + startTime + " for Index " + index, L...
@Test public void testBuilInsertSuccess() { mockRulesForBulk(false); List<Map<String, Object>> list = new ArrayList<>(); Map<String, Object> map = new HashMap<>(); map.put(JsonKey.IDENTIFIER, "0001"); list.add(map); Future<Boolean> result = esService.bulkInsert("test", list); boolean res = (boolean) ElasticSearchHelper...
@Override public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:bulkInsert: method started at ==" + startTime + " for Index " + index, LoggerEnum.PERF_LOG.name()); BulkRequest request = new BulkReq...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:bulkInsert: method started at ==" + startTime + " for Index " + index, Lo...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:bulkInsert: method started at ==" + startTime + " for Index " + index, Lo...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:bulkInsert: method started at ==" + startTime + " for Index " + index, Lo...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:bulkInsert: method started at ==" + startTime + " for Index " + index, Lo...
@Test public void resolveMigrations() { JavaMigrationResolver jdbcMigrationResolver = new JavaMigrationResolver( Thread.currentThread().getContextClassLoader(), new ScriptsLocation("com/contrastsecurity/cassandra/migration/resolver/java/dummy")); Collection<ResolvedMigration> migrations = jdbcMigrationResolver.resolveM...
public List<ResolvedMigration> resolveMigrations() { List<ResolvedMigration> migrations = new ArrayList<ResolvedMigration>(); if (!location.isClassPath()) { return migrations; } try { Class<?>[] classes = new Scanner(classLoader).scanForClasses(location, JavaMigration.class); for (Class<?> clazz : classes) { JavaMigrat...
JavaMigrationResolver implements MigrationResolver { public List<ResolvedMigration> resolveMigrations() { List<ResolvedMigration> migrations = new ArrayList<ResolvedMigration>(); if (!location.isClassPath()) { return migrations; } try { Class<?>[] classes = new Scanner(classLoader).scanForClasses(location, JavaMigratio...
JavaMigrationResolver implements MigrationResolver { public List<ResolvedMigration> resolveMigrations() { List<ResolvedMigration> migrations = new ArrayList<ResolvedMigration>(); if (!location.isClassPath()) { return migrations; } try { Class<?>[] classes = new Scanner(classLoader).scanForClasses(location, JavaMigratio...
JavaMigrationResolver implements MigrationResolver { public List<ResolvedMigration> resolveMigrations() { List<ResolvedMigration> migrations = new ArrayList<ResolvedMigration>(); if (!location.isClassPath()) { return migrations; } try { Class<?>[] classes = new Scanner(classLoader).scanForClasses(location, JavaMigratio...
JavaMigrationResolver implements MigrationResolver { public List<ResolvedMigration> resolveMigrations() { List<ResolvedMigration> migrations = new ArrayList<ResolvedMigration>(); if (!location.isClassPath()) { return migrations; } try { Class<?>[] classes = new Scanner(classLoader).scanForClasses(location, JavaMigratio...
@Test public void testBuilInsertFailure() { mockRulesForBulk(true); List<Map<String, Object>> list = new ArrayList<>(); Map<String, Object> map = new HashMap<>(); map.put(JsonKey.IDENTIFIER, "0001"); list.add(map); Future<Boolean> result = esService.bulkInsert("test", list); boolean res = (boolean) ElasticSearchHelper....
@Override public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:bulkInsert: method started at ==" + startTime + " for Index " + index, LoggerEnum.PERF_LOG.name()); BulkRequest request = new BulkReq...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:bulkInsert: method started at ==" + startTime + " for Index " + index, Lo...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:bulkInsert: method started at ==" + startTime + " for Index " + index, Lo...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:bulkInsert: method started at ==" + startTime + " for Index " + index, Lo...
ElasticSearchRestHighImpl implements ElasticSearchService { @Override public Future<Boolean> bulkInsert(String index, List<Map<String, Object>> dataList) { long startTime = System.currentTimeMillis(); ProjectLogger.log( "ElasticSearchRestHighImpl:bulkInsert: method started at ==" + startTime + " for Index " + index, Lo...
@Test public void testCreateDataSuccess() { mockRulesForInsert(); esService.save(INDEX_NAME, (String) chemistryMap.get("courseId"), chemistryMap); assertNotNull(chemistryMap.get("courseId")); esService.save(INDEX_NAME, (String) physicsMap.get("courseId"), physicsMap); assertNotNull(physicsMap.get("courseId")); }
@Override public Future<String> save(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); Promise<String> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:save: method started at ==" + startTime + " for Index " + index, LoggerEnum.PERF_LOG.name()...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<String> save(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); Promise<String> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:save: method started at ==" + startT...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<String> save(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); Promise<String> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:save: method started at ==" + startT...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<String> save(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); Promise<String> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:save: method started at ==" + startT...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<String> save(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); Promise<String> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:save: method started at ==" + startT...
@Test public void testGetByIdentifierSuccess() { Future<Map<String, Object>> responseMapF = esService.getDataByIdentifier(INDEX_NAME, (String) chemistryMap.get("courseId")); Map<String, Object> responseMap = (Map<String, Object>) ElasticSearchHelper.getResponseFromFuture(responseMapF); assertEquals(responseMap.get("cou...
@Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: method started at ==" + startTime + " for index " + ind...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
@Test public void testUpdateDataSuccess() { Map<String, Object> innermap = new HashMap<>(); innermap.put("courseName", "Updated course name"); innermap.put("organisationId", "updatedOrgId"); GetRequestBuilder grb = mock(GetRequestBuilder.class); GetResponse getResponse = mock(GetResponse.class); when(client.prepareGet(...
@Override public Future<Boolean> update(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); Promise<Boolean> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:update: method started at ==" + startTime + " for index " + index, LoggerEnum.PERF_LOG....
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Boolean> update(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); Promise<Boolean> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:update: method started at ==" + ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Boolean> update(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); Promise<Boolean> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:update: method started at ==" + ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Boolean> update(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); Promise<Boolean> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:update: method started at ==" + ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Boolean> update(String index, String identifier, Map<String, Object> data) { long startTime = System.currentTimeMillis(); Promise<Boolean> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:update: method started at ==" + ...
@Test @Ignore public void testComplexSearchSuccess() throws Exception { SearchDTO searchDTO = new SearchDTO(); List<String> fields = new ArrayList<String>(); fields.add("courseId"); fields.add("courseType"); fields.add("createdOn"); fields.add("description"); Map<String, Object> sortMap = new HashMap<>(); sortMap.put("...
@Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:search: method started at ==" + startTime, LoggerEnum.PERF_...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
@Test @Ignore public void testComplexSearchSuccessWithRangeGreaterThan() { SearchDTO searchDTO = new SearchDTO(); Map<String, Object> additionalProperties = new HashMap<String, Object>(); List<Integer> sizes = new ArrayList<Integer>(); sizes.add(10); sizes.add(20); Map<String, Object> filterMap = new HashMap<String, Ob...
@Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:search: method started at ==" + startTime, LoggerEnum.PERF_...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
@Test @Ignore public void testComplexSearchSuccessWithRangeLessThan() { SearchDTO searchDTO = new SearchDTO(); Map<String, Object> additionalProperties = new HashMap<String, Object>(); List<Integer> sizes = new ArrayList<Integer>(); sizes.add(10); sizes.add(20); Map<String, Object> filterMap = new HashMap<String, Objec...
@Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:search: method started at ==" + startTime, LoggerEnum.PERF_...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> search(SearchDTO searchDTO, String index) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); String[] indices = {index}; ProjectLogger.log( "ElasticSearchTcpImpl:sear...
@Test public void testGetByIdentifierFailureWithoutIndex() { try { esService.getDataByIdentifier(null, (String) chemistryMap.get("courseId")); } catch (ProjectCommonException ex) { assertEquals(ResponseCode.SERVER_ERROR.getResponseCode(), ex.getResponseCode()); } }
@Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: method started at ==" + startTime + " for index " + ind...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
@Test public void testGetByIdentifierFailureWithoutTypeAndIndexIdentifier() { try { esService.getDataByIdentifier(null, ""); } catch (ProjectCommonException ex) { assertEquals(ResponseCode.SERVER_ERROR.getResponseCode(), ex.getResponseCode()); } }
@Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: method started at ==" + startTime + " for index " + ind...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
@Test public void testGetDataByIdentifierFailureWithoutIdentifier() { Future<Map<String, Object>> responseMap = esService.getDataByIdentifier(INDEX_NAME, ""); Map<String, Object> map = (Map<String, Object>) ElasticSearchHelper.getResponseFromFuture(responseMap); assertEquals(0, map.size()); }
@Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: method started at ==" + startTime + " for index " + ind...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
ElasticSearchTcpImpl implements ElasticSearchService { @Override public Future<Map<String, Object>> getDataByIdentifier(String index, String identifier) { long startTime = System.currentTimeMillis(); Promise<Map<String, Object>> promise = Futures.promise(); ProjectLogger.log( "ElasticSearchTcpImpl:getDataByIdentifier: ...
@Test public void conventionOverConfiguration() { JavaMigrationResolver jdbcMigrationResolver = new JavaMigrationResolver(Thread.currentThread().getContextClassLoader(), null); ResolvedMigration migrationInfo = jdbcMigrationResolver.extractMigrationInfo(new V2__InterfaceBasedMigration()); assertEquals("2", migrationInf...
ResolvedMigration extractMigrationInfo(JavaMigration javaMigration) { Integer checksum = null; if (javaMigration instanceof MigrationChecksumProvider) { MigrationChecksumProvider checksumProvider = (MigrationChecksumProvider) javaMigration; checksum = checksumProvider.getChecksum(); } MigrationVersion version; String d...
JavaMigrationResolver implements MigrationResolver { ResolvedMigration extractMigrationInfo(JavaMigration javaMigration) { Integer checksum = null; if (javaMigration instanceof MigrationChecksumProvider) { MigrationChecksumProvider checksumProvider = (MigrationChecksumProvider) javaMigration; checksum = checksumProvide...
JavaMigrationResolver implements MigrationResolver { ResolvedMigration extractMigrationInfo(JavaMigration javaMigration) { Integer checksum = null; if (javaMigration instanceof MigrationChecksumProvider) { MigrationChecksumProvider checksumProvider = (MigrationChecksumProvider) javaMigration; checksum = checksumProvide...
JavaMigrationResolver implements MigrationResolver { ResolvedMigration extractMigrationInfo(JavaMigration javaMigration) { Integer checksum = null; if (javaMigration instanceof MigrationChecksumProvider) { MigrationChecksumProvider checksumProvider = (MigrationChecksumProvider) javaMigration; checksum = checksumProvide...
JavaMigrationResolver implements MigrationResolver { ResolvedMigration extractMigrationInfo(JavaMigration javaMigration) { Integer checksum = null; if (javaMigration instanceof MigrationChecksumProvider) { MigrationChecksumProvider checksumProvider = (MigrationChecksumProvider) javaMigration; checksum = checksumProvide...
@Test public void testGuess() { assertEquals(RDAPCLI.Type.AUTNUM,RDAPCLI.guessQueryType("12345")); assertEquals(RDAPCLI.Type.IP,RDAPCLI.guessQueryType("127.0.0.0/8")); assertEquals(RDAPCLI.Type.DOMAIN, RDAPCLI.guessQueryType("foo.example")); assertEquals(RDAPCLI.Type.ENTITY,RDAPCLI.guessQueryType("handle")); }
public static Type guessQueryType(String query) { try { if (query.matches("^\\d+$")) { return Type.AUTNUM; } if (query.matches("^[\\d\\.:/]+$")) { return Type.IP; } if (DomainName.of(query).getLevelSize() > 1) { return Type.DOMAIN; } return Type.ENTITY; } catch (IllegalArgumentException iae) { LOGGER.debug("Not a domai...
RDAPCLI { public static Type guessQueryType(String query) { try { if (query.matches("^\\d+$")) { return Type.AUTNUM; } if (query.matches("^[\\d\\.:/]+$")) { return Type.IP; } if (DomainName.of(query).getLevelSize() > 1) { return Type.DOMAIN; } return Type.ENTITY; } catch (IllegalArgumentException iae) { LOGGER.debug("N...
RDAPCLI { public static Type guessQueryType(String query) { try { if (query.matches("^\\d+$")) { return Type.AUTNUM; } if (query.matches("^[\\d\\.:/]+$")) { return Type.IP; } if (DomainName.of(query).getLevelSize() > 1) { return Type.DOMAIN; } return Type.ENTITY; } catch (IllegalArgumentException iae) { LOGGER.debug("N...
RDAPCLI { public static Type guessQueryType(String query) { try { if (query.matches("^\\d+$")) { return Type.AUTNUM; } if (query.matches("^[\\d\\.:/]+$")) { return Type.IP; } if (DomainName.of(query).getLevelSize() > 1) { return Type.DOMAIN; } return Type.ENTITY; } catch (IllegalArgumentException iae) { LOGGER.debug("N...
RDAPCLI { public static Type guessQueryType(String query) { try { if (query.matches("^\\d+$")) { return Type.AUTNUM; } if (query.matches("^[\\d\\.:/]+$")) { return Type.IP; } if (DomainName.of(query).getLevelSize() > 1) { return Type.DOMAIN; } return Type.ENTITY; } catch (IllegalArgumentException iae) { LOGGER.debug("N...
@Test public void testIsFQDN() { assertFalse(DomainName.of("www.example.com").isFQDN()); assertTrue(DomainName.of("www.example.com.").isFQDN()); }
public boolean isFQDN() { return labels.get(labels.size() - 1) instanceof Label.RootLabel; }
DomainName { public boolean isFQDN() { return labels.get(labels.size() - 1) instanceof Label.RootLabel; } }
DomainName { public boolean isFQDN() { return labels.get(labels.size() - 1) instanceof Label.RootLabel; } DomainName(List<Label> labels); }
DomainName { public boolean isFQDN() { return labels.get(labels.size() - 1) instanceof Label.RootLabel; } DomainName(List<Label> labels); static DomainName of(String domainName); DomainName toFQDN(); boolean isFQDN(); int getLevelSize(); List<Label> getLabels(); Label getTLDLabel(); String getStringValue(); Label getLe...
DomainName { public boolean isFQDN() { return labels.get(labels.size() - 1) instanceof Label.RootLabel; } DomainName(List<Label> labels); static DomainName of(String domainName); DomainName toFQDN(); boolean isFQDN(); int getLevelSize(); List<Label> getLabels(); Label getTLDLabel(); String getStringValue(); Label getLe...
@Test public void testToFQDN() { DomainName dn = DomainName.of("www.example.com"); assertEquals(4, dn.toFQDN().getLabels().size()); assertEquals("www.example.com.", dn.toFQDN().getStringValue()); }
public DomainName toFQDN() { if (isFQDN()) { return this; } return new DomainName(new ImmutableList.Builder<Label>().addAll(labels).add(Label.RootLabel.getInstance()).build()); }
DomainName { public DomainName toFQDN() { if (isFQDN()) { return this; } return new DomainName(new ImmutableList.Builder<Label>().addAll(labels).add(Label.RootLabel.getInstance()).build()); } }
DomainName { public DomainName toFQDN() { if (isFQDN()) { return this; } return new DomainName(new ImmutableList.Builder<Label>().addAll(labels).add(Label.RootLabel.getInstance()).build()); } DomainName(List<Label> labels); }
DomainName { public DomainName toFQDN() { if (isFQDN()) { return this; } return new DomainName(new ImmutableList.Builder<Label>().addAll(labels).add(Label.RootLabel.getInstance()).build()); } DomainName(List<Label> labels); static DomainName of(String domainName); DomainName toFQDN(); boolean isFQDN(); int getLevelSize...
DomainName { public DomainName toFQDN() { if (isFQDN()) { return this; } return new DomainName(new ImmutableList.Builder<Label>().addAll(labels).add(Label.RootLabel.getInstance()).build()); } DomainName(List<Label> labels); static DomainName of(String domainName); DomainName toFQDN(); boolean isFQDN(); int getLevelSize...
@Test public void shouldBePossibleToCreateUnvalidedPhoneNumber() throws URISyntaxException { Tel tel = Tel.unvalidatedTel("+29716"); assertNotNull(tel); assertEquals("tel:+29716", tel.getStringValue()); }
public static Tel unvalidatedTel(String telephoneNumber) throws URISyntaxException { return new Tel(new URI("tel:" + telephoneNumber)); }
Tel extends URIValue { public static Tel unvalidatedTel(String telephoneNumber) throws URISyntaxException { return new Tel(new URI("tel:" + telephoneNumber)); } }
Tel extends URIValue { public static Tel unvalidatedTel(String telephoneNumber) throws URISyntaxException { return new Tel(new URI("tel:" + telephoneNumber)); } private Tel(URI uri); Tel(TelephoneNumber telephoneNumber); Tel(String telephoneNumber); }
Tel extends URIValue { public static Tel unvalidatedTel(String telephoneNumber) throws URISyntaxException { return new Tel(new URI("tel:" + telephoneNumber)); } private Tel(URI uri); Tel(TelephoneNumber telephoneNumber); Tel(String telephoneNumber); static Tel unvalidatedTel(String telephoneNumber); }
Tel extends URIValue { public static Tel unvalidatedTel(String telephoneNumber) throws URISyntaxException { return new Tel(new URI("tel:" + telephoneNumber)); } private Tel(URI uri); Tel(TelephoneNumber telephoneNumber); Tel(String telephoneNumber); static Tel unvalidatedTel(String telephoneNumber); }
@Test public void testLabelInstances() { Label label = Label.of("example"); assertTrue(label instanceof Label.ASCIILabel.LDHLabel.NonReservedLDHLabel); label = Label.of(""); assertTrue(label instanceof Label.RootLabel); label = Label.of("xn--bcher-kva"); assertTrue(label instanceof Label.ASCIILabel.LDHLabel.ReservedLDH...
public static Label of(final String label) { if (StringUtils.isEmpty(label)) { return RootLabel.getInstance(); } if (!ASCIILabel.ASCII_SET.containsAll(label)) { IDNA.Info info = new IDNA.Info(); StringBuilder result = new StringBuilder(); IDNA.labelToUnicode(label, result, info); if (info.hasErrors()) { throw new Label...
Label { public static Label of(final String label) { if (StringUtils.isEmpty(label)) { return RootLabel.getInstance(); } if (!ASCIILabel.ASCII_SET.containsAll(label)) { IDNA.Info info = new IDNA.Info(); StringBuilder result = new StringBuilder(); IDNA.labelToUnicode(label, result, info); if (info.hasErrors()) { throw n...
Label { public static Label of(final String label) { if (StringUtils.isEmpty(label)) { return RootLabel.getInstance(); } if (!ASCIILabel.ASCII_SET.containsAll(label)) { IDNA.Info info = new IDNA.Info(); StringBuilder result = new StringBuilder(); IDNA.labelToUnicode(label, result, info); if (info.hasErrors()) { throw n...
Label { public static Label of(final String label) { if (StringUtils.isEmpty(label)) { return RootLabel.getInstance(); } if (!ASCIILabel.ASCII_SET.containsAll(label)) { IDNA.Info info = new IDNA.Info(); StringBuilder result = new StringBuilder(); IDNA.labelToUnicode(label, result, info); if (info.hasErrors()) { throw n...
Label { public static Label of(final String label) { if (StringUtils.isEmpty(label)) { return RootLabel.getInstance(); } if (!ASCIILabel.ASCII_SET.containsAll(label)) { IDNA.Info info = new IDNA.Info(); StringBuilder result = new StringBuilder(); IDNA.labelToUnicode(label, result, info); if (info.hasErrors()) { throw n...
@Test public void testToUnicode() { Label label = Label.of("xn--bcher-kva"); assertEquals("b\u00FCcher", label.toUnicode().getStringValue()); }
public Label toUnicode() { return this; }
Label { public Label toUnicode() { return this; } }
Label { public Label toUnicode() { return this; } Label(String value); }
Label { public Label toUnicode() { return this; } Label(String value); static Label of(final String label); String getStringValue(); Label toLDH(); Label toUnicode(); }
Label { public Label toUnicode() { return this; } Label(String value); static Label of(final String label); String getStringValue(); Label toLDH(); Label toUnicode(); static final Logger LOGGER; static final int IDNA_OPTIONS; }
@Test public void testToLDH() { Label label = Label.of("b\u00FCcher"); assertEquals("xn--bcher-kva", label.toLDH().getStringValue()); label = Label.of("Bu\u0308cher"); assertEquals("xn--bcher-kva", label.toLDH().getStringValue()); assertEquals("b\u00FCcher", label.getStringValue()); }
public Label toLDH() { return this; }
Label { public Label toLDH() { return this; } }
Label { public Label toLDH() { return this; } Label(String value); }
Label { public Label toLDH() { return this; } Label(String value); static Label of(final String label); String getStringValue(); Label toLDH(); Label toUnicode(); }
Label { public Label toLDH() { return this; } Label(String value); static Label of(final String label); String getStringValue(); Label toLDH(); Label toUnicode(); static final Logger LOGGER; static final int IDNA_OPTIONS; }
@Test public void testControlCharacters() { for (final String s : new UnicodeSet(0, 31)) { Assert.assertThrows(new Assert.Closure() { @Override public void execute() throws Throwable { Label.of(s); } }, LabelException.IDNParseException.class, "expects LabelException"); } }
public static Label of(final String label) { if (StringUtils.isEmpty(label)) { return RootLabel.getInstance(); } if (!ASCIILabel.ASCII_SET.containsAll(label)) { IDNA.Info info = new IDNA.Info(); StringBuilder result = new StringBuilder(); IDNA.labelToUnicode(label, result, info); if (info.hasErrors()) { throw new Label...
Label { public static Label of(final String label) { if (StringUtils.isEmpty(label)) { return RootLabel.getInstance(); } if (!ASCIILabel.ASCII_SET.containsAll(label)) { IDNA.Info info = new IDNA.Info(); StringBuilder result = new StringBuilder(); IDNA.labelToUnicode(label, result, info); if (info.hasErrors()) { throw n...
Label { public static Label of(final String label) { if (StringUtils.isEmpty(label)) { return RootLabel.getInstance(); } if (!ASCIILabel.ASCII_SET.containsAll(label)) { IDNA.Info info = new IDNA.Info(); StringBuilder result = new StringBuilder(); IDNA.labelToUnicode(label, result, info); if (info.hasErrors()) { throw n...
Label { public static Label of(final String label) { if (StringUtils.isEmpty(label)) { return RootLabel.getInstance(); } if (!ASCIILabel.ASCII_SET.containsAll(label)) { IDNA.Info info = new IDNA.Info(); StringBuilder result = new StringBuilder(); IDNA.labelToUnicode(label, result, info); if (info.hasErrors()) { throw n...
Label { public static Label of(final String label) { if (StringUtils.isEmpty(label)) { return RootLabel.getInstance(); } if (!ASCIILabel.ASCII_SET.containsAll(label)) { IDNA.Info info = new IDNA.Info(); StringBuilder result = new StringBuilder(); IDNA.labelToUnicode(label, result, info); if (info.hasErrors()) { throw n...
@Test public void testInvalidCountryCode() { assertThrows(new Closure() { @Override public void execute() throws Throwable { TelephoneNumber.of(1000, new BigInteger("1234567890")); } }, IllegalArgumentException.class, "Should throw IllegalArgumentException"); }
public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if (normalized.start...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
@Test public void testTooLongTelephoneNumber() { assertThrows(new Closure() { @Override public void execute() throws Throwable { TelephoneNumber.of("+32 12345678901234"); } }, IllegalArgumentException.class, "Should throw IllegalArgumentException"); }
public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if (normalized.start...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
@Test public void testInvalidCharacters() { assertThrows(new Closure() { @Override public void execute() throws Throwable { TelephoneNumber.of("+32 abcdefg"); } }, IllegalArgumentException.class, "Should throw IllegalArgumentException"); assertThrows(new Closure() { @Override public void execute() throws Throwable { Te...
public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if (normalized.start...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
TelephoneNumber { public static TelephoneNumber of(String number) { String normalized = number.replaceAll("[\\(\\)\\.\\s-_]", ""); LOGGER.debug("Normalized telephone number: {}", normalized); if (!normalized.matches("^\\+?\\d+$")) { throw new IllegalArgumentException("bad number"); } String prefix = "", suffix = ""; if...
@Test public void testDoesItSmoke() { Assert.assertThrows(new Assert.Closure() { @Override public void execute() throws Throwable { CIDR.of("1.1.1.1/-1"); } }, IllegalArgumentException.class, "negative prefix size"); }
public static CIDR of(String cidr) { String[] parts = cidr.split("\\/"); if (parts.length == 1) { try { InetAddress address = InetAddress.getByName(parts[0]); int length = address instanceof Inet4Address ? 32 : 128; return new CIDR(address.getAddress(), length); } catch (UnknownHostException e) { throw new IllegalArgum...
CIDR { public static CIDR of(String cidr) { String[] parts = cidr.split("\\/"); if (parts.length == 1) { try { InetAddress address = InetAddress.getByName(parts[0]); int length = address instanceof Inet4Address ? 32 : 128; return new CIDR(address.getAddress(), length); } catch (UnknownHostException e) { throw new Illeg...
CIDR { public static CIDR of(String cidr) { String[] parts = cidr.split("\\/"); if (parts.length == 1) { try { InetAddress address = InetAddress.getByName(parts[0]); int length = address instanceof Inet4Address ? 32 : 128; return new CIDR(address.getAddress(), length); } catch (UnknownHostException e) { throw new Illeg...
CIDR { public static CIDR of(String cidr) { String[] parts = cidr.split("\\/"); if (parts.length == 1) { try { InetAddress address = InetAddress.getByName(parts[0]); int length = address instanceof Inet4Address ? 32 : 128; return new CIDR(address.getAddress(), length); } catch (UnknownHostException e) { throw new Illeg...
CIDR { public static CIDR of(String cidr) { String[] parts = cidr.split("\\/"); if (parts.length == 1) { try { InetAddress address = InetAddress.getByName(parts[0]); int length = address instanceof Inet4Address ? 32 : 128; return new CIDR(address.getAddress(), length); } catch (UnknownHostException e) { throw new Illeg...
@Test public void translateExceptionIfPossible_should_translate_DuplicateItemNameException_into_DuplicateKeyException() { DuplicateItemNameException duplicateItemException = new DuplicateItemNameException("Duplicate Item"); DataAccessException dataAccessException = translator.translateExceptionIfPossible(duplicateItemE...
@Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e instanceof AttributeDoesNotExistException) { return new EmptyResultDataAcce...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
@Test public void should_correctly_compare_alphanumerical_strings() throws Exception { AlphanumStringComparator comparator = new AlphanumStringComparator(); assertTrue(comparator.compare("10@foo", "2@foo") > 0); assertTrue(comparator.compare("2@foo", "10@foo") < 0); assertTrue(comparator.compare("10@foo", "10@foo") == ...
@Override public int compare(String s1, String s2) { int c = 0; Matcher m1 = prefixRexp.matcher(s1); Matcher m2 = prefixRexp.matcher(s2); if (m1.find() && m2.find()) { Integer i1 = Integer.valueOf(m1.group(1)); Integer i2 = Integer.valueOf(m2.group(1)); c = i1.compareTo(i2); } else { throw new IllegalArgumentException(...
AlphanumStringComparator implements Comparator<String> { @Override public int compare(String s1, String s2) { int c = 0; Matcher m1 = prefixRexp.matcher(s1); Matcher m2 = prefixRexp.matcher(s2); if (m1.find() && m2.find()) { Integer i1 = Integer.valueOf(m1.group(1)); Integer i2 = Integer.valueOf(m2.group(1)); c = i1.co...
AlphanumStringComparator implements Comparator<String> { @Override public int compare(String s1, String s2) { int c = 0; Matcher m1 = prefixRexp.matcher(s1); Matcher m2 = prefixRexp.matcher(s2); if (m1.find() && m2.find()) { Integer i1 = Integer.valueOf(m1.group(1)); Integer i2 = Integer.valueOf(m2.group(1)); c = i1.co...
AlphanumStringComparator implements Comparator<String> { @Override public int compare(String s1, String s2) { int c = 0; Matcher m1 = prefixRexp.matcher(s1); Matcher m2 = prefixRexp.matcher(s2); if (m1.find() && m2.find()) { Integer i1 = Integer.valueOf(m1.group(1)); Integer i2 = Integer.valueOf(m2.group(1)); c = i1.co...
AlphanumStringComparator implements Comparator<String> { @Override public int compare(String s1, String s2) { int c = 0; Matcher m1 = prefixRexp.matcher(s1); Matcher m2 = prefixRexp.matcher(s2); if (m1.find() && m2.find()) { Integer i1 = Integer.valueOf(m1.group(1)); Integer i2 = Integer.valueOf(m2.group(1)); c = i1.co...
@Test public void splitToChunksOfSize_should_split_entries_exceeding_size() throws Exception { Map<String, List<String>> attributes = new LinkedHashMap<String, List<String>>(); for(int i = 0; i < SAMPLE_MAP_SIZE + 100; i++) { List<String> list = new ArrayList<String>(); list.add("Value: " + i); attributes.put("Key: " +...
public static List<Map<String, List<String>>> splitToChunksOfSize(Map<String, List<String>> rawMap, int chunkSize) { List<Map<String, List<String>>> mapChunks = new LinkedList<Map<String, List<String>>>(); Set<Map.Entry<String, List<String>>> rawEntries = rawMap.entrySet(); Map<String, List<String>> currentChunk = new ...
MapUtils { public static List<Map<String, List<String>>> splitToChunksOfSize(Map<String, List<String>> rawMap, int chunkSize) { List<Map<String, List<String>>> mapChunks = new LinkedList<Map<String, List<String>>>(); Set<Map.Entry<String, List<String>>> rawEntries = rawMap.entrySet(); Map<String, List<String>> currentC...
MapUtils { public static List<Map<String, List<String>>> splitToChunksOfSize(Map<String, List<String>> rawMap, int chunkSize) { List<Map<String, List<String>>> mapChunks = new LinkedList<Map<String, List<String>>>(); Set<Map.Entry<String, List<String>>> rawEntries = rawMap.entrySet(); Map<String, List<String>> currentC...
MapUtils { public static List<Map<String, List<String>>> splitToChunksOfSize(Map<String, List<String>> rawMap, int chunkSize) { List<Map<String, List<String>>> mapChunks = new LinkedList<Map<String, List<String>>>(); Set<Map.Entry<String, List<String>>> rawEntries = rawMap.entrySet(); Map<String, List<String>> currentC...
MapUtils { public static List<Map<String, List<String>>> splitToChunksOfSize(Map<String, List<String>> rawMap, int chunkSize) { List<Map<String, List<String>>> mapChunks = new LinkedList<Map<String, List<String>>>(); Set<Map.Entry<String, List<String>>> rawEntries = rawMap.entrySet(); Map<String, List<String>> currentC...
@Test public void should_create_corect_query_for_simple_property() { final String methodName = "findByItemName"; final PartTree tree = new PartTree(methodName, SimpleDbSampleEntity.class); final String query = PartTreeConverter.toIndexedQuery(tree); final String expected = " itemName = ? "; assertEquals(expected, query...
public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part part = partIt.next(...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
@Test public void should_create_corect_query_for_between() { final String methodName = "readByAgeBetween"; final PartTree tree = new PartTree(methodName, SimpleDbSampleEntity.class); final String query = PartTreeConverter.toIndexedQuery(tree); final String expected = " age BETWEEN ? and ? "; assertEquals(expected, quer...
public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part part = partIt.next(...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
@Test public void should_create_corect_query_for_complex_operators() { final String methodName = "getByItemNameLikeOrAgeGreaterThanAndAgeLessThan"; final PartTree tree = new PartTree(methodName, SimpleDbSampleEntity.class); final String query = PartTreeConverter.toIndexedQuery(tree); final String expected = " itemName ...
public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part part = partIt.next(...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
@Test(expected = MappingException.class) public void shoud_fail_for_unsupported_operator() { final String methodName = "readByAgeEndsWith"; final PartTree tree = new PartTree(methodName, SimpleDbSampleEntity.class); PartTreeConverter.toIndexedQuery(tree); }
public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part part = partIt.next(...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
PartTreeConverter { public static String toIndexedQuery(final PartTree tree) { final StringBuilder result = new StringBuilder(); final Iterator<OrPart> orIt = tree.iterator(); while(orIt.hasNext()) { final OrPart orPart = orIt.next(); final Iterator<Part> partIt = orPart.iterator(); while(partIt.hasNext()) { final Part...
@SuppressWarnings({ "rawtypes", "unchecked" }) @Test(expected = IllegalArgumentException.class) public void assertNotHavingNestedQueryParameters_should_fail_for_nested_attributes() { SimpleDbQueryMethod method = Mockito.mock(SimpleDbQueryMethod.class); Mockito.when(method.getDomainClazz()).thenReturn((Class) SampleEnti...
void assertNotHavingNestedQueryParameters(String query) { List<String> attributesFromQuery = QueryUtils.getQueryPartialFieldNames(query); final Class<?> domainClass = method.getDomainClazz(); for(String attribute : attributesFromQuery) { try { Field field = ReflectionUtils.getDeclaredFieldInHierarchy(domainClass, attri...
SimpleDbRepositoryQuery implements RepositoryQuery { void assertNotHavingNestedQueryParameters(String query) { List<String> attributesFromQuery = QueryUtils.getQueryPartialFieldNames(query); final Class<?> domainClass = method.getDomainClazz(); for(String attribute : attributesFromQuery) { try { Field field = Reflectio...
SimpleDbRepositoryQuery implements RepositoryQuery { void assertNotHavingNestedQueryParameters(String query) { List<String> attributesFromQuery = QueryUtils.getQueryPartialFieldNames(query); final Class<?> domainClass = method.getDomainClazz(); for(String attribute : attributesFromQuery) { try { Field field = Reflectio...
SimpleDbRepositoryQuery implements RepositoryQuery { void assertNotHavingNestedQueryParameters(String query) { List<String> attributesFromQuery = QueryUtils.getQueryPartialFieldNames(query); final Class<?> domainClass = method.getDomainClazz(); for(String attribute : attributesFromQuery) { try { Field field = Reflectio...
SimpleDbRepositoryQuery implements RepositoryQuery { void assertNotHavingNestedQueryParameters(String query) { List<String> attributesFromQuery = QueryUtils.getQueryPartialFieldNames(query); final Class<?> domainClass = method.getDomainClazz(); for(String attribute : attributesFromQuery) { try { Field field = Reflectio...
@Test(expected = IllegalArgumentException.class) public void executeSingleResultQuery_should_fail_if_multiple_results_are_retrieved() { SimpleDbOperations simpleDbOperations = Mockito.mock(SimpleDbOperations.class); List<SampleEntity> sampleMultipleResults = new ArrayList<SampleEntity>(); sampleMultipleResults.add(new ...
public Object executeSingleResultQuery() { List<?> returnListFromDb = executeQuery(); return getSingleResult(returnListFromDb); }
SimpleDbQueryRunner { public Object executeSingleResultQuery() { List<?> returnListFromDb = executeQuery(); return getSingleResult(returnListFromDb); } }
SimpleDbQueryRunner { public Object executeSingleResultQuery() { List<?> returnListFromDb = executeQuery(); return getSingleResult(returnListFromDb); } SimpleDbQueryRunner(SimpleDbOperations simpledbOperations, Class<?> domainClass, String query); SimpleDbQueryRunner(SimpleDbOperations simpledbOperations, Class<?> dom...
SimpleDbQueryRunner { public Object executeSingleResultQuery() { List<?> returnListFromDb = executeQuery(); return getSingleResult(returnListFromDb); } SimpleDbQueryRunner(SimpleDbOperations simpledbOperations, Class<?> domainClass, String query); SimpleDbQueryRunner(SimpleDbOperations simpledbOperations, Class<?> dom...
SimpleDbQueryRunner { public Object executeSingleResultQuery() { List<?> returnListFromDb = executeQuery(); return getSingleResult(returnListFromDb); } SimpleDbQueryRunner(SimpleDbOperations simpledbOperations, Class<?> domainClass, String query); SimpleDbQueryRunner(SimpleDbOperations simpledbOperations, Class<?> dom...
@Test public void getSingleResult_should_return_null_for_empty_list() { SimpleDbQueryRunner runner = new SimpleDbQueryRunner(null, SampleEntity.class, null); final Object result = runner.getSingleResult(new ArrayList<SampleEntity>()); assertNull(result); }
Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) : null; }
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
@Test public void getSingleResult_should_return_single_value_from_list_with_one_element() { SimpleDbQueryRunner runner = new SimpleDbQueryRunner(null, SampleEntity.class, null); final ArrayList<SampleEntity> results = new ArrayList<SampleEntity>(); results.add(new SampleEntity()); final Object result = runner.getSingle...
Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) : null; }
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
@Test public void translateExceptionIfPossible_should_translate_AttributeDoesNotExistException_into_EmptyResultDataAccessException() { AttributeDoesNotExistException attributeDoesNotExistException = new AttributeDoesNotExistException( "Attribute does not exist"); DataAccessException dataAccessException = translator .tr...
@Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e instanceof AttributeDoesNotExistException) { return new EmptyResultDataAcce...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
@Test(expected = IllegalArgumentException.class) public void getSingleResult_should_fail_for_list_with_multiple_elements() { SimpleDbQueryRunner runner = new SimpleDbQueryRunner(null, SampleEntity.class, null); final ArrayList<SampleEntity> results = new ArrayList<SampleEntity>(); results.add(new SampleEntity()); resul...
Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) : null; }
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
SimpleDbQueryRunner { Object getSingleResult(List<?> returnListFromDb) { Assert.isTrue(returnListFromDb.size() <= 1, "Select statement should return only one entity from database, returned elements size=" + returnListFromDb.size() + ", for Query=" + query); return returnListFromDb.size() > 0 ? returnListFromDb.get(0) :...
@Test public void filterNamedAttributesAsList_should_return_list_of_named_attributes() throws Exception { List<SampleEntity> entities = new ArrayList<SampleEntity>(); SampleEntity entity = new SampleEntity(); entity.setSampleAttribute(SAMPLE_INT_VALUE); entities.add(entity); List<Object> filteredAttributes = SimpleDbRe...
public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; }
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } }
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter();...
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter();...
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter();...
@Test public void filterNamedAttributesAsList_should_work_for_list_attributes() throws Exception { List<SampleEntity> entities = new ArrayList<SampleEntity>(); SampleEntity entity = new SampleEntity(); entity.setSampleList(new ArrayList<Integer>()); entities.add(entity); List<Object> filteredAttributes = SimpleDbResult...
public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; }
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } }
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter();...
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter();...
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter();...
@Test(expected = MappingException.class) public void filterNamedAttributesAsList_should_not_return_list_of_named_attributes_for_wrong_att() throws Exception { List<SampleEntity> entities = new ArrayList<SampleEntity>(); SampleEntity entity = new SampleEntity(); entities.add(entity); SimpleDbResultConverter.filterNamedA...
public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; }
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } }
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter();...
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter();...
SimpleDbResultConverter { public static List<Object> filterNamedAttributesAsList(List<?> domainObjects, String attributeName) { List<Object> ret = new ArrayList<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter();...
@Test public void filterNamedAttributesAsSet_should_return_Set_of_named_attributes() throws Exception { List<SampleEntity> entities = new ArrayList<SampleEntity>(); SampleEntity entity = new SampleEntity(); entity.setSampleAttribute(SAMPLE_INT_VALUE); entities.add(entity); Set<Object> filteredAttributes = SimpleDbResul...
public static Set<Object> filterNamedAttributesAsSet(List<?> domainObjects, String attributeName) { Set<Object> ret = new LinkedHashSet<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; }
SimpleDbResultConverter { public static Set<Object> filterNamedAttributesAsSet(List<?> domainObjects, String attributeName) { Set<Object> ret = new LinkedHashSet<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } }
SimpleDbResultConverter { public static Set<Object> filterNamedAttributesAsSet(List<?> domainObjects, String attributeName) { Set<Object> ret = new LinkedHashSet<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter()...
SimpleDbResultConverter { public static Set<Object> filterNamedAttributesAsSet(List<?> domainObjects, String attributeName) { Set<Object> ret = new LinkedHashSet<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter()...
SimpleDbResultConverter { public static Set<Object> filterNamedAttributesAsSet(List<?> domainObjects, String attributeName) { Set<Object> ret = new LinkedHashSet<Object>(); for(Object object : domainObjects) { ret.add(ReflectionUtils.callGetter(object, attributeName)); } return ret; } private SimpleDbResultConverter()...
@Test public void toListOfListOfObject_should_return_List_of_Lists_containing_requested_attributes() { List<SampleEntity> entities = new ArrayList<SampleEntity>(); SampleEntity entity = new SampleEntity(); entity.setSampleAttribute(SAMPLE_INT_VALUE); entity.setSampleList(new ArrayList<Integer>()); entities.add(entity);...
public static List<List<Object>> toListOfListOfObject(List<?> entityList, List<String> requestedQueryFieldNames) { if(entityList.size() > 0) { List<List<Object>> rows = new ArrayList<List<Object>>(); for(Object entity : entityList) { List<Object> cols = new ArrayList<Object>(); for(String fieldName : requestedQueryFiel...
SimpleDbResultConverter { public static List<List<Object>> toListOfListOfObject(List<?> entityList, List<String> requestedQueryFieldNames) { if(entityList.size() > 0) { List<List<Object>> rows = new ArrayList<List<Object>>(); for(Object entity : entityList) { List<Object> cols = new ArrayList<Object>(); for(String fiel...
SimpleDbResultConverter { public static List<List<Object>> toListOfListOfObject(List<?> entityList, List<String> requestedQueryFieldNames) { if(entityList.size() > 0) { List<List<Object>> rows = new ArrayList<List<Object>>(); for(Object entity : entityList) { List<Object> cols = new ArrayList<Object>(); for(String fiel...
SimpleDbResultConverter { public static List<List<Object>> toListOfListOfObject(List<?> entityList, List<String> requestedQueryFieldNames) { if(entityList.size() > 0) { List<List<Object>> rows = new ArrayList<List<Object>>(); for(Object entity : entityList) { List<Object> cols = new ArrayList<Object>(); for(String fiel...
SimpleDbResultConverter { public static List<List<Object>> toListOfListOfObject(List<?> entityList, List<String> requestedQueryFieldNames) { if(entityList.size() > 0) { List<List<Object>> rows = new ArrayList<List<Object>>(); for(Object entity : entityList) { List<Object> cols = new ArrayList<Object>(); for(String fiel...
@Test public void detectResultType_should_return_COLLECTION_OF_DOMAIN_ENTITIES() throws Exception { SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("selectAll", SampleEntity.class); MultipleResultExecution multipleResultExecution = new MultipleResultExecution(null); assertEquals(MultipleResultExecution....
MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNames(query).size() > 1) { return MultipleResultType.LIST_OF_LIST_O...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
@Test public void detectResultType_for_selected_field_should_return_COLLECTION_OF_DOMAIN_ENTITIES() throws Exception { SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("partialSampleListSelect", SampleEntity.class); MultipleResultExecution multipleResultExecution = new MultipleResultExecution(null); asse...
MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNames(query).size() > 1) { return MultipleResultType.LIST_OF_LIST_O...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
@Test public void detectResultType_should_return_LIST_OF_LIST_OF_OBJECT() throws Exception { SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("selectCoreFields", SampleEntity.class); MultipleResultExecution multipleResultExecution = new MultipleResultExecution(null); assertEquals(MultipleResultExecution....
MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNames(query).size() > 1) { return MultipleResultType.LIST_OF_LIST_O...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
@Test public void detectResultType_for_multiple_selected_attributes_should_return_LIST_OF_LIST_OF_OBJECT() throws Exception { SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("selectFields", SampleEntity.class); MultipleResultExecution multipleResultExecution = new MultipleResultExecution(null); assertEq...
MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNames(query).size() > 1) { return MultipleResultType.LIST_OF_LIST_O...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
@Test public void translateExceptionIfPossible_should_translate_ResourceNotFoundException_into_DataRetrievalFailureException() { ResourceNotFoundException resourceNotFoundException = new ResourceNotFoundException("Resource Not Found"); DataAccessException dataAccessException = translator.translateExceptionIfPossible(re...
@Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e instanceof AttributeDoesNotExistException) { return new EmptyResultDataAcce...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
@Test public void detectResultType_should_return_FIELD_OF_TYPE_COLLECTION() throws Exception { SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("sampleListSelect", SampleEntity.class); MultipleResultExecution multipleResultExecution = new MultipleResultExecution(null); assertEquals(MultipleResultExecutio...
MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNames(query).size() > 1) { return MultipleResultType.LIST_OF_LIST_O...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
@Test public void detectResultType_should_return_LIST_OF_FIELDS() throws Exception { SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("sampleAllSampleListSelect", SampleEntity.class); MultipleResultExecution multipleResultExecution = new MultipleResultExecution(null); assertEquals(MultipleResultExecution...
MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNames(query).size() > 1) { return MultipleResultType.LIST_OF_LIST_O...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
@Test public void detectResultType_should_return_SET_OF_FIELDS() throws Exception { SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("sampleAllSampleListSelectInSet", SampleEntity.class); MultipleResultExecution multipleResultExecution = new MultipleResultExecution(null); assertEquals(MultipleResultExecu...
MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNames(query).size() > 1) { return MultipleResultType.LIST_OF_LIST_O...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
@Test public void detectResultType_should_return_FIELD_OF_TYPE_COLLECTION_of_list_of_lists() throws Exception { SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("listOfListOfIntegerFieldSelect", SampleEntity.class); MultipleResultExecution multipleResultExecution = new MultipleResultExecution(null); asse...
MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNames(query).size() > 1) { return MultipleResultType.LIST_OF_LIST_O...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
@Test(expected = IllegalArgumentException.class) public void detectResultType_should_return_error_for_inexisting_field() throws Exception { SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("sampleWrongField", SampleEntity.class); MultipleResultExecution multipleResultExecution = new MultipleResultExecuti...
MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNames(query).size() > 1) { return MultipleResultType.LIST_OF_LIST_O...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
MultipleResultExecution extends AbstractSimpleDbQueryExecution { MultipleResultType detectResultType(SimpleDbQueryMethod method) { String query = method.getAnnotatedQuery(); if(method.returnsCollectionOfDomainClass()) { return MultipleResultType.COLLECTION_OF_DOMAIN_ENTITIES; } else if(QueryUtils.getQueryPartialFieldNa...
@Test @SuppressWarnings({ "rawtypes", "unchecked" }) public void doExecute_should_return_Page_type() throws Exception { final SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("selectAllIntoPage", SampleEntity.class); final PagedResultExecution execution = new PagedResultExecution(null); final SimpleDbQue...
@Override protected Object doExecute(SimpleDbQueryMethod queryMethod, SimpleDbQueryRunner queryRunner) { final Page<?> pagedResult = queryRunner.executePagedQuery(); if(queryMethod.isPageQuery()) { return pagedResult; } return pagedResult.getContent(); }
PagedResultExecution extends AbstractSimpleDbQueryExecution { @Override protected Object doExecute(SimpleDbQueryMethod queryMethod, SimpleDbQueryRunner queryRunner) { final Page<?> pagedResult = queryRunner.executePagedQuery(); if(queryMethod.isPageQuery()) { return pagedResult; } return pagedResult.getContent(); } }
PagedResultExecution extends AbstractSimpleDbQueryExecution { @Override protected Object doExecute(SimpleDbQueryMethod queryMethod, SimpleDbQueryRunner queryRunner) { final Page<?> pagedResult = queryRunner.executePagedQuery(); if(queryMethod.isPageQuery()) { return pagedResult; } return pagedResult.getContent(); } Pag...
PagedResultExecution extends AbstractSimpleDbQueryExecution { @Override protected Object doExecute(SimpleDbQueryMethod queryMethod, SimpleDbQueryRunner queryRunner) { final Page<?> pagedResult = queryRunner.executePagedQuery(); if(queryMethod.isPageQuery()) { return pagedResult; } return pagedResult.getContent(); } Pag...
PagedResultExecution extends AbstractSimpleDbQueryExecution { @Override protected Object doExecute(SimpleDbQueryMethod queryMethod, SimpleDbQueryRunner queryRunner) { final Page<?> pagedResult = queryRunner.executePagedQuery(); if(queryMethod.isPageQuery()) { return pagedResult; } return pagedResult.getContent(); } Pag...
@Test @SuppressWarnings({ "rawtypes", "unchecked" }) public void doExecute_should_return_List_type() throws Exception { final SimpleDbQueryMethod repositoryMethod = prepareQueryMethodToTest("selectAllIntoList", SampleEntity.class); final PagedResultExecution execution = new PagedResultExecution(null); final SimpleDbQue...
@Override protected Object doExecute(SimpleDbQueryMethod queryMethod, SimpleDbQueryRunner queryRunner) { final Page<?> pagedResult = queryRunner.executePagedQuery(); if(queryMethod.isPageQuery()) { return pagedResult; } return pagedResult.getContent(); }
PagedResultExecution extends AbstractSimpleDbQueryExecution { @Override protected Object doExecute(SimpleDbQueryMethod queryMethod, SimpleDbQueryRunner queryRunner) { final Page<?> pagedResult = queryRunner.executePagedQuery(); if(queryMethod.isPageQuery()) { return pagedResult; } return pagedResult.getContent(); } }
PagedResultExecution extends AbstractSimpleDbQueryExecution { @Override protected Object doExecute(SimpleDbQueryMethod queryMethod, SimpleDbQueryRunner queryRunner) { final Page<?> pagedResult = queryRunner.executePagedQuery(); if(queryMethod.isPageQuery()) { return pagedResult; } return pagedResult.getContent(); } Pag...
PagedResultExecution extends AbstractSimpleDbQueryExecution { @Override protected Object doExecute(SimpleDbQueryMethod queryMethod, SimpleDbQueryRunner queryRunner) { final Page<?> pagedResult = queryRunner.executePagedQuery(); if(queryMethod.isPageQuery()) { return pagedResult; } return pagedResult.getContent(); } Pag...
PagedResultExecution extends AbstractSimpleDbQueryExecution { @Override protected Object doExecute(SimpleDbQueryMethod queryMethod, SimpleDbQueryRunner queryRunner) { final Page<?> pagedResult = queryRunner.executePagedQuery(); if(queryMethod.isPageQuery()) { return pagedResult; } return pagedResult.getContent(); } Pag...
@Test public void toSimpleDBAttributeValues_should_return_an_string_representation_of_concatenated_array_elements() throws ParseException { final int[] expectedIntArray = { 1, 2, 3, 4 }; final List<String> simpleDBValues = Arrays.asList("1", "2", "3", "4"); Object returnedPrimitiveCol = SimpleDBAttributeConverter.decod...
public static Object decodeToPrimitiveArray(List<String> fromSimpleDbAttValues, Class<?> retType) throws ParseException { Object primitiveCollection = Array.newInstance(retType, fromSimpleDbAttValues.size()); int idx = 0; for(Iterator<String> iterator = fromSimpleDbAttValues.iterator(); iterator.hasNext(); idx++) { Arr...
SimpleDBAttributeConverter { public static Object decodeToPrimitiveArray(List<String> fromSimpleDbAttValues, Class<?> retType) throws ParseException { Object primitiveCollection = Array.newInstance(retType, fromSimpleDbAttValues.size()); int idx = 0; for(Iterator<String> iterator = fromSimpleDbAttValues.iterator(); ite...
SimpleDBAttributeConverter { public static Object decodeToPrimitiveArray(List<String> fromSimpleDbAttValues, Class<?> retType) throws ParseException { Object primitiveCollection = Array.newInstance(retType, fromSimpleDbAttValues.size()); int idx = 0; for(Iterator<String> iterator = fromSimpleDbAttValues.iterator(); ite...
SimpleDBAttributeConverter { public static Object decodeToPrimitiveArray(List<String> fromSimpleDbAttValues, Class<?> retType) throws ParseException { Object primitiveCollection = Array.newInstance(retType, fromSimpleDbAttValues.size()); int idx = 0; for(Iterator<String> iterator = fromSimpleDbAttValues.iterator(); ite...
SimpleDBAttributeConverter { public static Object decodeToPrimitiveArray(List<String> fromSimpleDbAttValues, Class<?> retType) throws ParseException { Object primitiveCollection = Array.newInstance(retType, fromSimpleDbAttValues.size()); int idx = 0; for(Iterator<String> iterator = fromSimpleDbAttValues.iterator(); ite...
@Test public void splitAttributeValuesWithExceedingLengths_should_detect_long_attributes() throws Exception { Map<String, String> rawAttributes = new LinkedHashMap<String, String>(); rawAttributes.put(SAMPLE_ATT_NAME, STRING_OF_MAX_SIMPLE_DB_LENGTH + "c"); Map<String, List<String>> splitAttributes = SimpleDbAttributeVa...
public static Map<String, List<String>> splitAttributeValuesWithExceedingLengths(Map<String, String> rawAttributes) { Map<String, List<String>> splitAttributes = new LinkedHashMap<String, List<String>>(); Set<Map.Entry<String, String>> rawEntries = rawAttributes.entrySet(); for(Map.Entry<String, String> rawEntry : rawE...
SimpleDbAttributeValueSplitter { public static Map<String, List<String>> splitAttributeValuesWithExceedingLengths(Map<String, String> rawAttributes) { Map<String, List<String>> splitAttributes = new LinkedHashMap<String, List<String>>(); Set<Map.Entry<String, String>> rawEntries = rawAttributes.entrySet(); for(Map.Entr...
SimpleDbAttributeValueSplitter { public static Map<String, List<String>> splitAttributeValuesWithExceedingLengths(Map<String, String> rawAttributes) { Map<String, List<String>> splitAttributes = new LinkedHashMap<String, List<String>>(); Set<Map.Entry<String, String>> rawEntries = rawAttributes.entrySet(); for(Map.Entr...
SimpleDbAttributeValueSplitter { public static Map<String, List<String>> splitAttributeValuesWithExceedingLengths(Map<String, String> rawAttributes) { Map<String, List<String>> splitAttributes = new LinkedHashMap<String, List<String>>(); Set<Map.Entry<String, String>> rawEntries = rawAttributes.entrySet(); for(Map.Entr...
SimpleDbAttributeValueSplitter { public static Map<String, List<String>> splitAttributeValuesWithExceedingLengths(Map<String, String> rawAttributes) { Map<String, List<String>> splitAttributes = new LinkedHashMap<String, List<String>>(); Set<Map.Entry<String, String>> rawEntries = rawAttributes.entrySet(); for(Map.Entr...
@Test public void splitAttributeValuesWithExceedingLengths_should_not_split_short_attributes() throws Exception { Map<String, String> rawAttributes = new LinkedHashMap<String, String>(); rawAttributes.put(SAMPLE_ATT_NAME, "shortValue"); Map<String, List<String>> splitAttributes = SimpleDbAttributeValueSplitter .splitAt...
public static Map<String, List<String>> splitAttributeValuesWithExceedingLengths(Map<String, String> rawAttributes) { Map<String, List<String>> splitAttributes = new LinkedHashMap<String, List<String>>(); Set<Map.Entry<String, String>> rawEntries = rawAttributes.entrySet(); for(Map.Entry<String, String> rawEntry : rawE...
SimpleDbAttributeValueSplitter { public static Map<String, List<String>> splitAttributeValuesWithExceedingLengths(Map<String, String> rawAttributes) { Map<String, List<String>> splitAttributes = new LinkedHashMap<String, List<String>>(); Set<Map.Entry<String, String>> rawEntries = rawAttributes.entrySet(); for(Map.Entr...
SimpleDbAttributeValueSplitter { public static Map<String, List<String>> splitAttributeValuesWithExceedingLengths(Map<String, String> rawAttributes) { Map<String, List<String>> splitAttributes = new LinkedHashMap<String, List<String>>(); Set<Map.Entry<String, String>> rawEntries = rawAttributes.entrySet(); for(Map.Entr...
SimpleDbAttributeValueSplitter { public static Map<String, List<String>> splitAttributeValuesWithExceedingLengths(Map<String, String> rawAttributes) { Map<String, List<String>> splitAttributes = new LinkedHashMap<String, List<String>>(); Set<Map.Entry<String, String>> rawEntries = rawAttributes.entrySet(); for(Map.Entr...
SimpleDbAttributeValueSplitter { public static Map<String, List<String>> splitAttributeValuesWithExceedingLengths(Map<String, String> rawAttributes) { Map<String, List<String>> splitAttributes = new LinkedHashMap<String, List<String>>(); Set<Map.Entry<String, String>> rawEntries = rawAttributes.entrySet(); for(Map.Entr...
@Test public void translateExceptionIfPossible_should_translate_InvalidParameterValueException_into_InvalidDataAccessResourceUsageException() { InvalidParameterValueException invalidParameterValueException = new InvalidParameterValueException( "Invalid Parameter"); DataAccessException dataAccessException = translator ....
@Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e instanceof AttributeDoesNotExistException) { return new EmptyResultDataAcce...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
@Test public void should_create_correct_queries_if_no_other_clauses_are_specified() throws Exception { QueryBuilder builder = new QueryBuilder(SimpleDbSampleEntity.entityInformation()); String returnedQuery = builder.toString(); assertEquals("select * from `simpleDbSampleEntity`", returnedQuery); }
@Override public String toString() { String result = query.toString(); LOGGER.debug("Created query: {}", result); return result; }
QueryBuilder { @Override public String toString() { String result = query.toString(); LOGGER.debug("Created query: {}", result); return result; } }
QueryBuilder { @Override public String toString() { String result = query.toString(); LOGGER.debug("Created query: {}", result); return result; } QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation); QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation, boolean shouldCount); QueryBuilder(String c...
QueryBuilder { @Override public String toString() { String result = query.toString(); LOGGER.debug("Created query: {}", result); return result; } QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation); QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation, boolean shouldCount); QueryBuilder(String c...
QueryBuilder { @Override public String toString() { String result = query.toString(); LOGGER.debug("Created query: {}", result); return result; } QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation); QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation, boolean shouldCount); QueryBuilder(String c...
@Test public void should_include_count_clause_if_requested() throws Exception { QueryBuilder builder = new QueryBuilder(SimpleDbSampleEntity.entityInformation(), true); String returnedQuery = builder.toString(); assertThat(returnedQuery, containsString("select count(*) from")); }
@Override public String toString() { String result = query.toString(); LOGGER.debug("Created query: {}", result); return result; }
QueryBuilder { @Override public String toString() { String result = query.toString(); LOGGER.debug("Created query: {}", result); return result; } }
QueryBuilder { @Override public String toString() { String result = query.toString(); LOGGER.debug("Created query: {}", result); return result; } QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation); QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation, boolean shouldCount); QueryBuilder(String c...
QueryBuilder { @Override public String toString() { String result = query.toString(); LOGGER.debug("Created query: {}", result); return result; } QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation); QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation, boolean shouldCount); QueryBuilder(String c...
QueryBuilder { @Override public String toString() { String result = query.toString(); LOGGER.debug("Created query: {}", result); return result; } QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation); QueryBuilder(SimpleDbEntityInformation<?, ?> entityInformation, boolean shouldCount); QueryBuilder(String c...
@Test public void test_getSerializedPrimitiveAttributes() throws ParseException { final SampleEntity entity = new SampleEntity(); entity.setIntField(11); entity.setLongField(123); entity.setShortField((short) -12); entity.setFloatField(-0.01f); entity.setDoubleField(1.2d); entity.setByteField((byte) 1); entity.setBoole...
public Map<String, String> serialize() { return serialize(""); }
EntityWrapper { public Map<String, String> serialize() { return serialize(""); } }
EntityWrapper { public Map<String, String> serialize() { return serialize(""); } EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item, boolean isNested); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation); Enti...
EntityWrapper { public Map<String, String> serialize() { return serialize(""); } EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item, boolean isNested); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation); Enti...
EntityWrapper { public Map<String, String> serialize() { return serialize(""); } EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item, boolean isNested); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation); Enti...
@Test public void should_generate_attribute_keys_for_nested_domain_fields() { final AClass aDomain = new AClass(); { aDomain.nestedB = new BClass(); { aDomain.nestedB.floatField = 21f; aDomain.nestedB.nestedNestedC = new CClass(); { aDomain.nestedB.nestedNestedC.doubleField = 14d; } } } EntityWrapper<AClass, String> sd...
public Map<String, String> serialize() { return serialize(""); }
EntityWrapper { public Map<String, String> serialize() { return serialize(""); } }
EntityWrapper { public Map<String, String> serialize() { return serialize(""); } EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item, boolean isNested); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation); Enti...
EntityWrapper { public Map<String, String> serialize() { return serialize(""); } EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item, boolean isNested); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation); Enti...
EntityWrapper { public Map<String, String> serialize() { return serialize(""); } EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation, T item, boolean isNested); EntityWrapper(SimpleDbEntityInformation<T, ?> entityInformation); Enti...
@Test public void populateDomainItem_should_convert_item_name() { Item sampleItem = new Item(SAMPLE_ITEM_NAME, new ArrayList<Attribute>()); SimpleDbEntityInformation<SimpleDbSampleEntity, String> entityInformation = SimpleDbSampleEntity .entityInformation(); domainItemBuilder = new DomainItemBuilder<SimpleDbSampleEntit...
public T populateDomainItem(SimpleDbEntityInformation<T, ?> entityInformation, Item item) { return buildDomainItem(entityInformation, item); }
DomainItemBuilder { public T populateDomainItem(SimpleDbEntityInformation<T, ?> entityInformation, Item item) { return buildDomainItem(entityInformation, item); } }
DomainItemBuilder { public T populateDomainItem(SimpleDbEntityInformation<T, ?> entityInformation, Item item) { return buildDomainItem(entityInformation, item); } }
DomainItemBuilder { public T populateDomainItem(SimpleDbEntityInformation<T, ?> entityInformation, Item item) { return buildDomainItem(entityInformation, item); } List<T> populateDomainItems(SimpleDbEntityInformation<T, ?> entityInformation, SelectResult selectResult); T populateDomainItem(SimpleDbEntityInformation<T,...
DomainItemBuilder { public T populateDomainItem(SimpleDbEntityInformation<T, ?> entityInformation, Item item) { return buildDomainItem(entityInformation, item); } List<T> populateDomainItems(SimpleDbEntityInformation<T, ?> entityInformation, SelectResult selectResult); T populateDomainItem(SimpleDbEntityInformation<T,...
@Test public void populateDomainItem_should_convert_attributes() { List<Attribute> attributeList = new ArrayList<Attribute>(); attributeList.add(new Attribute("booleanField", "" + SAMPLE_BOOLEAN_ATT_VALUE)); Item sampleItem = new Item(SAMPLE_ITEM_NAME, attributeList); SimpleDbEntityInformation<SimpleDbSampleEntity, Str...
public T populateDomainItem(SimpleDbEntityInformation<T, ?> entityInformation, Item item) { return buildDomainItem(entityInformation, item); }
DomainItemBuilder { public T populateDomainItem(SimpleDbEntityInformation<T, ?> entityInformation, Item item) { return buildDomainItem(entityInformation, item); } }
DomainItemBuilder { public T populateDomainItem(SimpleDbEntityInformation<T, ?> entityInformation, Item item) { return buildDomainItem(entityInformation, item); } }
DomainItemBuilder { public T populateDomainItem(SimpleDbEntityInformation<T, ?> entityInformation, Item item) { return buildDomainItem(entityInformation, item); } List<T> populateDomainItems(SimpleDbEntityInformation<T, ?> entityInformation, SelectResult selectResult); T populateDomainItem(SimpleDbEntityInformation<T,...
DomainItemBuilder { public T populateDomainItem(SimpleDbEntityInformation<T, ?> entityInformation, Item item) { return buildDomainItem(entityInformation, item); } List<T> populateDomainItems(SimpleDbEntityInformation<T, ?> entityInformation, SelectResult selectResult); T populateDomainItem(SimpleDbEntityInformation<T,...
@Test public void translateExceptionIfPossible_should_translate_NoSuchDomainException_into_EmptyResultDataAccessException() { NoSuchDomainException noSuchDomainException = new NoSuchDomainException("No such domain"); DataAccessException dataAccessException = translator.translateExceptionIfPossible(noSuchDomainException...
@Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e instanceof AttributeDoesNotExistException) { return new EmptyResultDataAcce...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
@Test public void translateExceptionIfPossible_should_translate_NumberDomainsExceededException_into_DataIntegrityViolationException() { NumberDomainsExceededException numberDomainsExceededException = new NumberDomainsExceededException( "Invalid domain number"); DataAccessException dataAccessException = translator .tran...
@Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e instanceof AttributeDoesNotExistException) { return new EmptyResultDataAcce...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
@Test public void translateExceptionIfPossible_should_translate_InvalidNextTokenException_into_InvalidDataAccessApiUsageException() { InvalidNextTokenException invalidNextTokenException = new InvalidNextTokenException("Invalid Token"); DataAccessException dataAccessException = translator.translateExceptionIfPossible(in...
@Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e instanceof AttributeDoesNotExistException) { return new EmptyResultDataAcce...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
@Test public void translateExceptionIfPossible_should_translate_AmazonServiceException_into_DataAccessResourceFailureException() { AmazonServiceException amazonServiceException = new AmazonServiceException("Amazon internal exception"); DataAccessException dataAccessException = translator.translateExceptionIfPossible(am...
@Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e instanceof AttributeDoesNotExistException) { return new EmptyResultDataAcce...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
@Test public void translateExceptionIfPossible_should_translate_AmazonClientException_into_UncategorizedSpringDaoException() { AmazonClientException amazonClientException = new AmazonClientException("Amazon internal client exception"); DataAccessException dataAccessException = translator.translateExceptionIfPossible(am...
@Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e instanceof AttributeDoesNotExistException) { return new EmptyResultDataAcce...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
@Test public void translateExceptionIfPossible_should_not_interpret_non_translated_exception_like_mapping_exceptions() { MappingException mappingException = new MappingException("Invalid Query"); DataAccessException dataAccessException = translator.translateExceptionIfPossible(mappingException); assertThat(dataAccessEx...
@Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e instanceof AttributeDoesNotExistException) { return new EmptyResultDataAcce...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
SimpleDbExceptionTranslator implements PersistenceExceptionTranslator { @Override public DataAccessException translateExceptionIfPossible(RuntimeException e) { final String errorMessage = e.getLocalizedMessage(); if(e instanceof DuplicateItemNameException) { return new DuplicateKeyException(errorMessage, e); } if(e ins...
@Test public void objectToStringMapNull() { MediaLibraryStatistics statistics = null; Map<String, String> stringStringMap = Util.objectToStringMap(statistics); assertNull(stringStringMap); }
public static Map<String, String> objectToStringMap(Object object) { TypeReference<HashMap<String, String>> typeReference = new TypeReference<HashMap<String, String>>() {}; return objectMapper.convertValue(object, typeReference); }
Util { public static Map<String, String> objectToStringMap(Object object) { TypeReference<HashMap<String, String>> typeReference = new TypeReference<HashMap<String, String>>() {}; return objectMapper.convertValue(object, typeReference); } }
Util { public static Map<String, String> objectToStringMap(Object object) { TypeReference<HashMap<String, String>> typeReference = new TypeReference<HashMap<String, String>>() {}; return objectMapper.convertValue(object, typeReference); } private Util(); }
Util { public static Map<String, String> objectToStringMap(Object object) { TypeReference<HashMap<String, String>> typeReference = new TypeReference<HashMap<String, String>>() {}; return objectMapper.convertValue(object, typeReference); } private Util(); static String getDefaultMusicFolder(); static String getDefaultP...
Util { public static Map<String, String> objectToStringMap(Object object) { TypeReference<HashMap<String, String>> typeReference = new TypeReference<HashMap<String, String>>() {}; return objectMapper.convertValue(object, typeReference); } private Util(); static String getDefaultMusicFolder(); static String getDefaultP...
@Test public void testRedirectLoop() { List<InternetRadioSource> radioSources = internetRadioService.getInternetRadioSources(radioMoveLoop); Assert.assertEquals(0, radioSources.size()); }
public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG.debug("Retrieving sour...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
@Test public void objectToStringMap() { Date date = new Date(1568350960725L); MediaLibraryStatistics statistics = new MediaLibraryStatistics(date); statistics.incrementAlbums(5); statistics.incrementSongs(4); statistics.incrementArtists(910823); statistics.incrementTotalDurationInSeconds(30); statistics.incrementTotalL...
public static Map<String, String> objectToStringMap(Object object) { TypeReference<HashMap<String, String>> typeReference = new TypeReference<HashMap<String, String>>() {}; return objectMapper.convertValue(object, typeReference); }
Util { public static Map<String, String> objectToStringMap(Object object) { TypeReference<HashMap<String, String>> typeReference = new TypeReference<HashMap<String, String>>() {}; return objectMapper.convertValue(object, typeReference); } }
Util { public static Map<String, String> objectToStringMap(Object object) { TypeReference<HashMap<String, String>> typeReference = new TypeReference<HashMap<String, String>>() {}; return objectMapper.convertValue(object, typeReference); } private Util(); }
Util { public static Map<String, String> objectToStringMap(Object object) { TypeReference<HashMap<String, String>> typeReference = new TypeReference<HashMap<String, String>>() {}; return objectMapper.convertValue(object, typeReference); } private Util(); static String getDefaultMusicFolder(); static String getDefaultP...
Util { public static Map<String, String> objectToStringMap(Object object) { TypeReference<HashMap<String, String>> typeReference = new TypeReference<HashMap<String, String>>() {}; return objectMapper.convertValue(object, typeReference); } private Util(); static String getDefaultMusicFolder(); static String getDefaultP...
@Test public void stringMapToObject() { Map<String, String> stringStringMap = new HashMap<>(); stringStringMap.put("albumCount", "5"); stringStringMap.put("songCount", "4"); stringStringMap.put("artistCount", "910823"); stringStringMap.put("totalDurationInSeconds", "30"); stringStringMap.put("totalLengthInBytes", "2930...
public static <T> T stringMapToObject(Class<T> clazz, Map<String, String> data) { return objectMapper.convertValue(data, clazz); }
Util { public static <T> T stringMapToObject(Class<T> clazz, Map<String, String> data) { return objectMapper.convertValue(data, clazz); } }
Util { public static <T> T stringMapToObject(Class<T> clazz, Map<String, String> data) { return objectMapper.convertValue(data, clazz); } private Util(); }
Util { public static <T> T stringMapToObject(Class<T> clazz, Map<String, String> data) { return objectMapper.convertValue(data, clazz); } private Util(); static String getDefaultMusicFolder(); static String getDefaultPodcastFolder(); static String getDefaultPlaylistFolder(); static boolean isWindows(); static void set...
Util { public static <T> T stringMapToObject(Class<T> clazz, Map<String, String> data) { return objectMapper.convertValue(data, clazz); } private Util(); static String getDefaultMusicFolder(); static String getDefaultPodcastFolder(); static String getDefaultPlaylistFolder(); static boolean isWindows(); static void set...
@Test public void stringMapToObjectWithExtraneousData() { Map<String, String> stringStringMap = new HashMap<>(); stringStringMap.put("albumCount", "5"); stringStringMap.put("songCount", "4"); stringStringMap.put("artistCount", "910823"); stringStringMap.put("totalDurationInSeconds", "30"); stringStringMap.put("totalLen...
public static <T> T stringMapToObject(Class<T> clazz, Map<String, String> data) { return objectMapper.convertValue(data, clazz); }
Util { public static <T> T stringMapToObject(Class<T> clazz, Map<String, String> data) { return objectMapper.convertValue(data, clazz); } }
Util { public static <T> T stringMapToObject(Class<T> clazz, Map<String, String> data) { return objectMapper.convertValue(data, clazz); } private Util(); }
Util { public static <T> T stringMapToObject(Class<T> clazz, Map<String, String> data) { return objectMapper.convertValue(data, clazz); } private Util(); static String getDefaultMusicFolder(); static String getDefaultPodcastFolder(); static String getDefaultPlaylistFolder(); static boolean isWindows(); static void set...
Util { public static <T> T stringMapToObject(Class<T> clazz, Map<String, String> data) { return objectMapper.convertValue(data, clazz); } private Util(); static String getDefaultMusicFolder(); static String getDefaultPodcastFolder(); static String getDefaultPlaylistFolder(); static boolean isWindows(); static void set...
@Test(expected = IllegalArgumentException.class) public void stringMapToValidObjectWithNoData() { Map<String, String> stringStringMap = new HashMap<>(); MediaLibraryStatistics statistics = Util.stringMapToValidObject(MediaLibraryStatistics.class, stringStringMap); }
public static <T> T stringMapToValidObject(Class<T> clazz, Map<String, String> data) { T object = stringMapToObject(clazz, data); Set<ConstraintViolation<T>> validate = validator.validate(object); if (validate.isEmpty()) { return object; } else { throw new IllegalArgumentException("Created object was not valid"); } }
Util { public static <T> T stringMapToValidObject(Class<T> clazz, Map<String, String> data) { T object = stringMapToObject(clazz, data); Set<ConstraintViolation<T>> validate = validator.validate(object); if (validate.isEmpty()) { return object; } else { throw new IllegalArgumentException("Created object was not valid")...
Util { public static <T> T stringMapToValidObject(Class<T> clazz, Map<String, String> data) { T object = stringMapToObject(clazz, data); Set<ConstraintViolation<T>> validate = validator.validate(object); if (validate.isEmpty()) { return object; } else { throw new IllegalArgumentException("Created object was not valid")...
Util { public static <T> T stringMapToValidObject(Class<T> clazz, Map<String, String> data) { T object = stringMapToObject(clazz, data); Set<ConstraintViolation<T>> validate = validator.validate(object); if (validate.isEmpty()) { return object; } else { throw new IllegalArgumentException("Created object was not valid")...
Util { public static <T> T stringMapToValidObject(Class<T> clazz, Map<String, String> data) { T object = stringMapToObject(clazz, data); Set<ConstraintViolation<T>> validate = validator.validate(object); if (validate.isEmpty()) { return object; } else { throw new IllegalArgumentException("Created object was not valid")...
@Test public void addJWTToken() { UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(uriString); String actualUri = service.addJWTToken(builder).build().toUriString(); String jwtToken = UriComponentsBuilder.fromUriString(actualUri).build().getQueryParams().getFirst( JWTSecurityService.JWT_PARAM_NAME); De...
public String addJWTToken(String uri) { return addJWTToken(UriComponentsBuilder.fromUriString(uri)).build().toString(); }
JWTSecurityService { public String addJWTToken(String uri) { return addJWTToken(UriComponentsBuilder.fromUriString(uri)).build().toString(); } }
JWTSecurityService { public String addJWTToken(String uri) { return addJWTToken(UriComponentsBuilder.fromUriString(uri)).build().toString(); } @Autowired JWTSecurityService(SettingsService settingsService); }
JWTSecurityService { public String addJWTToken(String uri) { return addJWTToken(UriComponentsBuilder.fromUriString(uri)).build().toString(); } @Autowired JWTSecurityService(SettingsService settingsService); static String generateKey(); static Algorithm getAlgorithm(String jwtKey); String addJWTToken(String uri); UriCo...
JWTSecurityService { public String addJWTToken(String uri) { return addJWTToken(UriComponentsBuilder.fromUriString(uri)).build().toString(); } @Autowired JWTSecurityService(SettingsService settingsService); static String generateKey(); static Algorithm getAlgorithm(String jwtKey); String addJWTToken(String uri); UriCo...
@Test public void testParseSimplePlaylist() { List<InternetRadioSource> radioSources = internetRadioService.getInternetRadioSources(radio1); Assert.assertEquals(2, radioSources.size()); Assert.assertEquals(TEST_STREAM_URL_1, radioSources.get(0).getStreamUrl()); Assert.assertEquals(TEST_STREAM_URL_2, radioSources.get(1)...
public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG.debug("Retrieving sour...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
@Test public void testRedirects() { List<InternetRadioSource> radioSources = internetRadioService.getInternetRadioSources(radioMove); Assert.assertEquals(2, radioSources.size()); Assert.assertEquals(TEST_STREAM_URL_3, radioSources.get(0).getStreamUrl()); Assert.assertEquals(TEST_STREAM_URL_4, radioSources.get(1).getStr...
public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG.debug("Retrieving sour...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
@Test public void testLargeInput() { List<InternetRadioSource> radioSources = internetRadioService.getInternetRadioSources(radioLarge); Assert.assertEquals(250, radioSources.size()); }
public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG.debug("Retrieving sour...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
@Test public void testLargeInputURL() { List<InternetRadioSource> radioSources = internetRadioService.getInternetRadioSources(radioLarge2); Assert.assertEquals(1, radioSources.size()); }
public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG.debug("Retrieving sour...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
InternetRadioService { public List<InternetRadioSource> getInternetRadioSources(InternetRadio radio) { List<InternetRadioSource> sources; if (cachedSources.containsKey(radio.getId())) { LOG.debug("Got cached sources for internet radio {}!", radio.getStreamUrl()); sources = cachedSources.get(radio.getId()); } else { LOG...
@Test public void listCsars() throws Exception { ResultActions resultActions = mvc.perform( get(LIST_CSARS_URL).accept(ACCEPTED_MIME_TYPE) ).andDo(print()).andExpect(status().is2xxSuccessful()); resultActions.andExpect(jsonPath("$.links[0].rel").value("self")); resultActions.andExpect(jsonPath("$.links[0].href").value(...
@ApiOperation( value = "List all CSARs stored on the server", notes = "Returns a Hypermedia Resource containing all CSARs" + " that have been uploaded to the server and did not get removed", response = CsarResources.class, produces = "application/hal+json" ) @RequestMapping( path = "", method = RequestMethod.GET, produ...
CsarController { @ApiOperation( value = "List all CSARs stored on the server", notes = "Returns a Hypermedia Resource containing all CSARs" + " that have been uploaded to the server and did not get removed", response = CsarResources.class, produces = "application/hal+json" ) @RequestMapping( path = "", method = Request...
CsarController { @ApiOperation( value = "List all CSARs stored on the server", notes = "Returns a Hypermedia Resource containing all CSARs" + " that have been uploaded to the server and did not get removed", response = CsarResources.class, produces = "application/hal+json" ) @RequestMapping( path = "", method = Request...
CsarController { @ApiOperation( value = "List all CSARs stored on the server", notes = "Returns a Hypermedia Resource containing all CSARs" + " that have been uploaded to the server and did not get removed", response = CsarResources.class, produces = "application/hal+json" ) @RequestMapping( path = "", method = Request...
CsarController { @ApiOperation( value = "List all CSARs stored on the server", notes = "Returns a Hypermedia Resource containing all CSARs" + " that have been uploaded to the server and did not get removed", response = CsarResources.class, produces = "application/hal+json" ) @RequestMapping( path = "", method = Request...
@Test public void testBuilderWithMarkdownString() { logger.info("Initilaizing Readme Builder"); ReadmeBuilder builder = new ReadmeBuilder("# Hello World", "Hello"); logger.info("Rendering"); String result = builder.toString(); logger.info("Rendered: {}", result); assertTrue(result.contains("<h1>Hello World</h1>")); ass...
@Override public String toString() { Parser markdownParser = Parser.builder().build(); Node markdownDocument = markdownParser.parse(this.markdownText); HtmlRenderer renderer = HtmlRenderer.builder().build(); return TEMPLATE.replace(README_TEMPLATE_TITLE_KEY, this.pageTitle) .replace(README_TEMPLATE_BODY_KEY, renderer.r...
ReadmeBuilder { @Override public String toString() { Parser markdownParser = Parser.builder().build(); Node markdownDocument = markdownParser.parse(this.markdownText); HtmlRenderer renderer = HtmlRenderer.builder().build(); return TEMPLATE.replace(README_TEMPLATE_TITLE_KEY, this.pageTitle) .replace(README_TEMPLATE_BODY...
ReadmeBuilder { @Override public String toString() { Parser markdownParser = Parser.builder().build(); Node markdownDocument = markdownParser.parse(this.markdownText); HtmlRenderer renderer = HtmlRenderer.builder().build(); return TEMPLATE.replace(README_TEMPLATE_TITLE_KEY, this.pageTitle) .replace(README_TEMPLATE_BODY...
ReadmeBuilder { @Override public String toString() { Parser markdownParser = Parser.builder().build(); Node markdownDocument = markdownParser.parse(this.markdownText); HtmlRenderer renderer = HtmlRenderer.builder().build(); return TEMPLATE.replace(README_TEMPLATE_TITLE_KEY, this.pageTitle) .replace(README_TEMPLATE_BODY...
ReadmeBuilder { @Override public String toString() { Parser markdownParser = Parser.builder().build(); Node markdownDocument = markdownParser.parse(this.markdownText); HtmlRenderer renderer = HtmlRenderer.builder().build(); return TEMPLATE.replace(README_TEMPLATE_TITLE_KEY, this.pageTitle) .replace(README_TEMPLATE_BODY...
@Test(expected = ValidationFailureException.class) public void modelCheckTest() throws Exception { EffectiveModel singleComputeModel = new EffectiveModelFactory().create(TestCsars.VALID_SINGLE_COMPUTE_WINDOWS_TEMPLATE, logMock()); TransformationContext context = setUpMockTransformationContext(singleComputeModel); Kuber...
@Override public KubernetesLifecycle getInstance(TransformationContext context) throws Exception { return new KubernetesLifecycle(context, mapper); }
KubernetesPlugin extends ToscanaPlugin<KubernetesLifecycle> { @Override public KubernetesLifecycle getInstance(TransformationContext context) throws Exception { return new KubernetesLifecycle(context, mapper); } }
KubernetesPlugin extends ToscanaPlugin<KubernetesLifecycle> { @Override public KubernetesLifecycle getInstance(TransformationContext context) throws Exception { return new KubernetesLifecycle(context, mapper); } @Autowired KubernetesPlugin(BaseImageMapper mapper); }
KubernetesPlugin extends ToscanaPlugin<KubernetesLifecycle> { @Override public KubernetesLifecycle getInstance(TransformationContext context) throws Exception { return new KubernetesLifecycle(context, mapper); } @Autowired KubernetesPlugin(BaseImageMapper mapper); @Override KubernetesLifecycle getInstance(Transformati...
KubernetesPlugin extends ToscanaPlugin<KubernetesLifecycle> { @Override public KubernetesLifecycle getInstance(TransformationContext context) throws Exception { return new KubernetesLifecycle(context, mapper); } @Autowired KubernetesPlugin(BaseImageMapper mapper); @Override KubernetesLifecycle getInstance(Transformati...
@Test public void validate() { Optional<String> result = SudoUtils.getSudoInstallCommand(input); if (expected == null) { assertTrue(!result.isPresent()); return; } String r = result.get(); assertEquals(r, expected); }
public static Optional<String> getSudoInstallCommand(String baseImage) { String imageName = baseImage.split(":")[0]; return Optional.ofNullable(IMAGE_MAP.get(imageName)); }
SudoUtils { public static Optional<String> getSudoInstallCommand(String baseImage) { String imageName = baseImage.split(":")[0]; return Optional.ofNullable(IMAGE_MAP.get(imageName)); } }
SudoUtils { public static Optional<String> getSudoInstallCommand(String baseImage) { String imageName = baseImage.split(":")[0]; return Optional.ofNullable(IMAGE_MAP.get(imageName)); } }
SudoUtils { public static Optional<String> getSudoInstallCommand(String baseImage) { String imageName = baseImage.split(":")[0]; return Optional.ofNullable(IMAGE_MAP.get(imageName)); } static Optional<String> getSudoInstallCommand(String baseImage); }
SudoUtils { public static Optional<String> getSudoInstallCommand(String baseImage) { String imageName = baseImage.split(":")[0]; return Optional.ofNullable(IMAGE_MAP.get(imageName)); } static Optional<String> getSudoInstallCommand(String baseImage); }
@Test public void testReplicationControllerCreation() { ResourceFileCreator resourceFileCreator = new ResourceFileCreator(Pod.getPods(TestNodeStacks.getLampNodeStacks(logMock()))); HashMap<String, String> result = null; try { result = resourceFileCreator.getResourceYaml(); } catch (JsonProcessingException e) { e.printS...
public HashMap<String, String> getResourceYaml() throws JsonProcessingException { HashMap<String, String> result = new HashMap<>(); for (IKubernetesResource<?> resource : resources) { result.put(resource.getName(), resource.toYaml()); } return result; }
ResourceFileCreator { public HashMap<String, String> getResourceYaml() throws JsonProcessingException { HashMap<String, String> result = new HashMap<>(); for (IKubernetesResource<?> resource : resources) { result.put(resource.getName(), resource.toYaml()); } return result; } }
ResourceFileCreator { public HashMap<String, String> getResourceYaml() throws JsonProcessingException { HashMap<String, String> result = new HashMap<>(); for (IKubernetesResource<?> resource : resources) { result.put(resource.getName(), resource.toYaml()); } return result; } ResourceFileCreator(Collection<Pod> pods); }
ResourceFileCreator { public HashMap<String, String> getResourceYaml() throws JsonProcessingException { HashMap<String, String> result = new HashMap<>(); for (IKubernetesResource<?> resource : resources) { result.put(resource.getName(), resource.toYaml()); } return result; } ResourceFileCreator(Collection<Pod> pods); H...
ResourceFileCreator { public HashMap<String, String> getResourceYaml() throws JsonProcessingException { HashMap<String, String> result = new HashMap<>(); for (IKubernetesResource<?> resource : resources) { result.put(resource.getName(), resource.toYaml()); } return result; } ResourceFileCreator(Collection<Pod> pods); H...
@Test public void testNoneSet() { assertFalse(anythingSet(new OsCapability(entity))); }
public static boolean anythingSet(OsCapability capability) { Optional[] optionals = { capability.getDistribution(), capability.getArchitecture(), capability.getType(), capability.getVersion() }; return Arrays.stream(optionals).anyMatch(Optional::isPresent); }
MapperUtils { public static boolean anythingSet(OsCapability capability) { Optional[] optionals = { capability.getDistribution(), capability.getArchitecture(), capability.getType(), capability.getVersion() }; return Arrays.stream(optionals).anyMatch(Optional::isPresent); } }
MapperUtils { public static boolean anythingSet(OsCapability capability) { Optional[] optionals = { capability.getDistribution(), capability.getArchitecture(), capability.getType(), capability.getVersion() }; return Arrays.stream(optionals).anyMatch(Optional::isPresent); } }
MapperUtils { public static boolean anythingSet(OsCapability capability) { Optional[] optionals = { capability.getDistribution(), capability.getArchitecture(), capability.getType(), capability.getVersion() }; return Arrays.stream(optionals).anyMatch(Optional::isPresent); } static boolean anythingSet(OsCapability capab...
MapperUtils { public static boolean anythingSet(OsCapability capability) { Optional[] optionals = { capability.getDistribution(), capability.getArchitecture(), capability.getType(), capability.getVersion() }; return Arrays.stream(optionals).anyMatch(Optional::isPresent); } static boolean anythingSet(OsCapability capab...
@Test public void testOneSet() { assertTrue(anythingSet(new OsCapability(entity).setType(Type.LINUX))); }
public static boolean anythingSet(OsCapability capability) { Optional[] optionals = { capability.getDistribution(), capability.getArchitecture(), capability.getType(), capability.getVersion() }; return Arrays.stream(optionals).anyMatch(Optional::isPresent); }
MapperUtils { public static boolean anythingSet(OsCapability capability) { Optional[] optionals = { capability.getDistribution(), capability.getArchitecture(), capability.getType(), capability.getVersion() }; return Arrays.stream(optionals).anyMatch(Optional::isPresent); } }
MapperUtils { public static boolean anythingSet(OsCapability capability) { Optional[] optionals = { capability.getDistribution(), capability.getArchitecture(), capability.getType(), capability.getVersion() }; return Arrays.stream(optionals).anyMatch(Optional::isPresent); } }
MapperUtils { public static boolean anythingSet(OsCapability capability) { Optional[] optionals = { capability.getDistribution(), capability.getArchitecture(), capability.getType(), capability.getVersion() }; return Arrays.stream(optionals).anyMatch(Optional::isPresent); } static boolean anythingSet(OsCapability capab...
MapperUtils { public static boolean anythingSet(OsCapability capability) { Optional[] optionals = { capability.getDistribution(), capability.getArchitecture(), capability.getType(), capability.getVersion() }; return Arrays.stream(optionals).anyMatch(Optional::isPresent); } static boolean anythingSet(OsCapability capab...
@Test public void testMapOsCapabilityToImageId() throws ParseException { try { String imageId = capabilityMapper.mapOsCapabilityToImageId(osCapability); Assert.assertThat(imageId, CoreMatchers.containsString("ami-")); } catch (SdkClientException se) { logger.info("Probably no internet connection / credentials, omitting...
public String mapOsCapabilityToImageId(OsCapability osCapability) throws SdkClientException, ParseException, IllegalArgumentException { AmazonEC2 ec2 = AmazonEC2ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) .withRegion(awsRegion) .build(); DescribeImagesRequest describeImag...
CapabilityMapper { public String mapOsCapabilityToImageId(OsCapability osCapability) throws SdkClientException, ParseException, IllegalArgumentException { AmazonEC2 ec2 = AmazonEC2ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) .withRegion(awsRegion) .build(); DescribeImagesR...
CapabilityMapper { public String mapOsCapabilityToImageId(OsCapability osCapability) throws SdkClientException, ParseException, IllegalArgumentException { AmazonEC2 ec2 = AmazonEC2ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) .withRegion(awsRegion) .build(); DescribeImagesR...
CapabilityMapper { public String mapOsCapabilityToImageId(OsCapability osCapability) throws SdkClientException, ParseException, IllegalArgumentException { AmazonEC2 ec2 = AmazonEC2ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) .withRegion(awsRegion) .build(); DescribeImagesR...
CapabilityMapper { public String mapOsCapabilityToImageId(OsCapability osCapability) throws SdkClientException, ParseException, IllegalArgumentException { AmazonEC2 ec2 = AmazonEC2ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(awsCredentials)) .withRegion(awsRegion) .build(); DescribeImagesR...
@Test public void testMapComputeCapabilityToInstanceTypeEC2() { String instanceType = capabilityMapper.mapComputeCapabilityToInstanceType(containerCapability, EC2_DISTINCTION); Assert.assertEquals(instanceType, expectedEC2); }
public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws IllegalArgumentException { Integer numCpus = computeCapability.getNumCpus().orElse(0); Integer memSize = computeCapability.getMemSizeInMb().orElse(0); final ImmutableList<InstanceType> instanceTypes; if (EC2...
CapabilityMapper { public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws IllegalArgumentException { Integer numCpus = computeCapability.getNumCpus().orElse(0); Integer memSize = computeCapability.getMemSizeInMb().orElse(0); final ImmutableList<InstanceType> ins...
CapabilityMapper { public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws IllegalArgumentException { Integer numCpus = computeCapability.getNumCpus().orElse(0); Integer memSize = computeCapability.getMemSizeInMb().orElse(0); final ImmutableList<InstanceType> ins...
CapabilityMapper { public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws IllegalArgumentException { Integer numCpus = computeCapability.getNumCpus().orElse(0); Integer memSize = computeCapability.getMemSizeInMb().orElse(0); final ImmutableList<InstanceType> ins...
CapabilityMapper { public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws IllegalArgumentException { Integer numCpus = computeCapability.getNumCpus().orElse(0); Integer memSize = computeCapability.getMemSizeInMb().orElse(0); final ImmutableList<InstanceType> ins...
@Test public void testMapComputeCapabilityToInstanceTypeRDS() { String instanceType = capabilityMapper.mapComputeCapabilityToInstanceType(containerCapability, RDS_DISTINCTION); Assert.assertEquals(instanceType, expectedRDS); }
public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws IllegalArgumentException { Integer numCpus = computeCapability.getNumCpus().orElse(0); Integer memSize = computeCapability.getMemSizeInMb().orElse(0); final ImmutableList<InstanceType> instanceTypes; if (EC2...
CapabilityMapper { public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws IllegalArgumentException { Integer numCpus = computeCapability.getNumCpus().orElse(0); Integer memSize = computeCapability.getMemSizeInMb().orElse(0); final ImmutableList<InstanceType> ins...
CapabilityMapper { public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws IllegalArgumentException { Integer numCpus = computeCapability.getNumCpus().orElse(0); Integer memSize = computeCapability.getMemSizeInMb().orElse(0); final ImmutableList<InstanceType> ins...
CapabilityMapper { public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws IllegalArgumentException { Integer numCpus = computeCapability.getNumCpus().orElse(0); Integer memSize = computeCapability.getMemSizeInMb().orElse(0); final ImmutableList<InstanceType> ins...
CapabilityMapper { public String mapComputeCapabilityToInstanceType(ComputeCapability computeCapability, String distinction) throws IllegalArgumentException { Integer numCpus = computeCapability.getNumCpus().orElse(0); Integer memSize = computeCapability.getMemSizeInMb().orElse(0); final ImmutableList<InstanceType> ins...
@Test public void testMapComputeCapabilityToRDSAllocatedStorage() { int newDiskSize = capabilityMapper.mapComputeCapabilityToRDSAllocatedStorage(containerCapability); Assert.assertEquals(newDiskSize, expectedDiskSize); }
public Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability) { final Integer minSize = 20; final Integer maxSize = 6144; Integer diskSize = computeCapability.getDiskSizeInMb().orElse(minSize * 1000); diskSize = diskSize / 1000; if (diskSize > maxSize) { logger.debug("Disk size: '{}'", m...
CapabilityMapper { public Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability) { final Integer minSize = 20; final Integer maxSize = 6144; Integer diskSize = computeCapability.getDiskSizeInMb().orElse(minSize * 1000); diskSize = diskSize / 1000; if (diskSize > maxSize) { logger.debug("...
CapabilityMapper { public Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability) { final Integer minSize = 20; final Integer maxSize = 6144; Integer diskSize = computeCapability.getDiskSizeInMb().orElse(minSize * 1000); diskSize = diskSize / 1000; if (diskSize > maxSize) { logger.debug("...
CapabilityMapper { public Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability) { final Integer minSize = 20; final Integer maxSize = 6144; Integer diskSize = computeCapability.getDiskSizeInMb().orElse(minSize * 1000); diskSize = diskSize / 1000; if (diskSize > maxSize) { logger.debug("...
CapabilityMapper { public Integer mapComputeCapabilityToRDSAllocatedStorage(ComputeCapability computeCapability) { final Integer minSize = 20; final Integer maxSize = 6144; Integer diskSize = computeCapability.getDiskSizeInMb().orElse(minSize * 1000); diskSize = diskSize / 1000; if (diskSize > maxSize) { logger.debug("...
@Test public void testDelete() throws Exception { final boolean[] executed = new boolean[]{false}; doAnswer(iom -> executed[0] = true).when(service).deleteCsar(any(Csar.class)); mvc.perform( delete(DELETE_VALID_CSAR_URL).accept(ACCEPTED_MIME_TYPE) ).andDo(print()) .andExpect(status().is(200)) .andExpect(content().bytes...
@ApiOperation( value = "Deletes a Existing CSAR", notes = "Deletes the Resulting CSAR and its transformations (if none of them is running). " + "If a transformation is running (in the state TRANSFORMING) the CSAR cannot be deleted" ) @ApiResponses({ @ApiResponse( code = 200, message = "The deletion of the CSAR was succ...
CsarController { @ApiOperation( value = "Deletes a Existing CSAR", notes = "Deletes the Resulting CSAR and its transformations (if none of them is running). " + "If a transformation is running (in the state TRANSFORMING) the CSAR cannot be deleted" ) @ApiResponses({ @ApiResponse( code = 200, message = "The deletion of ...
CsarController { @ApiOperation( value = "Deletes a Existing CSAR", notes = "Deletes the Resulting CSAR and its transformations (if none of them is running). " + "If a transformation is running (in the state TRANSFORMING) the CSAR cannot be deleted" ) @ApiResponses({ @ApiResponse( code = 200, message = "The deletion of ...
CsarController { @ApiOperation( value = "Deletes a Existing CSAR", notes = "Deletes the Resulting CSAR and its transformations (if none of them is running). " + "If a transformation is running (in the state TRANSFORMING) the CSAR cannot be deleted" ) @ApiResponses({ @ApiResponse( code = 200, message = "The deletion of ...
CsarController { @ApiOperation( value = "Deletes a Existing CSAR", notes = "Deletes the Resulting CSAR and its transformations (if none of them is running). " + "If a transformation is running (in the state TRANSFORMING) the CSAR cannot be deleted" ) @ApiResponses({ @ApiResponse( code = 200, message = "The deletion of ...
@Test public void testWriteScripts() throws Exception { cfnModule.addFileUpload(new FileUpload(FILENAME_TEST_FILE, FROM_CSAR)); fileCreator.writeScripts(); File deployScript = new File(targetDir, SCRIPTS_DIR_PATH + FILENAME_DEPLOY + BASH_FILE_ENDING); File fileUploadScript = new File(targetDir, SCRIPTS_DIR_PATH + FILEN...
public void writeScripts() throws IOException { writeFileUploadScript(); writeStackCreationScript(); writeDeployScript(); writeCleanUpScript(); }
CloudFormationFileCreator { public void writeScripts() throws IOException { writeFileUploadScript(); writeStackCreationScript(); writeDeployScript(); writeCleanUpScript(); } }
CloudFormationFileCreator { public void writeScripts() throws IOException { writeFileUploadScript(); writeStackCreationScript(); writeDeployScript(); writeCleanUpScript(); } CloudFormationFileCreator(TransformationContext context, CloudFormationModule cfnModule); }
CloudFormationFileCreator { public void writeScripts() throws IOException { writeFileUploadScript(); writeStackCreationScript(); writeDeployScript(); writeCleanUpScript(); } CloudFormationFileCreator(TransformationContext context, CloudFormationModule cfnModule); void copyFiles(); void writeScripts(); void copyUtilScri...
CloudFormationFileCreator { public void writeScripts() throws IOException { writeFileUploadScript(); writeStackCreationScript(); writeDeployScript(); writeCleanUpScript(); } CloudFormationFileCreator(TransformationContext context, CloudFormationModule cfnModule); void copyFiles(); void writeScripts(); void copyUtilScri...
@Test public void copyUtilScripts() throws Exception { fileCreator.copyUtilScripts(); File createBucketUtilScript = new File(targetDir, UTIL_DIR_PATH + FILENAME_CREATE_BUCKET + BASH_FILE_ENDING); File uploadFileUtilScript = new File(targetDir, UTIL_DIR_PATH + FILENAME_UPLOAD_FILE + BASH_FILE_ENDING); assertTrue(createB...
public void copyUtilScripts() throws IOException { List<String> utilScripts = IOUtils.readLines( getClass().getResourceAsStream(FILEPATH_SCRIPTS_UTIL + "scripts-list"), Charsets.UTF_8 ); logger.debug("Copying util scripts to the target artifact."); copyUtilFile(utilScripts, FILEPATH_SCRIPTS_UTIL, UTIL_DIR_PATH); }
CloudFormationFileCreator { public void copyUtilScripts() throws IOException { List<String> utilScripts = IOUtils.readLines( getClass().getResourceAsStream(FILEPATH_SCRIPTS_UTIL + "scripts-list"), Charsets.UTF_8 ); logger.debug("Copying util scripts to the target artifact."); copyUtilFile(utilScripts, FILEPATH_SCRIPTS_...
CloudFormationFileCreator { public void copyUtilScripts() throws IOException { List<String> utilScripts = IOUtils.readLines( getClass().getResourceAsStream(FILEPATH_SCRIPTS_UTIL + "scripts-list"), Charsets.UTF_8 ); logger.debug("Copying util scripts to the target artifact."); copyUtilFile(utilScripts, FILEPATH_SCRIPTS_...
CloudFormationFileCreator { public void copyUtilScripts() throws IOException { List<String> utilScripts = IOUtils.readLines( getClass().getResourceAsStream(FILEPATH_SCRIPTS_UTIL + "scripts-list"), Charsets.UTF_8 ); logger.debug("Copying util scripts to the target artifact."); copyUtilFile(utilScripts, FILEPATH_SCRIPTS_...
CloudFormationFileCreator { public void copyUtilScripts() throws IOException { List<String> utilScripts = IOUtils.readLines( getClass().getResourceAsStream(FILEPATH_SCRIPTS_UTIL + "scripts-list"), Charsets.UTF_8 ); logger.debug("Copying util scripts to the target artifact."); copyUtilFile(utilScripts, FILEPATH_SCRIPTS_...
@Test public void copyFiles() { cfnModule.addFileUpload(new FileUpload(FILENAME_TEST_FILE, FROM_CSAR)); fileCreator.copyFiles(); assertTrue(FILEPATH_TARGET_TEST_FILE.exists()); }
public void copyFiles() { List<String> fileUploadList = getFilePaths(getFileUploadByType(cfnModule.getFileUploadList(), FROM_CSAR)); logger.debug("Checking if files need to be copied."); if (!fileUploadList.isEmpty()) { logger.debug("Files to be copied found. Attempting to copy files to the target artifact."); fileUplo...
CloudFormationFileCreator { public void copyFiles() { List<String> fileUploadList = getFilePaths(getFileUploadByType(cfnModule.getFileUploadList(), FROM_CSAR)); logger.debug("Checking if files need to be copied."); if (!fileUploadList.isEmpty()) { logger.debug("Files to be copied found. Attempting to copy files to the ...
CloudFormationFileCreator { public void copyFiles() { List<String> fileUploadList = getFilePaths(getFileUploadByType(cfnModule.getFileUploadList(), FROM_CSAR)); logger.debug("Checking if files need to be copied."); if (!fileUploadList.isEmpty()) { logger.debug("Files to be copied found. Attempting to copy files to the ...
CloudFormationFileCreator { public void copyFiles() { List<String> fileUploadList = getFilePaths(getFileUploadByType(cfnModule.getFileUploadList(), FROM_CSAR)); logger.debug("Checking if files need to be copied."); if (!fileUploadList.isEmpty()) { logger.debug("Files to be copied found. Attempting to copy files to the ...
CloudFormationFileCreator { public void copyFiles() { List<String> fileUploadList = getFilePaths(getFileUploadByType(cfnModule.getFileUploadList(), FROM_CSAR)); logger.debug("Checking if files need to be copied."); if (!fileUploadList.isEmpty()) { logger.debug("Files to be copied found. Attempting to copy files to the ...
@Test public void appendTest() throws IOException { String string = UUID.randomUUID().toString(); bashScript.append(string); File expectedGeneratedScript = new File(targetScriptFolder, fileName + ".sh"); List<String> result = IOUtils.readLines(new FileInputStream(expectedGeneratedScript)); assertEquals(string, result.g...
public void append(String string) throws IOException { logger.debug("Appending {} to {}.sh", string, name); access.access(scriptPath).appendln(string).close(); }
BashScript { public void append(String string) throws IOException { logger.debug("Appending {} to {}.sh", string, name); access.access(scriptPath).appendln(string).close(); } }
BashScript { public void append(String string) throws IOException { logger.debug("Appending {} to {}.sh", string, name); access.access(scriptPath).appendln(string).close(); } BashScript(PluginFileAccess access, String name); }
BashScript { public void append(String string) throws IOException { logger.debug("Appending {} to {}.sh", string, name); access.access(scriptPath).appendln(string).close(); } BashScript(PluginFileAccess access, String name); void append(String string); void checkEnvironment(String command); String getScriptPath(); }
BashScript { public void append(String string) throws IOException { logger.debug("Appending {} to {}.sh", string, name); access.access(scriptPath).appendln(string).close(); } BashScript(PluginFileAccess access, String name); void append(String string); void checkEnvironment(String command); String getScriptPath(); stat...
@Test public void unzipFile() throws IOException { ZipInputStream is = new ZipInputStream(new FileInputStream(TestCsars.VALID_LAMP_INPUT)); boolean result = ZipUtility.unzip(is, tmpdir.toString()); assertTrue(result); }
public static boolean unzip(ZipInputStream zipIn, String destDirectory) throws IOException { File destDir = new File(destDirectory); if (!destDir.exists()) { destDir.mkdir(); } ZipEntry entry = zipIn.getNextEntry(); if (entry == null) { return false; } while (entry != null) { String filePath = destDirectory + File.sepa...
ZipUtility { public static boolean unzip(ZipInputStream zipIn, String destDirectory) throws IOException { File destDir = new File(destDirectory); if (!destDir.exists()) { destDir.mkdir(); } ZipEntry entry = zipIn.getNextEntry(); if (entry == null) { return false; } while (entry != null) { String filePath = destDirector...
ZipUtility { public static boolean unzip(ZipInputStream zipIn, String destDirectory) throws IOException { File destDir = new File(destDirectory); if (!destDir.exists()) { destDir.mkdir(); } ZipEntry entry = zipIn.getNextEntry(); if (entry == null) { return false; } while (entry != null) { String filePath = destDirector...
ZipUtility { public static boolean unzip(ZipInputStream zipIn, String destDirectory) throws IOException { File destDir = new File(destDirectory); if (!destDir.exists()) { destDir.mkdir(); } ZipEntry entry = zipIn.getNextEntry(); if (entry == null) { return false; } while (entry != null) { String filePath = destDirector...
ZipUtility { public static boolean unzip(ZipInputStream zipIn, String destDirectory) throws IOException { File destDir = new File(destDirectory); if (!destDir.exists()) { destDir.mkdir(); } ZipEntry entry = zipIn.getNextEntry(); if (entry == null) { return false; } while (entry != null) { String filePath = destDirector...