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 testCreateNewTask() { SensorTask newTask = sensorTaskRepository.createNewSensorTask(PROCEDURE_1); assertEquals("Different procedure id of new task.", PROCEDURE_1, newTask.getProcedure()); assertAmountOfCreatedTasksAvailable(sensorTaskRepository, PROCEDURE_1, 1); }
public SensorTask createNewSensorTask(String procedure) { String taskId = taskIdGenerator.generatePrefixedId(procedure, "/"); SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); SensorTask sensorTask = new SensorTask(taskId, procedure); sensorTasks.put(sensorTaskKey, sensorTask); return sensorTask; }
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask createNewSensorTask(String procedure) { String taskId = taskIdGenerator.generatePrefixedId(procedure, "/"); SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); SensorTask sensorTask = new SensorTask(taskId, procedure); sens...
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask createNewSensorTask(String procedure) { String taskId = taskIdGenerator.generatePrefixedId(procedure, "/"); SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); SensorTask sensorTask = new SensorTask(taskId, procedure); sens...
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask createNewSensorTask(String procedure) { String taskId = taskIdGenerator.generatePrefixedId(procedure, "/"); SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); SensorTask sensorTask = new SensorTask(taskId, procedure); sens...
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask createNewSensorTask(String procedure) { String taskId = taskIdGenerator.generatePrefixedId(procedure, "/"); SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); SensorTask sensorTask = new SensorTask(taskId, procedure); sens...
@Test public void testGetTask() { SensorTaskRepository sensorTaskRepository = new InMemorySensorTaskRepository(); SensorTask newTask = sensorTaskRepository.createNewSensorTask(PROCEDURE_1); assertEquals("tasks are not equal!", newTask, sensorTaskRepository.getTask(newTask.getTaskId())); }
public SensorTask getTask(String taskId) { for (SensorTask sensorTask : sensorTasks.values()) { if (sensorTask.getTaskId().equals(taskId)) { return sensorTask; } } return null; }
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask getTask(String taskId) { for (SensorTask sensorTask : sensorTasks.values()) { if (sensorTask.getTaskId().equals(taskId)) { return sensorTask; } } return null; } }
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask getTask(String taskId) { for (SensorTask sensorTask : sensorTasks.values()) { if (sensorTask.getTaskId().equals(taskId)) { return sensorTask; } } return null; } }
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask getTask(String taskId) { for (SensorTask sensorTask : sensorTasks.values()) { if (sensorTask.getTaskId().equals(taskId)) { return sensorTask; } } return null; } SensorTask createNewSensorTask(String procedure); void saveOrUpdateSensorTask...
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask getTask(String taskId) { for (SensorTask sensorTask : sensorTasks.values()) { if (sensorTask.getTaskId().equals(taskId)) { return sensorTask; } } return null; } SensorTask createNewSensorTask(String procedure); void saveOrUpdateSensorTask...
@Test public void testGetSensorTaskIds() { List<SensorTask> createdSensorTasks = new ArrayList<SensorTask>(); createdSensorTasks.add(sensorTaskRepository.createNewSensorTask(PROCEDURE_1)); createdSensorTasks.add(sensorTaskRepository.createNewSensorTask(PROCEDURE_1)); createdSensorTasks.add(sensorTaskRepository.createNe...
public Iterable<String> getSensorTaskIds(String procedure) { List<String> taskIds = new ArrayList<String>(); for (SensorTask sensorTask : sensorTasks.values()) { if (sensorTask.getProcedure().equals(procedure)) { taskIds.add(sensorTask.getTaskId()); } } return taskIds; }
InMemorySensorTaskRepository implements SensorTaskRepository { public Iterable<String> getSensorTaskIds(String procedure) { List<String> taskIds = new ArrayList<String>(); for (SensorTask sensorTask : sensorTasks.values()) { if (sensorTask.getProcedure().equals(procedure)) { taskIds.add(sensorTask.getTaskId()); } } ret...
InMemorySensorTaskRepository implements SensorTaskRepository { public Iterable<String> getSensorTaskIds(String procedure) { List<String> taskIds = new ArrayList<String>(); for (SensorTask sensorTask : sensorTasks.values()) { if (sensorTask.getProcedure().equals(procedure)) { taskIds.add(sensorTask.getTaskId()); } } ret...
InMemorySensorTaskRepository implements SensorTaskRepository { public Iterable<String> getSensorTaskIds(String procedure) { List<String> taskIds = new ArrayList<String>(); for (SensorTask sensorTask : sensorTasks.values()) { if (sensorTask.getProcedure().equals(procedure)) { taskIds.add(sensorTask.getTaskId()); } } ret...
InMemorySensorTaskRepository implements SensorTaskRepository { public Iterable<String> getSensorTaskIds(String procedure) { List<String> taskIds = new ArrayList<String>(); for (SensorTask sensorTask : sensorTasks.values()) { if (sensorTask.getProcedure().equals(procedure)) { taskIds.add(sensorTask.getTaskId()); } } ret...
@Test public void testGetSensorTasks() { List<SensorTask> createdSensorTasks = new ArrayList<SensorTask>(); createdSensorTasks.add(sensorTaskRepository.createNewSensorTask(PROCEDURE_1)); createdSensorTasks.add(sensorTaskRepository.createNewSensorTask(PROCEDURE_1)); assertAmountOfCreatedTasksAvailable(sensorTaskReposito...
public Iterable<SensorTask> getSensorTasks(String procedure) { return getAllSensorTasksFor(procedure); }
InMemorySensorTaskRepository implements SensorTaskRepository { public Iterable<SensorTask> getSensorTasks(String procedure) { return getAllSensorTasksFor(procedure); } }
InMemorySensorTaskRepository implements SensorTaskRepository { public Iterable<SensorTask> getSensorTasks(String procedure) { return getAllSensorTasksFor(procedure); } }
InMemorySensorTaskRepository implements SensorTaskRepository { public Iterable<SensorTask> getSensorTasks(String procedure) { return getAllSensorTasksFor(procedure); } SensorTask createNewSensorTask(String procedure); void saveOrUpdateSensorTask(SensorTask sensorTask); void removeSensorTask(SensorTask sensorTask); boo...
InMemorySensorTaskRepository implements SensorTaskRepository { public Iterable<SensorTask> getSensorTasks(String procedure) { return getAllSensorTasksFor(procedure); } SensorTask createNewSensorTask(String procedure); void saveOrUpdateSensorTask(SensorTask sensorTask); void removeSensorTask(SensorTask sensorTask); boo...
@Test public void testGetSensorTask() { SensorTask createdTask = sensorTaskRepository.createNewSensorTask(PROCEDURE_2); assertCorrectGetSensorTaskResponse(sensorTaskRepository, createdTask); assertInValidGetSensorTaskThrowsException(sensorTaskRepository); }
public SensorTask getSensorTask(String procedure, String taskId) throws InvalidParameterValueException { SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); if (!sensorTasks.containsKey(sensorTaskKey)) { throw new InvalidParameterValueException("task"); } else { return sensorTasks.get(sensorTaskKey); } ...
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask getSensorTask(String procedure, String taskId) throws InvalidParameterValueException { SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); if (!sensorTasks.containsKey(sensorTaskKey)) { throw new InvalidParameterValueExcept...
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask getSensorTask(String procedure, String taskId) throws InvalidParameterValueException { SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); if (!sensorTasks.containsKey(sensorTaskKey)) { throw new InvalidParameterValueExcept...
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask getSensorTask(String procedure, String taskId) throws InvalidParameterValueException { SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); if (!sensorTasks.containsKey(sensorTaskKey)) { throw new InvalidParameterValueExcept...
InMemorySensorTaskRepository implements SensorTaskRepository { public SensorTask getSensorTask(String procedure, String taskId) throws InvalidParameterValueException { SensorTaskKey sensorTaskKey = new SensorTaskKey(procedure, taskId); if (!sensorTasks.containsKey(sensorTaskKey)) { throw new InvalidParameterValueExcept...
@Test public void shouldCreateValidNcNameGmlId() { InsertSensorOfferingConverter converter = new InsertSensorOfferingConverter(); String randomGmlId = converter.createRandomGmlId(); assertTrue(randomGmlId + " is not a valid NcName!", isNCName(randomGmlId)); }
String createRandomGmlId() { return "uuid_" + UUID.randomUUID().toString(); }
InsertSensorOfferingConverter { String createRandomGmlId() { return "uuid_" + UUID.randomUUID().toString(); } }
InsertSensorOfferingConverter { String createRandomGmlId() { return "uuid_" + UUID.randomUUID().toString(); } }
InsertSensorOfferingConverter { String createRandomGmlId() { return "uuid_" + UUID.randomUUID().toString(); } SensorOfferingType convertToSensorOfferingType(final InsertSensorOffering insertSensorOffering); }
InsertSensorOfferingConverter { String createRandomGmlId() { return "uuid_" + UUID.randomUUID().toString(); } SensorOfferingType convertToSensorOfferingType(final InsertSensorOffering insertSensorOffering); }
@Test(expected = InvalidParameterValueException.class) public void testInvalidServiceInRequest() throws Exception { XmlObject submitDocument = getRequest(REQUEST_INVALID_SERVICE); validatingDelegate.validateRequiredServiceParameter(submitDocument); }
protected void validateRequiredServiceParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); String serviceParameter = "service"; if (moveToAttribute(xmlCursor, serviceParameter)) { validateServiceParameter(xmlCursor.getTextValue()); } }
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredServiceParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); String serviceParameter = "service"; if (moveToAttribute(xmlCursor, serviceParameter))...
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredServiceParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); String serviceParameter = "service"; if (moveToAttribute(xmlCursor, serviceParameter))...
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredServiceParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); String serviceParameter = "service"; if (moveToAttribute(xmlCursor, serviceParameter))...
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredServiceParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); String serviceParameter = "service"; if (moveToAttribute(xmlCursor, serviceParameter))...
@Test(expected = IllegalStateException.class) public void testCreateSensorInstanceProviderWithIncompleteSetup() throws InternalServiceException { new SensorInstanceProvider().init(); }
public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfiguration> configs = sensorConfigurationRepository.getSensorConfigu...
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfig...
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfig...
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfig...
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfig...
@Test public void testInit() throws InternalServiceException { SensorInstanceProvider provider = new SensorInstanceProvider(); setEmptyInMemoryRepositories(provider); provider.init(); assertTrue(iterableToCollection(provider.getSensors()).isEmpty()); }
public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfiguration> configs = sensorConfigurationRepository.getSensorConfigu...
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfig...
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfig...
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfig...
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfig...
@Test public void testAddSensor() throws InternalServiceException { SensorPlugin testPlugin = SimpleSensorPluginTestInstance.createInstance(); assertFalse(getSensorPluginsFrom(sensorInstanceProvider).contains(testPlugin)); ((SensorInstanceProviderSeam) sensorInstanceProvider).addSensor(testPlugin); assertTrue(getSensor...
protected void addSensor(SensorPlugin sensorInstance) { sensorInstances.add(sensorInstance); }
SensorInstanceProvider implements InsertSensorOfferingListener { protected void addSensor(SensorPlugin sensorInstance) { sensorInstances.add(sensorInstance); } }
SensorInstanceProvider implements InsertSensorOfferingListener { protected void addSensor(SensorPlugin sensorInstance) { sensorInstances.add(sensorInstance); } }
SensorInstanceProvider implements InsertSensorOfferingListener { protected void addSensor(SensorPlugin sensorInstance) { sensorInstances.add(sensorInstance); } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWi...
SensorInstanceProvider implements InsertSensorOfferingListener { protected void addSensor(SensorPlugin sensorInstance) { sensorInstances.add(sensorInstance); } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWi...
@Test public void testGetSensors() throws InternalServiceException { assertTrue(getSensorPluginsFrom(sensorInstanceProvider).isEmpty()); SensorPlugin testPlugin = SimpleSensorPluginTestInstance.createInstance(); ((SensorInstanceProviderSeam) sensorInstanceProvider).addSensor(testPlugin); SensorPlugin anotherTestPlugin ...
public Iterable<SensorPlugin> getSensors() { return sensorInstances; }
SensorInstanceProvider implements InsertSensorOfferingListener { public Iterable<SensorPlugin> getSensors() { return sensorInstances; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public Iterable<SensorPlugin> getSensors() { return sensorInstances; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public Iterable<SensorPlugin> getSensors() { return sensorInstances; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWith(String procedure); Se...
SensorInstanceProvider implements InsertSensorOfferingListener { public Iterable<SensorPlugin> getSensors() { return sensorInstances; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWith(String procedure); Se...
@Test public void testContainsTaskWith() throws InternalServiceException { SensorPlugin testPlugin = SimpleSensorPluginTestInstance.createInstance(sensorInstanceProvider); ((SensorInstanceProviderSeam) sensorInstanceProvider).addSensor(testPlugin); SensorTask testTask = testPlugin.getSensorTaskService().createNewTask()...
public boolean containsTaskWith(String taskId) { return getTaskForTaskId(taskId) != null; }
SensorInstanceProvider implements InsertSensorOfferingListener { public boolean containsTaskWith(String taskId) { return getTaskForTaskId(taskId) != null; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public boolean containsTaskWith(String taskId) { return getTaskForTaskId(taskId) != null; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public boolean containsTaskWith(String taskId) { return getTaskForTaskId(taskId) != null; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWith(...
SensorInstanceProvider implements InsertSensorOfferingListener { public boolean containsTaskWith(String taskId) { return getTaskForTaskId(taskId) != null; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWith(...
@Test public void testGetTaskForTaskId() throws InternalServiceException { SensorPlugin testPlugin = SimpleSensorPluginTestInstance.createInstance(sensorInstanceProvider); assertByTaskCreationViaGlobalTaskRepository(testPlugin); assertByTaskCreationViaSensorTaskServiceProxy(testPlugin); }
public SensorTask getTaskForTaskId(String taskId) { return getSensorTaskRepository().getTask(taskId); }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorTask getTaskForTaskId(String taskId) { return getSensorTaskRepository().getTask(taskId); } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorTask getTaskForTaskId(String taskId) { return getSensorTaskRepository().getTask(taskId); } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorTask getTaskForTaskId(String taskId) { return getSensorTaskRepository().getTask(taskId); } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean contain...
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorTask getTaskForTaskId(String taskId) { return getSensorTaskRepository().getTask(taskId); } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean contain...
@Test public void testContainsSensorWith() throws InternalServiceException { SensorPlugin testPlugin = SimpleSensorPluginTestInstance.createInstance(sensorInstanceProvider); ((SensorInstanceProviderSeam) sensorInstanceProvider).addSensor(testPlugin); assertTrue(sensorInstanceProvider.containsSensorWith(testPlugin.getPr...
public boolean containsSensorWith(String procedure) { return getSensorForProcedure(procedure) != null; }
SensorInstanceProvider implements InsertSensorOfferingListener { public boolean containsSensorWith(String procedure) { return getSensorForProcedure(procedure) != null; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public boolean containsSensorWith(String procedure) { return getSensorForProcedure(procedure) != null; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public boolean containsSensorWith(String procedure) { return getSensorForProcedure(procedure) != null; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean contai...
SensorInstanceProvider implements InsertSensorOfferingListener { public boolean containsSensorWith(String procedure) { return getSensorForProcedure(procedure) != null; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean contai...
@Test public void testGetSensorForProcedure() throws InternalServiceException { SensorPlugin testPlugin = SimpleSensorPluginTestInstance.createInstance(sensorInstanceProvider); ((SensorInstanceProviderSeam) sensorInstanceProvider).addSensor(testPlugin); assertEquals(sensorInstanceProvider.getSensorForProcedure(testPlug...
public SensorPlugin getSensorForProcedure(String procedure) { for (SensorPlugin sensorInstance : sensorInstances) { if (sensorInstance.getProcedure().equals(procedure)) { return sensorInstance; } } return null; }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForProcedure(String procedure) { for (SensorPlugin sensorInstance : sensorInstances) { if (sensorInstance.getProcedure().equals(procedure)) { return sensorInstance; } } return null; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForProcedure(String procedure) { for (SensorPlugin sensorInstance : sensorInstances) { if (sensorInstance.getProcedure().equals(procedure)) { return sensorInstance; } } return null; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForProcedure(String procedure) { for (SensorPlugin sensorInstance : sensorInstances) { if (sensorInstance.getProcedure().equals(procedure)) { return sensorInstance; } } return null; } void init(); Iterable<SensorPlugin> getSe...
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForProcedure(String procedure) { for (SensorPlugin sensorInstance : sensorInstances) { if (sensorInstance.getProcedure().equals(procedure)) { return sensorInstance; } } return null; } void init(); Iterable<SensorPlugin> getSe...
@Test public void testGetSensorForTaskId() throws InternalServiceException { SensorPlugin testPlugin = SimpleSensorPluginTestInstance.createInstance(sensorInstanceProvider); ((SensorInstanceProviderSeam) sensorInstanceProvider).addSensor(testPlugin); SensorTaskService taskService = testPlugin.getSensorTaskService(); Se...
public SensorPlugin getSensorForTaskId(String taskId) { SensorTask sensorTask = sensorTaskRepository.getTask(taskId); return getSensorForProcedure(sensorTask.getProcedure()); }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForTaskId(String taskId) { SensorTask sensorTask = sensorTaskRepository.getTask(taskId); return getSensorForProcedure(sensorTask.getProcedure()); } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForTaskId(String taskId) { SensorTask sensorTask = sensorTaskRepository.getTask(taskId); return getSensorForProcedure(sensorTask.getProcedure()); } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForTaskId(String taskId) { SensorTask sensorTask = sensorTaskRepository.getTask(taskId); return getSensorForProcedure(sensorTask.getProcedure()); } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(St...
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorPlugin getSensorForTaskId(String taskId) { SensorTask sensorTask = sensorTaskRepository.getTask(taskId); return getSensorForProcedure(sensorTask.getProcedure()); } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(St...
@Test public void testGetSensorConfigurationRepository() throws InternalServiceException { SensorInstanceProvider provider = new SensorInstanceProvider(); assertNull(provider.getSensorConfigurationRepository()); setEmptyInMemoryRepositories(provider); assertNotNull(provider.getSensorConfigurationRepository()); }
public SensorConfigurationRepository getSensorConfigurationRepository() { return sensorConfigurationRepository; }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorConfigurationRepository getSensorConfigurationRepository() { return sensorConfigurationRepository; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorConfigurationRepository getSensorConfigurationRepository() { return sensorConfigurationRepository; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorConfigurationRepository getSensorConfigurationRepository() { return sensorConfigurationRepository; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boole...
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorConfigurationRepository getSensorConfigurationRepository() { return sensorConfigurationRepository; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boole...
@Test(expected = MissingParameterValueException.class) public void testMissingVersionParameterInRequest() throws Exception { XmlObject submitDocument = getRequest(REQUEST_MISSING_VERSION); validatingDelegate.validateRequiredVersionParameter(submitDocument); }
protected void validateRequiredVersionParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); if (moveToAttribute(xmlCursor, "version")) { service.validateVersionParameter(xmlCursor.getTextValue()); } }
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredVersionParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); if (moveToAttribute(xmlCursor, "version")) { service.validateVersionParameter(xmlCurso...
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredVersionParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); if (moveToAttribute(xmlCursor, "version")) { service.validateVersionParameter(xmlCurso...
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredVersionParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); if (moveToAttribute(xmlCursor, "version")) { service.validateVersionParameter(xmlCurso...
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredVersionParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); if (moveToAttribute(xmlCursor, "version")) { service.validateVersionParameter(xmlCurso...
@Test public void testSetSensorConfigurationRepository() throws InternalServiceException { SensorInstanceProvider provider = new SensorInstanceProvider(); SensorConfigurationRepository repository = new InMemorySensorConfigurationRepository(); provider.setSensorConfigurationRepository(repository); assertEquals(repositor...
public void setSensorConfigurationRepository(SensorConfigurationRepository sensorConfigurationRepository) throws InternalServiceException { this.sensorConfigurationRepository = sensorConfigurationRepository; }
SensorInstanceProvider implements InsertSensorOfferingListener { public void setSensorConfigurationRepository(SensorConfigurationRepository sensorConfigurationRepository) throws InternalServiceException { this.sensorConfigurationRepository = sensorConfigurationRepository; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public void setSensorConfigurationRepository(SensorConfigurationRepository sensorConfigurationRepository) throws InternalServiceException { this.sensorConfigurationRepository = sensorConfigurationRepository; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public void setSensorConfigurationRepository(SensorConfigurationRepository sensorConfigurationRepository) throws InternalServiceException { this.sensorConfigurationRepository = sensorConfigurationRepository; } void init(); Iterable<SensorPlugin> getSenso...
SensorInstanceProvider implements InsertSensorOfferingListener { public void setSensorConfigurationRepository(SensorConfigurationRepository sensorConfigurationRepository) throws InternalServiceException { this.sensorConfigurationRepository = sensorConfigurationRepository; } void init(); Iterable<SensorPlugin> getSenso...
@Test public void testGetSensorTaskRepository() throws InternalServiceException { SensorInstanceProvider provider = new SensorInstanceProvider(); assertNull(provider.getSensorTaskRepository()); setEmptyInMemoryRepositories(provider); assertNotNull(provider.getSensorTaskRepository()); }
public SensorTaskRepository getSensorTaskRepository() { return sensorTaskRepository; }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorTaskRepository getSensorTaskRepository() { return sensorTaskRepository; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorTaskRepository getSensorTaskRepository() { return sensorTaskRepository; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorTaskRepository getSensorTaskRepository() { return sensorTaskRepository; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWith(Strin...
SensorInstanceProvider implements InsertSensorOfferingListener { public SensorTaskRepository getSensorTaskRepository() { return sensorTaskRepository; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWith(Strin...
@Test public void testSetSensorTaskRepository() { SensorInstanceProvider provider = new SensorInstanceProvider(); SensorTaskRepository repository = new InMemorySensorTaskRepository(); provider.setSensorTaskRepository(repository); assertEquals(repository, provider.getSensorTaskRepository()); }
public void setSensorTaskRepository(SensorTaskRepository sensorTaskRepository) { this.sensorTaskRepository = sensorTaskRepository; }
SensorInstanceProvider implements InsertSensorOfferingListener { public void setSensorTaskRepository(SensorTaskRepository sensorTaskRepository) { this.sensorTaskRepository = sensorTaskRepository; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public void setSensorTaskRepository(SensorTaskRepository sensorTaskRepository) { this.sensorTaskRepository = sensorTaskRepository; } }
SensorInstanceProvider implements InsertSensorOfferingListener { public void setSensorTaskRepository(SensorTaskRepository sensorTaskRepository) { this.sensorTaskRepository = sensorTaskRepository; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(St...
SensorInstanceProvider implements InsertSensorOfferingListener { public void setSensorTaskRepository(SensorTaskRepository sensorTaskRepository) { this.sensorTaskRepository = sensorTaskRepository; } void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(St...
@Test public void testHandleInsertSensorOffering() throws InternalServiceException { InsertSensorOfferingEvent event = new InsertSensorOfferingEvent(insertSensorOffering); assertCorrectInsertOfferingHandling(event); assertCorrectSensorConfigurationHandling(); }
public void handleInsertSensorOffering(InsertSensorOfferingEvent insertSensorOfferingEvent) throws InternalServiceException { InsertSensorOfferingDocument insertSensorOfferingDocument = insertSensorOfferingEvent.getInsertSensorOffering(); InsertSensorOffering insertSensorOffering = insertSensorOfferingDocument.getInser...
SensorInstanceProvider implements InsertSensorOfferingListener { public void handleInsertSensorOffering(InsertSensorOfferingEvent insertSensorOfferingEvent) throws InternalServiceException { InsertSensorOfferingDocument insertSensorOfferingDocument = insertSensorOfferingEvent.getInsertSensorOffering(); InsertSensorOffe...
SensorInstanceProvider implements InsertSensorOfferingListener { public void handleInsertSensorOffering(InsertSensorOfferingEvent insertSensorOfferingEvent) throws InternalServiceException { InsertSensorOfferingDocument insertSensorOfferingDocument = insertSensorOfferingEvent.getInsertSensorOffering(); InsertSensorOffe...
SensorInstanceProvider implements InsertSensorOfferingListener { public void handleInsertSensorOffering(InsertSensorOfferingEvent insertSensorOfferingEvent) throws InternalServiceException { InsertSensorOfferingDocument insertSensorOfferingDocument = insertSensorOfferingEvent.getInsertSensorOffering(); InsertSensorOffe...
SensorInstanceProvider implements InsertSensorOfferingListener { public void handleInsertSensorOffering(InsertSensorOfferingEvent insertSensorOfferingEvent) throws InternalServiceException { InsertSensorOfferingDocument insertSensorOfferingDocument = insertSensorOfferingEvent.getInsertSensorOffering(); InsertSensorOffe...
@Test public void testGetSensorTask() { try { for (String taskId : tasks) { if (operatorUnderTest.getSensorTask(taskId) == null) { fail("null was returned instead of throwing IVPE!"); } } } catch (OwsException e) { fail("could not get sensor task"); } }
protected SensorTask getSensorTask(String sensorTaskId) throws OwsException { if (!sensorInstanceProvider.containsTaskWith(sensorTaskId)) { handleInvalidParameter("task", sensorTaskId); } return sensorInstanceProvider.getTaskForTaskId(sensorTaskId); }
SpsOperator { protected SensorTask getSensorTask(String sensorTaskId) throws OwsException { if (!sensorInstanceProvider.containsTaskWith(sensorTaskId)) { handleInvalidParameter("task", sensorTaskId); } return sensorInstanceProvider.getTaskForTaskId(sensorTaskId); } }
SpsOperator { protected SensorTask getSensorTask(String sensorTaskId) throws OwsException { if (!sensorInstanceProvider.containsTaskWith(sensorTaskId)) { handleInvalidParameter("task", sensorTaskId); } return sensorInstanceProvider.getTaskForTaskId(sensorTaskId); } }
SpsOperator { protected SensorTask getSensorTask(String sensorTaskId) throws OwsException { if (!sensorInstanceProvider.containsTaskWith(sensorTaskId)) { handleInvalidParameter("task", sensorTaskId); } return sensorInstanceProvider.getTaskForTaskId(sensorTaskId); } SensorPlugin getSensorInstance(String procedure); Sen...
SpsOperator { protected SensorTask getSensorTask(String sensorTaskId) throws OwsException { if (!sensorInstanceProvider.containsTaskWith(sensorTaskId)) { handleInvalidParameter("task", sensorTaskId); } return sensorInstanceProvider.getTaskForTaskId(sensorTaskId); } SensorPlugin getSensorInstance(String procedure); Sen...
@Test public void testGetSensorTaskThrowingException() { try { operatorUnderTest.getSensorTask(INVALID_TASK); fail("Invalid task id returnd valid non null task instance!"); } catch (InvalidParameterValueException e) { } catch (OwsException e) { fail("Invalid task id returnd valid non null task instance!"); } }
protected SensorTask getSensorTask(String sensorTaskId) throws OwsException { if (!sensorInstanceProvider.containsTaskWith(sensorTaskId)) { handleInvalidParameter("task", sensorTaskId); } return sensorInstanceProvider.getTaskForTaskId(sensorTaskId); }
SpsOperator { protected SensorTask getSensorTask(String sensorTaskId) throws OwsException { if (!sensorInstanceProvider.containsTaskWith(sensorTaskId)) { handleInvalidParameter("task", sensorTaskId); } return sensorInstanceProvider.getTaskForTaskId(sensorTaskId); } }
SpsOperator { protected SensorTask getSensorTask(String sensorTaskId) throws OwsException { if (!sensorInstanceProvider.containsTaskWith(sensorTaskId)) { handleInvalidParameter("task", sensorTaskId); } return sensorInstanceProvider.getTaskForTaskId(sensorTaskId); } }
SpsOperator { protected SensorTask getSensorTask(String sensorTaskId) throws OwsException { if (!sensorInstanceProvider.containsTaskWith(sensorTaskId)) { handleInvalidParameter("task", sensorTaskId); } return sensorInstanceProvider.getTaskForTaskId(sensorTaskId); } SensorPlugin getSensorInstance(String procedure); Sen...
SpsOperator { protected SensorTask getSensorTask(String sensorTaskId) throws OwsException { if (!sensorInstanceProvider.containsTaskWith(sensorTaskId)) { handleInvalidParameter("task", sensorTaskId); } return sensorInstanceProvider.getTaskForTaskId(sensorTaskId); } SensorPlugin getSensorInstance(String procedure); Sen...
@Test public void testGetSensorInstanceFor() { try { for (String procedure : procedures) { if (operatorUnderTest.getSensorInstance(procedure) == null) { fail("null was returned instead of throwing IVPE!"); } } } catch (OwsException e) { fail("Procedure was unknown!"); } }
public SensorPlugin getSensorInstance(String procedure) throws OwsException { if (!sensorInstanceProvider.containsSensorWith(procedure)) { handleInvalidParameter("procedure", procedure); } SensorPlugin sensorPlugin = sensorInstanceProvider.getSensorForProcedure(procedure); return NonBlockingTaskingDecorator.enableNonBl...
SpsOperator { public SensorPlugin getSensorInstance(String procedure) throws OwsException { if (!sensorInstanceProvider.containsSensorWith(procedure)) { handleInvalidParameter("procedure", procedure); } SensorPlugin sensorPlugin = sensorInstanceProvider.getSensorForProcedure(procedure); return NonBlockingTaskingDecorat...
SpsOperator { public SensorPlugin getSensorInstance(String procedure) throws OwsException { if (!sensorInstanceProvider.containsSensorWith(procedure)) { handleInvalidParameter("procedure", procedure); } SensorPlugin sensorPlugin = sensorInstanceProvider.getSensorForProcedure(procedure); return NonBlockingTaskingDecorat...
SpsOperator { public SensorPlugin getSensorInstance(String procedure) throws OwsException { if (!sensorInstanceProvider.containsSensorWith(procedure)) { handleInvalidParameter("procedure", procedure); } SensorPlugin sensorPlugin = sensorInstanceProvider.getSensorForProcedure(procedure); return NonBlockingTaskingDecorat...
SpsOperator { public SensorPlugin getSensorInstance(String procedure) throws OwsException { if (!sensorInstanceProvider.containsSensorWith(procedure)) { handleInvalidParameter("procedure", procedure); } SensorPlugin sensorPlugin = sensorInstanceProvider.getSensorForProcedure(procedure); return NonBlockingTaskingDecorat...
@Test public void testGetSensorInstanceForThrowingException() { try { operatorUnderTest.getSensorInstance(INVALID_PROCEDURE); fail("Invalid procedure returnd valid non null instance!"); } catch (InvalidParameterValueException e) { } catch (OwsException e) { } }
public SensorPlugin getSensorInstance(String procedure) throws OwsException { if (!sensorInstanceProvider.containsSensorWith(procedure)) { handleInvalidParameter("procedure", procedure); } SensorPlugin sensorPlugin = sensorInstanceProvider.getSensorForProcedure(procedure); return NonBlockingTaskingDecorator.enableNonBl...
SpsOperator { public SensorPlugin getSensorInstance(String procedure) throws OwsException { if (!sensorInstanceProvider.containsSensorWith(procedure)) { handleInvalidParameter("procedure", procedure); } SensorPlugin sensorPlugin = sensorInstanceProvider.getSensorForProcedure(procedure); return NonBlockingTaskingDecorat...
SpsOperator { public SensorPlugin getSensorInstance(String procedure) throws OwsException { if (!sensorInstanceProvider.containsSensorWith(procedure)) { handleInvalidParameter("procedure", procedure); } SensorPlugin sensorPlugin = sensorInstanceProvider.getSensorForProcedure(procedure); return NonBlockingTaskingDecorat...
SpsOperator { public SensorPlugin getSensorInstance(String procedure) throws OwsException { if (!sensorInstanceProvider.containsSensorWith(procedure)) { handleInvalidParameter("procedure", procedure); } SensorPlugin sensorPlugin = sensorInstanceProvider.getSensorForProcedure(procedure); return NonBlockingTaskingDecorat...
SpsOperator { public SensorPlugin getSensorInstance(String procedure) throws OwsException { if (!sensorInstanceProvider.containsSensorWith(procedure)) { handleInvalidParameter("procedure", procedure); } SensorPlugin sensorPlugin = sensorInstanceProvider.getSensorForProcedure(procedure); return NonBlockingTaskingDecorat...
@Test(expected = InvalidParameterValueException.class) public void testInvalidVersionParameterInRequest() throws Exception { XmlObject submitDocument = getRequest(REQUEST_INVALID_VERSION); validatingDelegate.validateRequiredVersionParameter(submitDocument); }
protected void validateRequiredVersionParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); if (moveToAttribute(xmlCursor, "version")) { service.validateVersionParameter(xmlCursor.getTextValue()); } }
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredVersionParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); if (moveToAttribute(xmlCursor, "version")) { service.validateVersionParameter(xmlCurso...
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredVersionParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); if (moveToAttribute(xmlCursor, "version")) { service.validateVersionParameter(xmlCurso...
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredVersionParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); if (moveToAttribute(xmlCursor, "version")) { service.validateVersionParameter(xmlCurso...
XmlValidationDelegate implements RequestDelegationHandler { protected void validateRequiredVersionParameter(XmlObject requestDocument) throws OwsException { XmlCursor xmlCursor = requestDocument.newCursor(); xmlCursor.toFirstChild(); if (moveToAttribute(xmlCursor, "version")) { service.validateVersionParameter(xmlCurso...
@Test public void testIsGetCapabilitiesRequest() throws XmlException, IOException { XmlObject getCapabilities = getRequest(REQUEST_GET_CAPABILITIES); assertTrue(validatingDelegate.isGetCapabilitiesRequest(getCapabilities)); }
protected boolean isGetCapabilitiesRequest(XmlObject request) { XmlCursor xmlCursor = request.newCursor(); xmlCursor.toFirstChild(); String operationName = xmlCursor.getName().getLocalPart(); return operationName.equalsIgnoreCase("GetCapabilities"); }
XmlValidationDelegate implements RequestDelegationHandler { protected boolean isGetCapabilitiesRequest(XmlObject request) { XmlCursor xmlCursor = request.newCursor(); xmlCursor.toFirstChild(); String operationName = xmlCursor.getName().getLocalPart(); return operationName.equalsIgnoreCase("GetCapabilities"); } }
XmlValidationDelegate implements RequestDelegationHandler { protected boolean isGetCapabilitiesRequest(XmlObject request) { XmlCursor xmlCursor = request.newCursor(); xmlCursor.toFirstChild(); String operationName = xmlCursor.getName().getLocalPart(); return operationName.equalsIgnoreCase("GetCapabilities"); } XmlValid...
XmlValidationDelegate implements RequestDelegationHandler { protected boolean isGetCapabilitiesRequest(XmlObject request) { XmlCursor xmlCursor = request.newCursor(); xmlCursor.toFirstChild(); String operationName = xmlCursor.getName().getLocalPart(); return operationName.equalsIgnoreCase("GetCapabilities"); } XmlValid...
XmlValidationDelegate implements RequestDelegationHandler { protected boolean isGetCapabilitiesRequest(XmlObject request) { XmlCursor xmlCursor = request.newCursor(); xmlCursor.toFirstChild(); String operationName = xmlCursor.getName().getLocalPart(); return operationName.equalsIgnoreCase("GetCapabilities"); } XmlValid...
@Test(expected = MissingParameterValueException.class) public void testMissingServiceInGetCapabilitiesRequest() throws XmlException, IOException, OwsException { XmlObject getCapabilities = getRequest(REQUEST_GET_CAPABILITIES_MISSING_SERVICE); validatingDelegate.assureCorrectServiceAndVersionRequestParameters(getCapabil...
protected void assureCorrectServiceAndVersionRequestParameters(XmlObject request) throws OwsException { if (!isGetCapabilitiesRequest(request)) { validateRequiredServiceParameter(request); validateRequiredVersionParameter(request); } else { service.validateGetCapabilitiesParameters((GetCapabilitiesDocument) request); }...
XmlValidationDelegate implements RequestDelegationHandler { protected void assureCorrectServiceAndVersionRequestParameters(XmlObject request) throws OwsException { if (!isGetCapabilitiesRequest(request)) { validateRequiredServiceParameter(request); validateRequiredVersionParameter(request); } else { service.validateGet...
XmlValidationDelegate implements RequestDelegationHandler { protected void assureCorrectServiceAndVersionRequestParameters(XmlObject request) throws OwsException { if (!isGetCapabilitiesRequest(request)) { validateRequiredServiceParameter(request); validateRequiredVersionParameter(request); } else { service.validateGet...
XmlValidationDelegate implements RequestDelegationHandler { protected void assureCorrectServiceAndVersionRequestParameters(XmlObject request) throws OwsException { if (!isGetCapabilitiesRequest(request)) { validateRequiredServiceParameter(request); validateRequiredVersionParameter(request); } else { service.validateGet...
XmlValidationDelegate implements RequestDelegationHandler { protected void assureCorrectServiceAndVersionRequestParameters(XmlObject request) throws OwsException { if (!isGetCapabilitiesRequest(request)) { validateRequiredServiceParameter(request); validateRequiredVersionParameter(request); } else { service.validateGet...
@Test public void testGetTaskStatusAsString() { validTask.setTaskStatus(SensorTaskStatus.INEXECUTION); assertEquals(SensorTaskStatus.INEXECUTION.toString(), validTask.getTaskStatusAsString()); }
public String getTaskStatusAsString() { return taskStatus != null ? taskStatus.toString() : null; }
SensorTask { public String getTaskStatusAsString() { return taskStatus != null ? taskStatus.toString() : null; } }
SensorTask { public String getTaskStatusAsString() { return taskStatus != null ? taskStatus.toString() : null; } SensorTask(); SensorTask(String taskId, String procedure); }
SensorTask { public String getTaskStatusAsString() { return taskStatus != null ? taskStatus.toString() : null; } SensorTask(); SensorTask(String taskId, String procedure); String getTaskId(); Calendar getCalendarInstance(); void setUpdateTime(Calendar calendar); Calendar getUpdateTime(); String getFormattedUpdateTime(...
SensorTask { public String getTaskStatusAsString() { return taskStatus != null ? taskStatus.toString() : null; } SensorTask(); SensorTask(String taskId, String procedure); String getTaskId(); Calendar getCalendarInstance(); void setUpdateTime(Calendar calendar); Calendar getUpdateTime(); String getFormattedUpdateTime(...
@Test(expected = IllegalArgumentException.class) public void testIllegalCreation() { StatusReportGenerator.createFor(null); }
public static StatusReportGenerator createFor(SensorTask sensorTask) { return new StatusReportGenerator(sensorTask); }
StatusReportGenerator { public static StatusReportGenerator createFor(SensorTask sensorTask) { return new StatusReportGenerator(sensorTask); } }
StatusReportGenerator { public static StatusReportGenerator createFor(SensorTask sensorTask) { return new StatusReportGenerator(sensorTask); } private StatusReportGenerator(SensorTask sensorTask); }
StatusReportGenerator { public static StatusReportGenerator createFor(SensorTask sensorTask) { return new StatusReportGenerator(sensorTask); } private StatusReportGenerator(SensorTask sensorTask); static StatusReportGenerator createFor(SensorTask sensorTask); StatusReportType generateWithTaskingParameters(); StatusRep...
StatusReportGenerator { public static StatusReportGenerator createFor(SensorTask sensorTask) { return new StatusReportGenerator(sensorTask); } private StatusReportGenerator(SensorTask sensorTask); static StatusReportGenerator createFor(SensorTask sensorTask); StatusReportType generateWithTaskingParameters(); StatusRep...
@Test(expected = StatusInformationExpiredException.class) public void testGenerationOfAlreadyExpiredSensorTask() throws Exception { validTask.setTaskStatus(SensorTaskStatus.EXPIRED); getStatusReporter().generateWithoutTaskingParameters(); }
public StatusReportType generateWithoutTaskingParameters() throws StatusInformationExpiredException { if (isStatusInformationExpired()) { throw new StatusInformationExpiredException(); } StatusReportType statusReport = StatusReportType.Factory.newInstance(); statusReport.setRequestStatus(sensorTask.getRequestStatusAsSt...
StatusReportGenerator { public StatusReportType generateWithoutTaskingParameters() throws StatusInformationExpiredException { if (isStatusInformationExpired()) { throw new StatusInformationExpiredException(); } StatusReportType statusReport = StatusReportType.Factory.newInstance(); statusReport.setRequestStatus(sensorT...
StatusReportGenerator { public StatusReportType generateWithoutTaskingParameters() throws StatusInformationExpiredException { if (isStatusInformationExpired()) { throw new StatusInformationExpiredException(); } StatusReportType statusReport = StatusReportType.Factory.newInstance(); statusReport.setRequestStatus(sensorT...
StatusReportGenerator { public StatusReportType generateWithoutTaskingParameters() throws StatusInformationExpiredException { if (isStatusInformationExpired()) { throw new StatusInformationExpiredException(); } StatusReportType statusReport = StatusReportType.Factory.newInstance(); statusReport.setRequestStatus(sensorT...
StatusReportGenerator { public StatusReportType generateWithoutTaskingParameters() throws StatusInformationExpiredException { if (isStatusInformationExpired()) { throw new StatusInformationExpiredException(); } StatusReportType statusReport = StatusReportType.Factory.newInstance(); statusReport.setRequestStatus(sensorT...
@Test public void testGenerate() throws Exception { assertNotNull(getStatusReporter().generateWithoutTaskingParameters()); }
public StatusReportType generateWithoutTaskingParameters() throws StatusInformationExpiredException { if (isStatusInformationExpired()) { throw new StatusInformationExpiredException(); } StatusReportType statusReport = StatusReportType.Factory.newInstance(); statusReport.setRequestStatus(sensorTask.getRequestStatusAsSt...
StatusReportGenerator { public StatusReportType generateWithoutTaskingParameters() throws StatusInformationExpiredException { if (isStatusInformationExpired()) { throw new StatusInformationExpiredException(); } StatusReportType statusReport = StatusReportType.Factory.newInstance(); statusReport.setRequestStatus(sensorT...
StatusReportGenerator { public StatusReportType generateWithoutTaskingParameters() throws StatusInformationExpiredException { if (isStatusInformationExpired()) { throw new StatusInformationExpiredException(); } StatusReportType statusReport = StatusReportType.Factory.newInstance(); statusReport.setRequestStatus(sensorT...
StatusReportGenerator { public StatusReportType generateWithoutTaskingParameters() throws StatusInformationExpiredException { if (isStatusInformationExpired()) { throw new StatusInformationExpiredException(); } StatusReportType statusReport = StatusReportType.Factory.newInstance(); statusReport.setRequestStatus(sensorT...
StatusReportGenerator { public StatusReportType generateWithoutTaskingParameters() throws StatusInformationExpiredException { if (isStatusInformationExpired()) { throw new StatusInformationExpiredException(); } StatusReportType statusReport = StatusReportType.Factory.newInstance(); statusReport.setRequestStatus(sensorT...
@Test public void testCreateClass() throws Exception { Class<?> c = DynamicClassFactory.INSTANCE.fetchOrCreatePairClass(new ClassPair(String.class, Date.class)); KVPair pair = (KVPair) c.newInstance(); assertEquals(1, c.getInterfaces().length); assertEquals(KVPair.class, c.getInterfaces()[0]); Annotation[] as = c.getAn...
private Class<?> createClass(ClassPair classPair) { String className = generateClassName(classPair); String classStr = className.replaceAll("\\.", "/"); String keyClassType = Type.getDescriptor(classPair.keyClass); String valueClassType = Type.getDescriptor(classPair.valueClass); ClassWriter cw = new ClassWriter(0); cw...
DynamicClassFactory { private Class<?> createClass(ClassPair classPair) { String className = generateClassName(classPair); String classStr = className.replaceAll("\\.", "/"); String keyClassType = Type.getDescriptor(classPair.keyClass); String valueClassType = Type.getDescriptor(classPair.valueClass); ClassWriter cw = ...
DynamicClassFactory { private Class<?> createClass(ClassPair classPair) { String className = generateClassName(classPair); String classStr = className.replaceAll("\\.", "/"); String keyClassType = Type.getDescriptor(classPair.keyClass); String valueClassType = Type.getDescriptor(classPair.valueClass); ClassWriter cw = ...
DynamicClassFactory { private Class<?> createClass(ClassPair classPair) { String className = generateClassName(classPair); String classStr = className.replaceAll("\\.", "/"); String keyClassType = Type.getDescriptor(classPair.keyClass); String valueClassType = Type.getDescriptor(classPair.valueClass); ClassWriter cw = ...
DynamicClassFactory { private Class<?> createClass(ClassPair classPair) { String className = generateClassName(classPair); String classStr = className.replaceAll("\\.", "/"); String keyClassType = Type.getDescriptor(classPair.keyClass); String valueClassType = Type.getDescriptor(classPair.valueClass); ClassWriter cw = ...
@Test public void testEnvironmentVariableConfigurationSource() { EnvironmentVariableConfigurationSource cs = new EnvironmentVariableConfigurationSource(0); assertEquals(cs.priority(), 0); }
public EnvironmentVariableConfigurationSource(final int priority) { super(priority, "EnvironmentVariable"); }
EnvironmentVariableConfigurationSource extends AbstractConfigurationSource { public EnvironmentVariableConfigurationSource(final int priority) { super(priority, "EnvironmentVariable"); } }
EnvironmentVariableConfigurationSource extends AbstractConfigurationSource { public EnvironmentVariableConfigurationSource(final int priority) { super(priority, "EnvironmentVariable"); } EnvironmentVariableConfigurationSource(final int priority); }
EnvironmentVariableConfigurationSource extends AbstractConfigurationSource { public EnvironmentVariableConfigurationSource(final int priority) { super(priority, "EnvironmentVariable"); } EnvironmentVariableConfigurationSource(final int priority); @Override Configuration configuration(); }
EnvironmentVariableConfigurationSource extends AbstractConfigurationSource { public EnvironmentVariableConfigurationSource(final int priority) { super(priority, "EnvironmentVariable"); } EnvironmentVariableConfigurationSource(final int priority); @Override Configuration configuration(); }
@Test public void testConfiguration() { EnvironmentVariableConfigurationSource cs = new EnvironmentVariableConfigurationSource(0); assertNotNull(cs.configuration()); assertTrue(!Strings.isNullOrEmpty(cs.configuration().getPropertyValue("sun.management.compiler"))); }
@Override public Configuration configuration() { return _configuration; }
EnvironmentVariableConfigurationSource extends AbstractConfigurationSource { @Override public Configuration configuration() { return _configuration; } }
EnvironmentVariableConfigurationSource extends AbstractConfigurationSource { @Override public Configuration configuration() { return _configuration; } EnvironmentVariableConfigurationSource(final int priority); }
EnvironmentVariableConfigurationSource extends AbstractConfigurationSource { @Override public Configuration configuration() { return _configuration; } EnvironmentVariableConfigurationSource(final int priority); @Override Configuration configuration(); }
EnvironmentVariableConfigurationSource extends AbstractConfigurationSource { @Override public Configuration configuration() { return _configuration; } EnvironmentVariableConfigurationSource(final int priority); @Override Configuration configuration(); }
@Test public void test() { MyConfigurationManager manager = new MyConfigurationManager(); MyProperty mp = (MyProperty) manager.getProperty(""); System.out.println(mp.value()); TypedProperty<Boolean> dbp = (DefaultTypedProperty<Boolean>) manager.getProperty("bool"); System.out.println(dbp.typedValue().booleanValue()); T...
@Override public String value() { return manager().getPropertyValue(key()); }
DefaultProperty implements Property { @Override public String value() { return manager().getPropertyValue(key()); } }
DefaultProperty implements Property { @Override public String value() { return manager().getPropertyValue(key()); } DefaultProperty(ConfigurationManager manager, String key); }
DefaultProperty implements Property { @Override public String value() { return manager().getPropertyValue(key()); } DefaultProperty(ConfigurationManager manager, String key); @Override String key(); @Override String value(); @Override String toString(); }
DefaultProperty implements Property { @Override public String value() { return manager().getPropertyValue(key()); } DefaultProperty(ConfigurationManager manager, String key); @Override String key(); @Override String value(); @Override String toString(); }
@Test public void testValue() { MyProperty mp = new MyProperty("k1", "v1"); DefaultCachedProperty dcp = new DefaultCachedProperty(mp); assertEquals(dcp.value(), "v1"); }
@Override public String value() { return _value; }
DefaultCachedProperty extends PropertyWrapper implements CachedProperty { @Override public String value() { return _value; } }
DefaultCachedProperty extends PropertyWrapper implements CachedProperty { @Override public String value() { return _value; } DefaultCachedProperty(Property property); }
DefaultCachedProperty extends PropertyWrapper implements CachedProperty { @Override public String value() { return _value; } DefaultCachedProperty(Property property); @Override String value(); @Override void refresh(); }
DefaultCachedProperty extends PropertyWrapper implements CachedProperty { @Override public String value() { return _value; } DefaultCachedProperty(Property property); @Override String value(); @Override void refresh(); }
@Test public void testRefresh() { MyProperty mp = new MyProperty("k1", "v1"); DefaultCachedProperty dcp = new DefaultCachedProperty(mp); dcp.refresh(); }
@Override public void refresh() { String before = value(); _value = super.value(); if (Objects.equal(before, _value)) return; if (_disableRefreshLog) return; _logger.info( String.format("Default cached property has been refreshed, key: %s, the value before refresh: %s, after refresh: %s", key(), before, _value)); }
DefaultCachedProperty extends PropertyWrapper implements CachedProperty { @Override public void refresh() { String before = value(); _value = super.value(); if (Objects.equal(before, _value)) return; if (_disableRefreshLog) return; _logger.info( String.format("Default cached property has been refreshed, key: %s, the va...
DefaultCachedProperty extends PropertyWrapper implements CachedProperty { @Override public void refresh() { String before = value(); _value = super.value(); if (Objects.equal(before, _value)) return; if (_disableRefreshLog) return; _logger.info( String.format("Default cached property has been refreshed, key: %s, the va...
DefaultCachedProperty extends PropertyWrapper implements CachedProperty { @Override public void refresh() { String before = value(); _value = super.value(); if (Objects.equal(before, _value)) return; if (_disableRefreshLog) return; _logger.info( String.format("Default cached property has been refreshed, key: %s, the va...
DefaultCachedProperty extends PropertyWrapper implements CachedProperty { @Override public void refresh() { String before = value(); _value = super.value(); if (Objects.equal(before, _value)) return; if (_disableRefreshLog) return; _logger.info( String.format("Default cached property has been refreshed, key: %s, the va...
@Test public void isDefaultTest() { Assert.assertTrue(DefaultValues.isDefault(0)); Assert.assertTrue(DefaultValues.isDefault(0.0)); Assert.assertTrue(DefaultValues.isDefault(null)); Assert.assertFalse(DefaultValues.isDefault(0.1)); Assert.assertFalse(DefaultValues.isDefault(1)); Assert.assertFalse(DefaultValues.isDefau...
public static boolean isDefault(Object value) { if (value == null) return true; if (value instanceof Number && ((Number)value).doubleValue() == 0.0) return true; return false; }
DefaultValues { public static boolean isDefault(Object value) { if (value == null) return true; if (value instanceof Number && ((Number)value).doubleValue() == 0.0) return true; return false; } }
DefaultValues { public static boolean isDefault(Object value) { if (value == null) return true; if (value instanceof Number && ((Number)value).doubleValue() == 0.0) return true; return false; } private DefaultValues(); }
DefaultValues { public static boolean isDefault(Object value) { if (value == null) return true; if (value instanceof Number && ((Number)value).doubleValue() == 0.0) return true; return false; } private DefaultValues(); static boolean isDefault(Object value); }
DefaultValues { public static boolean isDefault(Object value) { if (value == null) return true; if (value instanceof Number && ((Number)value).doubleValue() == 0.0) return true; return false; } private DefaultValues(); static boolean isDefault(Object value); }
@Test public void toStringTest() { Object obj = null; String value = String.valueOf(obj); Assert.assertFalse(value == null); value = StringValues.toString(obj); Assert.assertTrue(value == null); }
public static String toString(Object value) { if (value == null) return null; return value.toString(); }
StringValues { public static String toString(Object value) { if (value == null) return null; return value.toString(); } }
StringValues { public static String toString(Object value) { if (value == null) return null; return value.toString(); } private StringValues(); }
StringValues { public static String toString(Object value) { if (value == null) return null; return value.toString(); } private StringValues(); static String toString(Object value); static String toLowerCase(String value); static String toUpperCase(String value); static boolean isNullOrWhitespace(String value); static...
StringValues { public static String toString(Object value) { if (value == null) return null; return value.toString(); } private StringValues(); static String toString(Object value); static String toLowerCase(String value); static String toUpperCase(String value); static boolean isNullOrWhitespace(String value); static...
@Test public void ipTest() { PatternCorrector pc = new PatternCorrector(Patterns.IP_ADDRESS); assertNotNull(pc.correct("10.10.199.255")); assertNull(pc.correct("10.10.199.256")); assertNull(pc.correct("10.10.199.*")); assertNull(pc.correct("10.10.19")); assertNull(pc.correct("1.10.19.test")); assertNull(pc.correct(null...
@Override public String correct(String value) { if (Strings.isNullOrEmpty(value)) return null; Matcher matcher = _pattern.matcher(value); if (matcher.matches()) return value; else return null; }
PatternCorrector implements ValueCorrector<String> { @Override public String correct(String value) { if (Strings.isNullOrEmpty(value)) return null; Matcher matcher = _pattern.matcher(value); if (matcher.matches()) return value; else return null; } }
PatternCorrector implements ValueCorrector<String> { @Override public String correct(String value) { if (Strings.isNullOrEmpty(value)) return null; Matcher matcher = _pattern.matcher(value); if (matcher.matches()) return value; else return null; } PatternCorrector(Pattern pattern); }
PatternCorrector implements ValueCorrector<String> { @Override public String correct(String value) { if (Strings.isNullOrEmpty(value)) return null; Matcher matcher = _pattern.matcher(value); if (matcher.matches()) return value; else return null; } PatternCorrector(Pattern pattern); @Override String correct(String value...
PatternCorrector implements ValueCorrector<String> { @Override public String correct(String value) { if (Strings.isNullOrEmpty(value)) return null; Matcher matcher = _pattern.matcher(value); if (matcher.matches()) return value; else return null; } PatternCorrector(Pattern pattern); @Override String correct(String value...
@Test public void mailTest() { PatternCorrector pc = new PatternCorrector(Patterns.MAIL_ADDRESS); assertNotNull(pc.correct("chennan@ctrip.com")); assertNull(pc.correct("chennan")); assertNull(pc.correct("@")); assertNull(pc.correct("ctrip.com")); assertNull(pc.correct("@ctrip.com")); assertNull(pc.correct(null)); asser...
@Override public String correct(String value) { if (Strings.isNullOrEmpty(value)) return null; Matcher matcher = _pattern.matcher(value); if (matcher.matches()) return value; else return null; }
PatternCorrector implements ValueCorrector<String> { @Override public String correct(String value) { if (Strings.isNullOrEmpty(value)) return null; Matcher matcher = _pattern.matcher(value); if (matcher.matches()) return value; else return null; } }
PatternCorrector implements ValueCorrector<String> { @Override public String correct(String value) { if (Strings.isNullOrEmpty(value)) return null; Matcher matcher = _pattern.matcher(value); if (matcher.matches()) return value; else return null; } PatternCorrector(Pattern pattern); }
PatternCorrector implements ValueCorrector<String> { @Override public String correct(String value) { if (Strings.isNullOrEmpty(value)) return null; Matcher matcher = _pattern.matcher(value); if (matcher.matches()) return value; else return null; } PatternCorrector(Pattern pattern); @Override String correct(String value...
PatternCorrector implements ValueCorrector<String> { @Override public String correct(String value) { if (Strings.isNullOrEmpty(value)) return null; Matcher matcher = _pattern.matcher(value); if (matcher.matches()) return value; else return null; } PatternCorrector(Pattern pattern); @Override String correct(String value...
@Test public void testConfiguration() { ServletContextConfigurationSource sccs = new ServletContextConfigurationSource(1, new MyServletContext()); assertTrue(!Strings.isNullOrEmpty(sccs.configuration().getPropertyValue("env"))); }
@Override public Configuration configuration() { return _configuration; }
ServletContextConfigurationSource extends AbstractConfigurationSource { @Override public Configuration configuration() { return _configuration; } }
ServletContextConfigurationSource extends AbstractConfigurationSource { @Override public Configuration configuration() { return _configuration; } ServletContextConfigurationSource(final int priority, final ServletContext context); }
ServletContextConfigurationSource extends AbstractConfigurationSource { @Override public Configuration configuration() { return _configuration; } ServletContextConfigurationSource(final int priority, final ServletContext context); @Override Configuration configuration(); }
ServletContextConfigurationSource extends AbstractConfigurationSource { @Override public Configuration configuration() { return _configuration; } ServletContextConfigurationSource(final int priority, final ServletContext context); @Override Configuration configuration(); }
@Test public void testInit() { MyConfigurationSource mcs1 = new MyConfigurationSource(1); MyConfigurationSource mcs2 = new MyConfigurationSource(2); MyConfigurationSource mcs3 = new MyConfigurationSource(3); MyConfigurationSource mcs4 = new MyConfigurationSource(4); MyConfigurationSource mcs5 = new MyConfigurationSourc...
protected void init(List<ConfigurationSource> sources) { if (CollectionValues.isNullOrEmpty(sources)) { _sources = EMPTY_CONFIGURATION_SOURCE_LIST; _logger.warn("sources is null or empty"); return; } _sources = new ArrayList<ConfigurationSource>(); for (ConfigurationSource source : sources) { if (source == null || sour...
DefaultConfigurationManager implements ConfigurationManager { protected void init(List<ConfigurationSource> sources) { if (CollectionValues.isNullOrEmpty(sources)) { _sources = EMPTY_CONFIGURATION_SOURCE_LIST; _logger.warn("sources is null or empty"); return; } _sources = new ArrayList<ConfigurationSource>(); for (Conf...
DefaultConfigurationManager implements ConfigurationManager { protected void init(List<ConfigurationSource> sources) { if (CollectionValues.isNullOrEmpty(sources)) { _sources = EMPTY_CONFIGURATION_SOURCE_LIST; _logger.warn("sources is null or empty"); return; } _sources = new ArrayList<ConfigurationSource>(); for (Conf...
DefaultConfigurationManager implements ConfigurationManager { protected void init(List<ConfigurationSource> sources) { if (CollectionValues.isNullOrEmpty(sources)) { _sources = EMPTY_CONFIGURATION_SOURCE_LIST; _logger.warn("sources is null or empty"); return; } _sources = new ArrayList<ConfigurationSource>(); for (Conf...
DefaultConfigurationManager implements ConfigurationManager { protected void init(List<ConfigurationSource> sources) { if (CollectionValues.isNullOrEmpty(sources)) { _sources = EMPTY_CONFIGURATION_SOURCE_LIST; _logger.warn("sources is null or empty"); return; } _sources = new ArrayList<ConfigurationSource>(); for (Conf...
@Test public void testGetPropertyValue() { ServletContextConfiguration scc = new ServletContextConfiguration(new MyServletContext()); assertEquals(scc.getPropertyValue("service-port"), "8090"); assertEquals(scc.getPropertyValue("env"), "fws"); }
@Override public String getPropertyValue(String key) { if (StringValues.isNullOrWhitespace(key)) { _logger.warn("ServletContext key is null or empty!"); return null; } String value = _context.getInitParameter(key); return value; }
ServletContextConfiguration implements Configuration { @Override public String getPropertyValue(String key) { if (StringValues.isNullOrWhitespace(key)) { _logger.warn("ServletContext key is null or empty!"); return null; } String value = _context.getInitParameter(key); return value; } }
ServletContextConfiguration implements Configuration { @Override public String getPropertyValue(String key) { if (StringValues.isNullOrWhitespace(key)) { _logger.warn("ServletContext key is null or empty!"); return null; } String value = _context.getInitParameter(key); return value; } ServletContextConfiguration(final ...
ServletContextConfiguration implements Configuration { @Override public String getPropertyValue(String key) { if (StringValues.isNullOrWhitespace(key)) { _logger.warn("ServletContext key is null or empty!"); return null; } String value = _context.getInitParameter(key); return value; } ServletContextConfiguration(final ...
ServletContextConfiguration implements Configuration { @Override public String getPropertyValue(String key) { if (StringValues.isNullOrWhitespace(key)) { _logger.warn("ServletContext key is null or empty!"); return null; } String value = _context.getInitParameter(key); return value; } ServletContextConfiguration(final ...
@Test @Ignore public void loadBalancerTest () { final int serverCount = 10; final int threadCount = 4; final int repeatTimes = Integer.MAX_VALUE / (serverCount * threadCount) - (serverCount * threadCount); final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName(); Assert.assertTrue(serverCount * rep...
@Override public LoadBalancerRequestContext getRequestContext(LoadBalancerRequestConfig loadBalancerRequestConfig) { LoadBalancerRoute route = _loadBalancerContext.serverSourceFilter().getLoadBalancerRoute(loadBalancerRequestConfig); if (route == null) { LogUtil.error(_logger, "No matching route for \n" + loadBalancerR...
DefaultLoadBalancer implements LoadBalancer { @Override public LoadBalancerRequestContext getRequestContext(LoadBalancerRequestConfig loadBalancerRequestConfig) { LoadBalancerRoute route = _loadBalancerContext.serverSourceFilter().getLoadBalancerRoute(loadBalancerRequestConfig); if (route == null) { LogUtil.error(_logg...
DefaultLoadBalancer implements LoadBalancer { @Override public LoadBalancerRequestContext getRequestContext(LoadBalancerRequestConfig loadBalancerRequestConfig) { LoadBalancerRoute route = _loadBalancerContext.serverSourceFilter().getLoadBalancerRoute(loadBalancerRequestConfig); if (route == null) { LogUtil.error(_logg...
DefaultLoadBalancer implements LoadBalancer { @Override public LoadBalancerRequestContext getRequestContext(LoadBalancerRequestConfig loadBalancerRequestConfig) { LoadBalancerRoute route = _loadBalancerContext.serverSourceFilter().getLoadBalancerRoute(loadBalancerRequestConfig); if (route == null) { LogUtil.error(_logg...
DefaultLoadBalancer implements LoadBalancer { @Override public LoadBalancerRequestContext getRequestContext(LoadBalancerRequestConfig loadBalancerRequestConfig) { LoadBalancerRoute route = _loadBalancerContext.serverSourceFilter().getLoadBalancerRoute(loadBalancerRequestConfig); if (route == null) { LogUtil.error(_logg...
@Test public void serverEquals_ServerId_CaseInsensitive_Test() { Server server1 = Server.newBuilder().setServerId("Abc").build(); Server server2 = Server.newBuilder().setServerId("abc").build(); Assert.assertEquals(server1, server2); Assert.assertEquals(server2, server1); }
public static Builder newBuilder() { return new Builder(); }
Server { public static Builder newBuilder() { return new Builder(); } }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
@Test public void serverEquals_ServerId_Equals_Test() { Server server1 = Server.newBuilder().setServerId("abc").build(); Server server2 = Server.newBuilder().setServerId("abc").build(); Assert.assertEquals(server1, server2); Assert.assertEquals(server2, server1); }
public static Builder newBuilder() { return new Builder(); }
Server { public static Builder newBuilder() { return new Builder(); } }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
@Test public void serverEquals_IsAlive_Equals_Test() { Server server1 = Server.newBuilder().setServerId("abc").setIsAlive(true).build(); Server server2 = Server.newBuilder().setServerId("abc").setIsAlive(false).build(); Assert.assertEquals(server1, server2); Assert.assertEquals(server2, server1); }
public static Builder newBuilder() { return new Builder(); }
Server { public static Builder newBuilder() { return new Builder(); } }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
@Test public void serverEquals_Metadata_Equals_Test() { HashMap<String, String> server1Metadata = new HashMap<>(); server1Metadata.put("Hello", "World"); server1Metadata.put("City", "Shanghai"); Server server1 = Server.newBuilder().setServerId("abc").setMetadata(server1Metadata).build(); HashMap<String, String> server2...
public static Builder newBuilder() { return new Builder(); }
Server { public static Builder newBuilder() { return new Builder(); } }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
@Test public void ServerEquals_Metadata_NullEqualEmpty_Test() { Server server1 = Server.newBuilder().setServerId("abc").setMetadata(null).build(); Server server2 = Server.newBuilder().setServerId("abc").setMetadata(new HashMap<String, String>()).build(); Assert.assertEquals(server1, server2); Assert.assertEquals(server...
public static Builder newBuilder() { return new Builder(); }
Server { public static Builder newBuilder() { return new Builder(); } }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
@Test public void ServerEquals_Metadata_CountNotEquals_Test() { HashMap<String, String> server1Metadata = new HashMap<>(); server1Metadata.put("City", "Shanghai"); Server server1 = Server.newBuilder().setServerId("abc").setMetadata(server1Metadata).build(); HashMap<String, String> server2Metadata = new HashMap<>(); ser...
public static Builder newBuilder() { return new Builder(); }
Server { public static Builder newBuilder() { return new Builder(); } }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
@Test public void ServerEquals_Metadata_KeyNotEquals_Test() { HashMap<String, String> server1Metadata = new HashMap<>(); server1Metadata.put("Hello ", "World"); server1Metadata.put("City", "Shanghai"); Server server1 = Server.newBuilder().setServerId("abc").setMetadata(server1Metadata).build(); HashMap<String, String> ...
public static Builder newBuilder() { return new Builder(); }
Server { public static Builder newBuilder() { return new Builder(); } }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
@Test public void ServerEquals_Metadata_ValueNotEquals_Test() { HashMap<String, String> server1Metadata = new HashMap<>(); server1Metadata.put("Hello", "World "); server1Metadata.put("City", "Shanghai"); Server server1 = Server.newBuilder().setServerId("abc").setMetadata(server1Metadata).build(); HashMap<String, String...
public static Builder newBuilder() { return new Builder(); }
Server { public static Builder newBuilder() { return new Builder(); } }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); }
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
Server { public static Builder newBuilder() { return new Builder(); } Server(); Server(String serverId, boolean isAlive, Map<String, String> metadata); @JsonProperty String getServerId(); @JsonProperty boolean isAlive(); @JsonProperty void setAlive(boolean alive); @JsonProperty Map<String, String> getMetadata(); @Over...
@Test public void testDefault() { MyConfigurationManager myManager = new MyConfigurationManager(); DefaultTypedConfigurationManager manager = new DefaultTypedConfigurationManager(myManager); System.out.println(manager.getProperty("").value()); System.out.println(manager.getProperty("bool", BooleanParser.DEFAULT).typedV...
@Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
@Test public void roundRobinRuleTest() { final int serverCount = 10; final int repeatTimes = 5; final int threadCount = 10; final String factoryId = "soa"; final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName(); final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestCo...
public RoundRobinRule() { serverContexts = new ConcurrentHashMap<>(); roundRobinAlgorithm = new DefaultRoundRobinAlgorithm<>(); }
RoundRobinRule implements LoadBalancerRule { public RoundRobinRule() { serverContexts = new ConcurrentHashMap<>(); roundRobinAlgorithm = new DefaultRoundRobinAlgorithm<>(); } }
RoundRobinRule implements LoadBalancerRule { public RoundRobinRule() { serverContexts = new ConcurrentHashMap<>(); roundRobinAlgorithm = new DefaultRoundRobinAlgorithm<>(); } RoundRobinRule(); }
RoundRobinRule implements LoadBalancerRule { public RoundRobinRule() { serverContexts = new ConcurrentHashMap<>(); roundRobinAlgorithm = new DefaultRoundRobinAlgorithm<>(); } RoundRobinRule(); @Override String getRuleId(); @Override String getDescription(); @Override Server choose(final LoadBalancerRoute route); }
RoundRobinRule implements LoadBalancerRule { public RoundRobinRule() { serverContexts = new ConcurrentHashMap<>(); roundRobinAlgorithm = new DefaultRoundRobinAlgorithm<>(); } RoundRobinRule(); @Override String getRuleId(); @Override String getDescription(); @Override Server choose(final LoadBalancerRoute route); }
@Test public void updateServerListTest() { final int serverCount = 10; final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName(); final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId); List<Server> servers = new ArrayList<>(); for (int i = 0; i < serverCount...
@Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadBalancerRoute> routeMap = _routeMap; TreeSet<LoadBalancerRo...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
@Test public void updateServerList_RetainStatus_Test() { int serverCount = 10; final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName(); final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId); final List<Server> servers = new ArrayList<>(); for (int i = 0; i...
@Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadBalancerRoute> routeMap = _routeMap; TreeSet<LoadBalancerRo...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
@Test public void updateServerList_UnavailableServer_Test() { final int serverCount = 10; final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName(); final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId); final List<Server> servers = new ArrayList<>(); for (i...
@Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadBalancerRoute> routeMap = _routeMap; TreeSet<LoadBalancerRo...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
@Test public void updateServerList_FirstTimeNotPing_Test() { int serverCount = 10; final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName(); final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId); final List<Server> servers = new ArrayList<>(); for (int i = ...
@Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadBalancerRoute> routeMap = _routeMap; TreeSet<LoadBalancerRo...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
@Test public void updateServerList_NotPingMinAvailableServerCount_Test() { int serverCount = 10; final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName(); final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId); List<Server> servers = new ArrayList<>(); for (...
@Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadBalancerRoute> routeMap = _routeMap; TreeSet<LoadBalancerRo...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
@Test public void updateServerList_NotPingExistServer_Test() { int serverCount = 10; final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName(); final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId); List<Server> servers = new ArrayList<>(); for (int i = 0; i...
@Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadBalancerRoute> routeMap = _routeMap; TreeSet<LoadBalancerRo...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
@Test public void updateServerList_PullOutServer_Test() { int repeat = 2; int serverCount = 10; final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName(); final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId); List<Server> servers = new ArrayList<>(); for (i...
@Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadBalancerRoute> routeMap = _routeMap; TreeSet<LoadBalancerRo...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
@Test public void updateServerList_AddNewRoute_Test() { int repeat = 2; int serverCount = 10; final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName(); List<Server> servers = new ArrayList<>(); for (int i = 0; i < serverCount; i++) { servers.add(Server.newBuilder().setServerId("server_" + i).build(...
@Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadBalancerRoute> routeMap = _routeMap; TreeSet<LoadBalancerRo...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
DefaultServerSourceFilter implements ServerSourceFilter { @Override public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) { if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains())) return null; HashMap<String, LoadB...
@Test public void specificValueTest() { String specificJson = "{\"value\": \"abcd\1nefg\"}"; TestEntity testEntity = SSJsonSerializer.DEFAULT.deserialize(new ByteArrayInputStream(specificJson.getBytes()), TestEntity.class); assertNotNull(testEntity.getValue()); }
@Override public <T> T deserialize(InputStream is, Class<T> clazz) { try { return _mapper.readValue(is, clazz); } catch (RuntimeException | Error ex) { throw ex; } catch (Exception ex) { throw new SerializationException(ex); } }
SSJsonSerializer implements StreamSerializer, StringSerializer { @Override public <T> T deserialize(InputStream is, Class<T> clazz) { try { return _mapper.readValue(is, clazz); } catch (RuntimeException | Error ex) { throw ex; } catch (Exception ex) { throw new SerializationException(ex); } } }
SSJsonSerializer implements StreamSerializer, StringSerializer { @Override public <T> T deserialize(InputStream is, Class<T> clazz) { try { return _mapper.readValue(is, clazz); } catch (RuntimeException | Error ex) { throw ex; } catch (Exception ex) { throw new SerializationException(ex); } } SSJsonSerializer(); SSJso...
SSJsonSerializer implements StreamSerializer, StringSerializer { @Override public <T> T deserialize(InputStream is, Class<T> clazz) { try { return _mapper.readValue(is, clazz); } catch (RuntimeException | Error ex) { throw ex; } catch (Exception ex) { throw new SerializationException(ex); } } SSJsonSerializer(); SSJso...
SSJsonSerializer implements StreamSerializer, StringSerializer { @Override public <T> T deserialize(InputStream is, Class<T> clazz) { try { return _mapper.readValue(is, clazz); } catch (RuntimeException | Error ex) { throw ex; } catch (Exception ex) { throw new SerializationException(ex); } } SSJsonSerializer(); SSJso...
@Test public void testBooleanAbnormal() { MyConfigurationManager myManager = new MyConfigurationManager(); DefaultTypedProperty<Boolean> p = (DefaultTypedProperty<Boolean>) myManager.getProperty("bool", "bKey", "True "); assertTrue(p.typedValue().booleanValue()); p = (DefaultTypedProperty<Boolean>) myManager.getPropert...
@Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
@Test public void timeBasedRandom() { int length = 20; String id = UnsafeIDGenerator.timeBasedRandom(length); Assert.assertEquals(id.length(), length); System.out.println(id); }
public static String timeBasedRandom(int length) { String date = DateValues.toString(new Date(), TIME_FORMAT, UTC_TIME_ZONE); if (length < TIME_BASED_RANDOM_MIN_LENGTH) length = TIME_BASED_RANDOM_MIN_LENGTH; return date + random(length - TIME_FORMAT.length()); }
UnsafeIDGenerator { public static String timeBasedRandom(int length) { String date = DateValues.toString(new Date(), TIME_FORMAT, UTC_TIME_ZONE); if (length < TIME_BASED_RANDOM_MIN_LENGTH) length = TIME_BASED_RANDOM_MIN_LENGTH; return date + random(length - TIME_FORMAT.length()); } }
UnsafeIDGenerator { public static String timeBasedRandom(int length) { String date = DateValues.toString(new Date(), TIME_FORMAT, UTC_TIME_ZONE); if (length < TIME_BASED_RANDOM_MIN_LENGTH) length = TIME_BASED_RANDOM_MIN_LENGTH; return date + random(length - TIME_FORMAT.length()); } private UnsafeIDGenerator(); }
UnsafeIDGenerator { public static String timeBasedRandom(int length) { String date = DateValues.toString(new Date(), TIME_FORMAT, UTC_TIME_ZONE); if (length < TIME_BASED_RANDOM_MIN_LENGTH) length = TIME_BASED_RANDOM_MIN_LENGTH; return date + random(length - TIME_FORMAT.length()); } private UnsafeIDGenerator(); static ...
UnsafeIDGenerator { public static String timeBasedRandom(int length) { String date = DateValues.toString(new Date(), TIME_FORMAT, UTC_TIME_ZONE); if (length < TIME_BASED_RANDOM_MIN_LENGTH) length = TIME_BASED_RANDOM_MIN_LENGTH; return date + random(length - TIME_FORMAT.length()); } private UnsafeIDGenerator(); static ...
@Test public void timeBasedRandomMinLength() { int length = 17; String id = UnsafeIDGenerator.timeBasedRandom(length); Assert.assertNotEquals(length, id.length()); Assert.assertEquals(UnsafeIDGenerator.TIME_BASED_RANDOM_MIN_LENGTH, id.length()); System.out.println(id); }
public static String timeBasedRandom(int length) { String date = DateValues.toString(new Date(), TIME_FORMAT, UTC_TIME_ZONE); if (length < TIME_BASED_RANDOM_MIN_LENGTH) length = TIME_BASED_RANDOM_MIN_LENGTH; return date + random(length - TIME_FORMAT.length()); }
UnsafeIDGenerator { public static String timeBasedRandom(int length) { String date = DateValues.toString(new Date(), TIME_FORMAT, UTC_TIME_ZONE); if (length < TIME_BASED_RANDOM_MIN_LENGTH) length = TIME_BASED_RANDOM_MIN_LENGTH; return date + random(length - TIME_FORMAT.length()); } }
UnsafeIDGenerator { public static String timeBasedRandom(int length) { String date = DateValues.toString(new Date(), TIME_FORMAT, UTC_TIME_ZONE); if (length < TIME_BASED_RANDOM_MIN_LENGTH) length = TIME_BASED_RANDOM_MIN_LENGTH; return date + random(length - TIME_FORMAT.length()); } private UnsafeIDGenerator(); }
UnsafeIDGenerator { public static String timeBasedRandom(int length) { String date = DateValues.toString(new Date(), TIME_FORMAT, UTC_TIME_ZONE); if (length < TIME_BASED_RANDOM_MIN_LENGTH) length = TIME_BASED_RANDOM_MIN_LENGTH; return date + random(length - TIME_FORMAT.length()); } private UnsafeIDGenerator(); static ...
UnsafeIDGenerator { public static String timeBasedRandom(int length) { String date = DateValues.toString(new Date(), TIME_FORMAT, UTC_TIME_ZONE); if (length < TIME_BASED_RANDOM_MIN_LENGTH) length = TIME_BASED_RANDOM_MIN_LENGTH; return date + random(length - TIME_FORMAT.length()); } private UnsafeIDGenerator(); static ...
@Test public void testIntAbnormal() { MyConfigurationManager myManager = new MyConfigurationManager(); DefaultTypedProperty<Integer> p = (DefaultTypedProperty<Integer>) myManager.getProperty("int", "iKey", "123a"); assertNull(null, p.typedValue()); p = (DefaultTypedProperty<Integer>) myManager.getProperty("int", "iKey"...
@Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
@Test public void testLongAbnormal() { MyConfigurationManager myManager = new MyConfigurationManager(); DefaultTypedProperty<Long> p = (DefaultTypedProperty<Long>) myManager.getProperty("long", "iKey", "9999999a"); assertNull(null, p.typedValue()); p = (DefaultTypedProperty<Long>) myManager.getProperty("long", "iKey", ...
@Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
@Test public void testListAbnormal() { MyConfigurationManager myManager = new MyConfigurationManager(); DefaultTypedProperty<List<String>> p = (DefaultTypedProperty<List<String>>) myManager.getProperty("list", "lKey", "1112,,,2345,,12341,,, "); assertTrue(p.typedValue().size() == 3); p = (DefaultTypedProperty<List<Stri...
@Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
@Test public void testMapAbnormal() { MyConfigurationManager myManager = new MyConfigurationManager(); DefaultTypedProperty<Map<String, String>> p = (DefaultTypedProperty<Map<String, String>>) myManager.getProperty("map", "mKey", "1112,,,2345,,12341,,, "); assertNull(p.typedValue()); p = (DefaultTypedProperty<Map<Strin...
@Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } }
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
DefaultTypedConfigurationManager extends ConfigurationManagerWrapper implements TypedConfigurationManager { @Override public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) { return new DefaultTypedProperty<T>(getProperty(key), valueParser); } DefaultTypedConfigurationManager(ConfigurationManag...
@Test public void defaultValueConfigurationSourceTest() { DefaultValueConfigurationSource defaultValueConfigurationSource = getDefaultValueConfigurationSource(); MemoryConfigurationSource memoryConfigurationSource = getMemoryConfigurationSource(); ConfigurationManager manager = ConfigurationManagers.newManager(defaultV...
public DefaultValueConfigurationSource(Map<String, String> keyValueMap) { super(Integer.MIN_VALUE, "DefaultValue"); _defaultValueConfiguration = new DefaultValueConfiguration(keyValueMap); }
DefaultValueConfigurationSource extends AbstractConfigurationSource { public DefaultValueConfigurationSource(Map<String, String> keyValueMap) { super(Integer.MIN_VALUE, "DefaultValue"); _defaultValueConfiguration = new DefaultValueConfiguration(keyValueMap); } }
DefaultValueConfigurationSource extends AbstractConfigurationSource { public DefaultValueConfigurationSource(Map<String, String> keyValueMap) { super(Integer.MIN_VALUE, "DefaultValue"); _defaultValueConfiguration = new DefaultValueConfiguration(keyValueMap); } DefaultValueConfigurationSource(Map<String, String> keyValu...
DefaultValueConfigurationSource extends AbstractConfigurationSource { public DefaultValueConfigurationSource(Map<String, String> keyValueMap) { super(Integer.MIN_VALUE, "DefaultValue"); _defaultValueConfiguration = new DefaultValueConfiguration(keyValueMap); } DefaultValueConfigurationSource(Map<String, String> keyValu...
DefaultValueConfigurationSource extends AbstractConfigurationSource { public DefaultValueConfigurationSource(Map<String, String> keyValueMap) { super(Integer.MIN_VALUE, "DefaultValue"); _defaultValueConfiguration = new DefaultValueConfiguration(keyValueMap); } DefaultValueConfigurationSource(Map<String, String> keyValu...
@Test public void testGetPropertyValue() { EnvironmentVariableConfiguration configuration = new EnvironmentVariableConfiguration(); assertNull(configuration.getPropertyValue(null)); assertNull(configuration.getPropertyValue("")); assertNull(configuration.getPropertyValue("test")); assertEquals("HotSpot 64-Bit Tiered Co...
@Override public String getPropertyValue(String key) { if (Strings.isNullOrEmpty(key)) { _logger.warn("ENV key is null or empty!"); return null; } String value = System.getProperty(key); return value; }
EnvironmentVariableConfiguration implements Configuration { @Override public String getPropertyValue(String key) { if (Strings.isNullOrEmpty(key)) { _logger.warn("ENV key is null or empty!"); return null; } String value = System.getProperty(key); return value; } }
EnvironmentVariableConfiguration implements Configuration { @Override public String getPropertyValue(String key) { if (Strings.isNullOrEmpty(key)) { _logger.warn("ENV key is null or empty!"); return null; } String value = System.getProperty(key); return value; } }
EnvironmentVariableConfiguration implements Configuration { @Override public String getPropertyValue(String key) { if (Strings.isNullOrEmpty(key)) { _logger.warn("ENV key is null or empty!"); return null; } String value = System.getProperty(key); return value; } @Override String getPropertyValue(String key); }
EnvironmentVariableConfiguration implements Configuration { @Override public String getPropertyValue(String key) { if (Strings.isNullOrEmpty(key)) { _logger.warn("ENV key is null or empty!"); return null; } String value = System.getProperty(key); return value; } @Override String getPropertyValue(String key); }
@Test public void testGetTimestamp() throws Exception { QueryResultDataPoint subject = new QueryResultDataPoint(); Assert.assertEquals("Timestamp of uninitialized QueryResultDataPoint should be zero.", subject.getTimestamp(), 0); QueryResultDataPoint initializedSubject = new QueryResultDataPoint(initialTime, initialVal...
public long getTimestamp() { return timestamp; }
QueryResultDataPoint { public long getTimestamp() { return timestamp; } }
QueryResultDataPoint { public long getTimestamp() { return timestamp; } QueryResultDataPoint(); QueryResultDataPoint(long timestamp, double value); }
QueryResultDataPoint { public long getTimestamp() { return timestamp; } QueryResultDataPoint(); QueryResultDataPoint(long timestamp, double value); long getTimestamp(); void setTimestamp(long timestamp); double getValue(); void setValue(double value); @Override boolean equals(Object o); @Override int hashCode(); }
QueryResultDataPoint { public long getTimestamp() { return timestamp; } QueryResultDataPoint(); QueryResultDataPoint(long timestamp, double value); long getTimestamp(); void setTimestamp(long timestamp); double getValue(); void setValue(double value); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void testMakeError() throws Exception { String errorMessageString = "Error String"; String errorCauseString = "Error Cause String"; String errorPartString = "Error Part String"; Map<String, Object> subject = Utils.makeError(errorMessageString, errorCauseString, errorPartString); Assert.assertEquals("Error ...
public static Map<String, Object> makeError(String errorMessage, String errorCause, String errorPart) { Map<String, Object> error = new HashMap<>(); error.put(ERROR_MESSAGE, errorMessage); error.put(ERROR_CAUSE, errorCause); error.put(ERROR_PART, errorPart); return error; }
Utils { public static Map<String, Object> makeError(String errorMessage, String errorCause, String errorPart) { Map<String, Object> error = new HashMap<>(); error.put(ERROR_MESSAGE, errorMessage); error.put(ERROR_CAUSE, errorCause); error.put(ERROR_PART, errorPart); return error; } }
Utils { public static Map<String, Object> makeError(String errorMessage, String errorCause, String errorPart) { Map<String, Object> error = new HashMap<>(); error.put(ERROR_MESSAGE, errorMessage); error.put(ERROR_CAUSE, errorCause); error.put(ERROR_PART, errorPart); return error; } private Utils(); }
Utils { public static Map<String, Object> makeError(String errorMessage, String errorCause, String errorPart) { Map<String, Object> error = new HashMap<>(); error.put(ERROR_MESSAGE, errorMessage); error.put(ERROR_CAUSE, errorCause); error.put(ERROR_PART, errorPart); return error; } private Utils(); static Map<String, ...
Utils { public static Map<String, Object> makeError(String errorMessage, String errorCause, String errorPart) { Map<String, Object> error = new HashMap<>(); error.put(ERROR_MESSAGE, errorMessage); error.put(ERROR_CAUSE, errorCause); error.put(ERROR_PART, errorPart); return error; } private Utils(); static Map<String, ...
@Test public void testGetErrorResponse() throws Exception { String idString = "ID String"; int status = 404; String messageString = "Message String"; String contextString = "Context String"; Response subject = Utils.getErrorResponse(idString, status, messageString, contextString); Assert.assertEquals("Status of created...
public static Response getErrorResponse(String id, int status, String message, String context) { ErrorResponse errorResponse = new ErrorResponse(); errorResponse.id = id; errorResponse.errorSource = context; errorResponse.errorMessage = message; String jsonErrorResponse = jsonStringFromObject(errorResponse); return Res...
Utils { public static Response getErrorResponse(String id, int status, String message, String context) { ErrorResponse errorResponse = new ErrorResponse(); errorResponse.id = id; errorResponse.errorSource = context; errorResponse.errorMessage = message; String jsonErrorResponse = jsonStringFromObject(errorResponse); re...
Utils { public static Response getErrorResponse(String id, int status, String message, String context) { ErrorResponse errorResponse = new ErrorResponse(); errorResponse.id = id; errorResponse.errorSource = context; errorResponse.errorMessage = message; String jsonErrorResponse = jsonStringFromObject(errorResponse); re...
Utils { public static Response getErrorResponse(String id, int status, String message, String context) { ErrorResponse errorResponse = new ErrorResponse(); errorResponse.id = id; errorResponse.errorSource = context; errorResponse.errorMessage = message; String jsonErrorResponse = jsonStringFromObject(errorResponse); re...
Utils { public static Response getErrorResponse(String id, int status, String message, String context) { ErrorResponse errorResponse = new ErrorResponse(); errorResponse.id = id; errorResponse.errorSource = context; errorResponse.errorMessage = message; String jsonErrorResponse = jsonStringFromObject(errorResponse); re...
@Test public void testCreateUuid() throws Exception { String subject = Utils.createUuid(); UUID testUUID = UUID.fromString(subject); String otherSubject = Utils.createUuid(); Assert.assertNotEquals("Two UUIDs generated by different calls should not be the same.", subject, otherSubject); }
public static String createUuid() { return UUID.randomUUID().toString(); }
Utils { public static String createUuid() { return UUID.randomUUID().toString(); } }
Utils { public static String createUuid() { return UUID.randomUUID().toString(); } private Utils(); }
Utils { public static String createUuid() { return UUID.randomUUID().toString(); } private Utils(); static Map<String, Object> makeError(String errorMessage, String errorCause, String errorPart); static Response getErrorResponse(String id, int status, String message, String ...
Utils { public static String createUuid() { return UUID.randomUUID().toString(); } private Utils(); static Map<String, Object> makeError(String errorMessage, String errorCause, String errorPart); static Response getErrorResponse(String id, int status, String message, String ...
@Test public void testParseDate() throws Exception { long testTime = 1422728245L; String testTimeString = "1422728245"; String testTimeMillisString = "1422728245697"; String testTimeGMTString = "2015/01/31-18:17:25 GMT+0"; String testTimeLocalNoTzString = new SimpleDateFormat("YYYY/MM/dd-HH:mm:ss").format(new Date(test...
public static long parseDate(String value) throws ParseException { String v = value.trim(); if (NOW.equals(v)) { return new Date().getTime() / 1000; } if (v.endsWith("-ago")) { return new Date().getTime() / 1000 - parseDuration(v.substring(0, v.length() - 4)); } if (v.indexOf('/') == -1) { long result = 0; try { result...
Utils { public static long parseDate(String value) throws ParseException { String v = value.trim(); if (NOW.equals(v)) { return new Date().getTime() / 1000; } if (v.endsWith("-ago")) { return new Date().getTime() / 1000 - parseDuration(v.substring(0, v.length() - 4)); } if (v.indexOf('/') == -1) { long result = 0; try ...
Utils { public static long parseDate(String value) throws ParseException { String v = value.trim(); if (NOW.equals(v)) { return new Date().getTime() / 1000; } if (v.endsWith("-ago")) { return new Date().getTime() / 1000 - parseDuration(v.substring(0, v.length() - 4)); } if (v.indexOf('/') == -1) { long result = 0; try ...
Utils { public static long parseDate(String value) throws ParseException { String v = value.trim(); if (NOW.equals(v)) { return new Date().getTime() / 1000; } if (v.endsWith("-ago")) { return new Date().getTime() / 1000 - parseDuration(v.substring(0, v.length() - 4)); } if (v.indexOf('/') == -1) { long result = 0; try ...
Utils { public static long parseDate(String value) throws ParseException { String v = value.trim(); if (NOW.equals(v)) { return new Date().getTime() / 1000; } if (v.endsWith("-ago")) { return new Date().getTime() / 1000 - parseDuration(v.substring(0, v.length() - 4)); } if (v.indexOf('/') == -1) { long result = 0; try ...
@Test public void testParseDuration() throws Exception { Assert.assertEquals(Utils.parseDuration("5s"), 5); Assert.assertEquals(Utils.parseDuration("5w"), 5 * Utils.SECONDS_PER_WEEK); Assert.assertEquals(Utils.parseDuration("2y"), 2 * Utils.SECONDS_PER_YEAR); Assert.assertEquals(Utils.parseDuration("5s-ago"), 5); Asser...
public static long parseDuration(String v) { int idx; char last; if ((idx = v.indexOf('-')) > 0) { idx -= 1; last = v.charAt(idx); } else { idx = v.length() - 1; last = v.charAt(idx); } long period = 0; try { period = Long.parseLong(v.substring(0, idx)); } catch (NumberFormatException e) { return 0; } switch (last) { c...
Utils { public static long parseDuration(String v) { int idx; char last; if ((idx = v.indexOf('-')) > 0) { idx -= 1; last = v.charAt(idx); } else { idx = v.length() - 1; last = v.charAt(idx); } long period = 0; try { period = Long.parseLong(v.substring(0, idx)); } catch (NumberFormatException e) { return 0; } switch (l...
Utils { public static long parseDuration(String v) { int idx; char last; if ((idx = v.indexOf('-')) > 0) { idx -= 1; last = v.charAt(idx); } else { idx = v.length() - 1; last = v.charAt(idx); } long period = 0; try { period = Long.parseLong(v.substring(0, idx)); } catch (NumberFormatException e) { return 0; } switch (l...
Utils { public static long parseDuration(String v) { int idx; char last; if ((idx = v.indexOf('-')) > 0) { idx -= 1; last = v.charAt(idx); } else { idx = v.length() - 1; last = v.charAt(idx); } long period = 0; try { period = Long.parseLong(v.substring(0, idx)); } catch (NumberFormatException e) { return 0; } switch (l...
Utils { public static long parseDuration(String v) { int idx; char last; if ((idx = v.indexOf('-')) > 0) { idx -= 1; last = v.charAt(idx); } else { idx = v.length() - 1; last = v.charAt(idx); } long period = 0; try { period = Long.parseLong(v.substring(0, idx)); } catch (NumberFormatException e) { return 0; } switch (l...
@Test public void testGetTagAuth() { when(configuration.isAuthEnabled()).thenReturn(true); Subject subject = mock( Subject.class); when(security.getSubject()).thenReturn( subject); PrincipalCollection collection = mock(PrincipalCollection.class); when(subject.getPrincipals()).thenReturn( collection); ZenossTenant tenan...
Optional<Map<String, List<String>>> getTags(Map<String, List<String>> tags) { if (configuration.isAuthEnabled()) { if (tags == null) { tags = Maps.newHashMap(); } String tenantId = getTenantId(); tags.put("zenoss_tenant_id", Lists.newArrayList(tenantId)); } return Optional.fromNullable(tags); }
MetricResources { Optional<Map<String, List<String>>> getTags(Map<String, List<String>> tags) { if (configuration.isAuthEnabled()) { if (tags == null) { tags = Maps.newHashMap(); } String tenantId = getTenantId(); tags.put("zenoss_tenant_id", Lists.newArrayList(tenantId)); } return Optional.fromNullable(tags); } }
MetricResources { Optional<Map<String, List<String>>> getTags(Map<String, List<String>> tags) { if (configuration.isAuthEnabled()) { if (tags == null) { tags = Maps.newHashMap(); } String tenantId = getTenantId(); tags.put("zenoss_tenant_id", Lists.newArrayList(tenantId)); } return Optional.fromNullable(tags); } Metric...
MetricResources { Optional<Map<String, List<String>>> getTags(Map<String, List<String>> tags) { if (configuration.isAuthEnabled()) { if (tags == null) { tags = Maps.newHashMap(); } String tenantId = getTenantId(); tags.put("zenoss_tenant_id", Lists.newArrayList(tenantId)); } return Optional.fromNullable(tags); } Metric...
MetricResources { Optional<Map<String, List<String>>> getTags(Map<String, List<String>> tags) { if (configuration.isAuthEnabled()) { if (tags == null) { tags = Maps.newHashMap(); } String tenantId = getTenantId(); tags.put("zenoss_tenant_id", Lists.newArrayList(tenantId)); } return Optional.fromNullable(tags); } Metric...
@Test public void testGetTagNoAuth() { Optional<Map<String, List<String>>> tags = Optional.fromNullable(null); when(configuration.isAuthEnabled()).thenReturn(false); assertEquals(tags, new MetricResources(configuration, security, api).getTags(null)); }
Optional<Map<String, List<String>>> getTags(Map<String, List<String>> tags) { if (configuration.isAuthEnabled()) { if (tags == null) { tags = Maps.newHashMap(); } String tenantId = getTenantId(); tags.put("zenoss_tenant_id", Lists.newArrayList(tenantId)); } return Optional.fromNullable(tags); }
MetricResources { Optional<Map<String, List<String>>> getTags(Map<String, List<String>> tags) { if (configuration.isAuthEnabled()) { if (tags == null) { tags = Maps.newHashMap(); } String tenantId = getTenantId(); tags.put("zenoss_tenant_id", Lists.newArrayList(tenantId)); } return Optional.fromNullable(tags); } }
MetricResources { Optional<Map<String, List<String>>> getTags(Map<String, List<String>> tags) { if (configuration.isAuthEnabled()) { if (tags == null) { tags = Maps.newHashMap(); } String tenantId = getTenantId(); tags.put("zenoss_tenant_id", Lists.newArrayList(tenantId)); } return Optional.fromNullable(tags); } Metric...
MetricResources { Optional<Map<String, List<String>>> getTags(Map<String, List<String>> tags) { if (configuration.isAuthEnabled()) { if (tags == null) { tags = Maps.newHashMap(); } String tenantId = getTenantId(); tags.put("zenoss_tenant_id", Lists.newArrayList(tenantId)); } return Optional.fromNullable(tags); } Metric...
MetricResources { Optional<Map<String, List<String>>> getTags(Map<String, List<String>> tags) { if (configuration.isAuthEnabled()) { if (tags == null) { tags = Maps.newHashMap(); } String tenantId = getTenantId(); tags.put("zenoss_tenant_id", Lists.newArrayList(tenantId)); } return Optional.fromNullable(tags); } Metric...
@Test public void testMetricFilter() throws Exception { MetricService victim = makeMetricService(); }
public static List<MetricSpecification> metricFilter(List<? extends MetricSpecification> list) { List<MetricSpecification> result = new ArrayList<>(); if (list != null) { for (MetricSpecification spec : list) { if (spec.getMetric() != null) { result.add(spec); } else { log.debug("MetricFilter: filtering out metricSpeci...
MetricService implements MetricServiceAPI { public static List<MetricSpecification> metricFilter(List<? extends MetricSpecification> list) { List<MetricSpecification> result = new ArrayList<>(); if (list != null) { for (MetricSpecification spec : list) { if (spec.getMetric() != null) { result.add(spec); } else { log.de...
MetricService implements MetricServiceAPI { public static List<MetricSpecification> metricFilter(List<? extends MetricSpecification> list) { List<MetricSpecification> result = new ArrayList<>(); if (list != null) { for (MetricSpecification spec : list) { if (spec.getMetric() != null) { result.add(spec); } else { log.de...
MetricService implements MetricServiceAPI { public static List<MetricSpecification> metricFilter(List<? extends MetricSpecification> list) { List<MetricSpecification> result = new ArrayList<>(); if (list != null) { for (MetricSpecification spec : list) { if (spec.getMetric() != null) { result.add(spec); } else { log.de...
MetricService implements MetricServiceAPI { public static List<MetricSpecification> metricFilter(List<? extends MetricSpecification> list) { List<MetricSpecification> result = new ArrayList<>(); if (list != null) { for (MetricSpecification spec : list) { if (spec.getMetric() != null) { result.add(spec); } else { log.de...
@Test public void testQuery() throws Exception { }
@Override public Response query(Optional<String> id, Optional<String> start, Optional<String> end, Optional<ReturnSet> returnset, Optional<Boolean> series, Optional<String> downsample, double downsampleMultiplier, Optional<Map<String, List<String>>> tags, List<MetricSpecification> metrics) { SeriesQueryResult queryResu...
MetricService implements MetricServiceAPI { @Override public Response query(Optional<String> id, Optional<String> start, Optional<String> end, Optional<ReturnSet> returnset, Optional<Boolean> series, Optional<String> downsample, double downsampleMultiplier, Optional<Map<String, List<String>>> tags, List<MetricSpecifica...
MetricService implements MetricServiceAPI { @Override public Response query(Optional<String> id, Optional<String> start, Optional<String> end, Optional<ReturnSet> returnset, Optional<Boolean> series, Optional<String> downsample, double downsampleMultiplier, Optional<Map<String, List<String>>> tags, List<MetricSpecifica...
MetricService implements MetricServiceAPI { @Override public Response query(Optional<String> id, Optional<String> start, Optional<String> end, Optional<ReturnSet> returnset, Optional<Boolean> series, Optional<String> downsample, double downsampleMultiplier, Optional<Map<String, List<String>>> tags, List<MetricSpecifica...
MetricService implements MetricServiceAPI { @Override public Response query(Optional<String> id, Optional<String> start, Optional<String> end, Optional<ReturnSet> returnset, Optional<Boolean> series, Optional<String> downsample, double downsampleMultiplier, Optional<Map<String, List<String>>> tags, List<MetricSpecifica...
@Test public void testOptions() throws Exception { }
@Override public Response options(String request) { corsHeaders = request; return makeCORS(Response.ok(), request); }
MetricService implements MetricServiceAPI { @Override public Response options(String request) { corsHeaders = request; return makeCORS(Response.ok(), request); } }
MetricService implements MetricServiceAPI { @Override public Response options(String request) { corsHeaders = request; return makeCORS(Response.ok(), request); } MetricService(); }
MetricService implements MetricServiceAPI { @Override public Response options(String request) { corsHeaders = request; return makeCORS(Response.ok(), request); } MetricService(); static List<MetricSpecification> metricFilter(List<? extends MetricSpecification> list); static List<MetricSpecification> calculatedValueFilt...
MetricService implements MetricServiceAPI { @Override public Response options(String request) { corsHeaders = request; return makeCORS(Response.ok(), request); } MetricService(); static List<MetricSpecification> metricFilter(List<? extends MetricSpecification> list); static List<MetricSpecification> calculatedValueFilt...
@Test public void testSetTimestamp() throws Exception { QueryResultDataPoint subject = new QueryResultDataPoint(); Assert.assertEquals("Timestamp of uninitialized QueryResultDataPoint should be zero.", subject.getTimestamp(), 0); subject.setTimestamp(initialTime); Assert.assertEquals("Timestamp of initialized QueryResu...
public void setTimestamp(long timestamp) { this.timestamp = timestamp; }
QueryResultDataPoint { public void setTimestamp(long timestamp) { this.timestamp = timestamp; } }
QueryResultDataPoint { public void setTimestamp(long timestamp) { this.timestamp = timestamp; } QueryResultDataPoint(); QueryResultDataPoint(long timestamp, double value); }
QueryResultDataPoint { public void setTimestamp(long timestamp) { this.timestamp = timestamp; } QueryResultDataPoint(); QueryResultDataPoint(long timestamp, double value); long getTimestamp(); void setTimestamp(long timestamp); double getValue(); void setValue(double value); @Override boolean equals(Object o); @Overri...
QueryResultDataPoint { public void setTimestamp(long timestamp) { this.timestamp = timestamp; } QueryResultDataPoint(); QueryResultDataPoint(long timestamp, double value); long getTimestamp(); void setTimestamp(long timestamp); double getValue(); void setValue(double value); @Override boolean equals(Object o); @Overri...
@Test public void testEquals() throws Exception { MetricKey victim = new MetricKey(); MetricKey other = new MetricKey(); assertTrue("Two newly created MetricKeys should be equal.", victim.equals(other)); assertFalse("Equal comparison with null should return false.", victim.equals(null)); assertFalse("Equal comparison w...
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MetricKey metricKey = (MetricKey) o; if (metric != null ? !metric.equals(metricKey.metric) : metricKey.metric != null) return false; if (name != null ? !name.equals(metricKey.name) : metric...
MetricKey implements IHasShortcut { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MetricKey metricKey = (MetricKey) o; if (metric != null ? !metric.equals(metricKey.metric) : metricKey.metric != null) return false; if (name != null ? !...
MetricKey implements IHasShortcut { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MetricKey metricKey = (MetricKey) o; if (metric != null ? !metric.equals(metricKey.metric) : metricKey.metric != null) return false; if (name != null ? !...
MetricKey implements IHasShortcut { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MetricKey metricKey = (MetricKey) o; if (metric != null ? !metric.equals(metricKey.metric) : metricKey.metric != null) return false; if (name != null ? !...
MetricKey implements IHasShortcut { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MetricKey metricKey = (MetricKey) o; if (metric != null ? !metric.equals(metricKey.metric) : metricKey.metric != null) return false; if (name != null ? !...
@Test public void testGetMetric() throws Exception { MetricKey victim = makeBasicMetricKey(); assertTrue("getMetric should return the metric value passed in.", Objects.equal(basicMetric, victim.getMetric())); }
@JsonProperty("metric") public String getMetric() { return metric; }
MetricKey implements IHasShortcut { @JsonProperty("metric") public String getMetric() { return metric; } }
MetricKey implements IHasShortcut { @JsonProperty("metric") public String getMetric() { return metric; } }
MetricKey implements IHasShortcut { @JsonProperty("metric") public String getMetric() { return metric; } @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); @Override boolean equals(Object o); @Override int hashCo...
MetricKey implements IHasShortcut { @JsonProperty("metric") public String getMetric() { return metric; } @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); @Override boolean equals(Object o); @Override int hashCo...
@Test public void testGetTags() throws Exception { String tagsValue = "Tag1=value1"; MetricKey victim = makeBasicMetricKey(); assertTrue("getTags should return the tag value passed in.", Objects.equal(basicTagValue, victim.getTags())); }
@JsonProperty("tags") public Tags getTags() { return tags; }
MetricKey implements IHasShortcut { @JsonProperty("tags") public Tags getTags() { return tags; } }
MetricKey implements IHasShortcut { @JsonProperty("tags") public Tags getTags() { return tags; } }
MetricKey implements IHasShortcut { @JsonProperty("tags") public Tags getTags() { return tags; } @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); @Override boolean equals(Object o); @Override int hashCode(); st...
MetricKey implements IHasShortcut { @JsonProperty("tags") public Tags getTags() { return tags; } @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); @Override boolean equals(Object o); @Override int hashCode(); st...
@Test public void testGetName() throws Exception { MetricKey victim = makeBasicMetricKey(); assertTrue("getName should return the metric value passed in.", Objects.equal(basicName, victim.getName())); }
@JsonProperty("name") public String getName() { return name; }
MetricKey implements IHasShortcut { @JsonProperty("name") public String getName() { return name; } }
MetricKey implements IHasShortcut { @JsonProperty("name") public String getName() { return name; } }
MetricKey implements IHasShortcut { @JsonProperty("name") public String getName() { return name; } @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); @Override boolean equals(Object o); @Override int hashCode(); ...
MetricKey implements IHasShortcut { @JsonProperty("name") public String getName() { return name; } @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); @Override boolean equals(Object o); @Override int hashCode(); ...
@Test public void testFromValue() throws Exception { MetricKey victim = MetricKey.fromValue(basicName, basicMetric, basicTag); assertTrue("Name was not same as passed to fromValue().", Objects.equal(victim.getName(), basicName)); assertTrue("MetricName was not same as passed to fromValue().", Objects.equal(victim.getMe...
public static MetricKey fromValue(MetricSpecification spec) { MetricKey key = new MetricKey(); key.metric = spec.getMetricOrName(); key.name = spec.getNameOrMetric(); key.id = spec.getId(); if (spec.getTags() != null && spec.getTags().size() > 0) { key.tags = Tags.fromValue(spec.getTags()); } return key; }
MetricKey implements IHasShortcut { public static MetricKey fromValue(MetricSpecification spec) { MetricKey key = new MetricKey(); key.metric = spec.getMetricOrName(); key.name = spec.getNameOrMetric(); key.id = spec.getId(); if (spec.getTags() != null && spec.getTags().size() > 0) { key.tags = Tags.fromValue(spec.getT...
MetricKey implements IHasShortcut { public static MetricKey fromValue(MetricSpecification spec) { MetricKey key = new MetricKey(); key.metric = spec.getMetricOrName(); key.name = spec.getNameOrMetric(); key.id = spec.getId(); if (spec.getTags() != null && spec.getTags().size() > 0) { key.tags = Tags.fromValue(spec.getT...
MetricKey implements IHasShortcut { public static MetricKey fromValue(MetricSpecification spec) { MetricKey key = new MetricKey(); key.metric = spec.getMetricOrName(); key.name = spec.getNameOrMetric(); key.id = spec.getId(); if (spec.getTags() != null && spec.getTags().size() > 0) { key.tags = Tags.fromValue(spec.getT...
MetricKey implements IHasShortcut { public static MetricKey fromValue(MetricSpecification spec) { MetricKey key = new MetricKey(); key.metric = spec.getMetricOrName(); key.name = spec.getNameOrMetric(); key.id = spec.getId(); if (spec.getTags() != null && spec.getTags().size() > 0) { key.tags = Tags.fromValue(spec.getT...
@Test public void testToString() throws Exception { }
public String toString() { return String.format("MetricKey=[metric=%s, name=%s, tags=%s, id=%s]", metric, name, tags, id); }
MetricKey implements IHasShortcut { public String toString() { return String.format("MetricKey=[metric=%s, name=%s, tags=%s, id=%s]", metric, name, tags, id); } }
MetricKey implements IHasShortcut { public String toString() { return String.format("MetricKey=[metric=%s, name=%s, tags=%s, id=%s]", metric, name, tags, id); } }
MetricKey implements IHasShortcut { public String toString() { return String.format("MetricKey=[metric=%s, name=%s, tags=%s, id=%s]", metric, name, tags, id); } @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); ...
MetricKey implements IHasShortcut { public String toString() { return String.format("MetricKey=[metric=%s, name=%s, tags=%s, id=%s]", metric, name, tags, id); } @JsonProperty("id") String getId(); @JsonProperty("metric") String getMetric(); @JsonProperty("tags") Tags getTags(); @JsonProperty("name") String getName(); ...
@Test public void testMakeResults() throws IOException { JacksonResultsWriter victim = new JacksonResultsWriter(); String[] queryStrings = new String[] { "avg:laLoadInt1{tag1=*,tag2=*}", "sum:laLoadInt5{tag1=*,tag2=*}" }; List<MetricSpecification> queries = makeTestQueries(queryStrings); long startTs = DATA_START_TIMES...
public SeriesQueryResult makeResults(List<MetricSpecification> queries, Buckets<IHasShortcut> buckets, String id, String sourceId, long startTs, String startTimeConfig, long endTs, String endTimeConfig, ReturnSet returnset) { SeriesQueryResult result = new SeriesQueryResult(); result.setClientId(id); result.setEndTime(...
JacksonResultsWriter { public SeriesQueryResult makeResults(List<MetricSpecification> queries, Buckets<IHasShortcut> buckets, String id, String sourceId, long startTs, String startTimeConfig, long endTs, String endTimeConfig, ReturnSet returnset) { SeriesQueryResult result = new SeriesQueryResult(); result.setClientId(...
JacksonResultsWriter { public SeriesQueryResult makeResults(List<MetricSpecification> queries, Buckets<IHasShortcut> buckets, String id, String sourceId, long startTs, String startTimeConfig, long endTs, String endTimeConfig, ReturnSet returnset) { SeriesQueryResult result = new SeriesQueryResult(); result.setClientId(...
JacksonResultsWriter { public SeriesQueryResult makeResults(List<MetricSpecification> queries, Buckets<IHasShortcut> buckets, String id, String sourceId, long startTs, String startTimeConfig, long endTs, String endTimeConfig, ReturnSet returnset) { SeriesQueryResult result = new SeriesQueryResult(); result.setClientId(...
JacksonResultsWriter { public SeriesQueryResult makeResults(List<MetricSpecification> queries, Buckets<IHasShortcut> buckets, String id, String sourceId, long startTs, String startTimeConfig, long endTs, String endTimeConfig, ReturnSet returnset) { SeriesQueryResult result = new SeriesQueryResult(); result.setClientId(...
@Test public void testLookup() throws Exception { Closure closure = mock(Closure.class); Value myValue = new Value(); myValue.add(1.0); when(closure.getValueByShortcut("name")).thenReturn(myValue); DefaultResultProcessor victim = new DefaultResultProcessor(null, null, Buckets.DEFAULT_BUCKET_SIZE); double foundValue = v...
@Override public double lookup(String name, Closure closure) throws UnknownReferenceException { if (null == closure) { throw new NullPointerException("null closure passed to lookup() method."); } if ("time".equalsIgnoreCase(name)) { return closure.getTimeStamp(); } Value v = closure.getValueByShortcut(name); if (v == n...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public double lookup(String name, Closure closure) throws UnknownReferenceException { if (null == closure) { throw new NullPointerException("null closure passed to lookup() method."); } if ("time".equalsIgnoreCase(name)) { return c...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public double lookup(String name, Closure closure) throws UnknownReferenceException { if (null == closure) { throw new NullPointerException("null closure passed to lookup() method."); } if ("time".equalsIgnoreCase(name)) { return c...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public double lookup(String name, Closure closure) throws UnknownReferenceException { if (null == closure) { throw new NullPointerException("null closure passed to lookup() method."); } if ("time".equalsIgnoreCase(name)) { return c...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public double lookup(String name, Closure closure) throws UnknownReferenceException { if (null == closure) { throw new NullPointerException("null closure passed to lookup() method."); } if ("time".equalsIgnoreCase(name)) { return c...
@Test public void testProcessResultsWithConstantSeries() throws Exception { Collection<OpenTSDBQueryResult> qResults = makeResults(); List<MetricSpecification> queries = makeQueries(); DefaultResultProcessor victim = new DefaultResultProcessor(qResults, queries, BUCKET_SIZE); Buckets<IHasShortcut> results = victim.proc...
@Override public Buckets<IHasShortcut> processResults() throws IOException, ClassNotFoundException, BadExpressionException { initialize(); for (MetricSpecification metricSpecification : queries) { preProcessQuerySpecifications(metricSpecification); } List<MetricSpecification> calculatedValues = MetricService.calculated...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public Buckets<IHasShortcut> processResults() throws IOException, ClassNotFoundException, BadExpressionException { initialize(); for (MetricSpecification metricSpecification : queries) { preProcessQuerySpecifications(metricSpecific...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public Buckets<IHasShortcut> processResults() throws IOException, ClassNotFoundException, BadExpressionException { initialize(); for (MetricSpecification metricSpecification : queries) { preProcessQuerySpecifications(metricSpecific...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public Buckets<IHasShortcut> processResults() throws IOException, ClassNotFoundException, BadExpressionException { initialize(); for (MetricSpecification metricSpecification : queries) { preProcessQuerySpecifications(metricSpecific...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public Buckets<IHasShortcut> processResults() throws IOException, ClassNotFoundException, BadExpressionException { initialize(); for (MetricSpecification metricSpecification : queries) { preProcessQuerySpecifications(metricSpecific...
@Test public void testProcessResultsWithYEqualsXSeries() throws Exception { Collection<OpenTSDBQueryResult> qResults = makeYEqualsXResults(); List<MetricSpecification> queries = makeQueries(); DefaultResultProcessor victim = new DefaultResultProcessor(qResults, queries, BUCKET_SIZE); Buckets<IHasShortcut> results = vic...
@Override public Buckets<IHasShortcut> processResults() throws IOException, ClassNotFoundException, BadExpressionException { initialize(); for (MetricSpecification metricSpecification : queries) { preProcessQuerySpecifications(metricSpecification); } List<MetricSpecification> calculatedValues = MetricService.calculated...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public Buckets<IHasShortcut> processResults() throws IOException, ClassNotFoundException, BadExpressionException { initialize(); for (MetricSpecification metricSpecification : queries) { preProcessQuerySpecifications(metricSpecific...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public Buckets<IHasShortcut> processResults() throws IOException, ClassNotFoundException, BadExpressionException { initialize(); for (MetricSpecification metricSpecification : queries) { preProcessQuerySpecifications(metricSpecific...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public Buckets<IHasShortcut> processResults() throws IOException, ClassNotFoundException, BadExpressionException { initialize(); for (MetricSpecification metricSpecification : queries) { preProcessQuerySpecifications(metricSpecific...
DefaultResultProcessor implements ResultProcessor, ReferenceProvider { @Override public Buckets<IHasShortcut> processResults() throws IOException, ClassNotFoundException, BadExpressionException { initialize(); for (MetricSpecification metricSpecification : queries) { preProcessQuerySpecifications(metricSpecific...
@Test public void testGetValue() throws Exception { QueryResultDataPoint subject = new QueryResultDataPoint(); Assert.assertEquals("Value of uninitialized QueryResultDataPoint should be zero.", subject.getValue(), 0.0, EPSILON); QueryResultDataPoint initializedSubject = new QueryResultDataPoint(initialTime, initialValu...
public double getValue() { return value; }
QueryResultDataPoint { public double getValue() { return value; } }
QueryResultDataPoint { public double getValue() { return value; } QueryResultDataPoint(); QueryResultDataPoint(long timestamp, double value); }
QueryResultDataPoint { public double getValue() { return value; } QueryResultDataPoint(); QueryResultDataPoint(long timestamp, double value); long getTimestamp(); void setTimestamp(long timestamp); double getValue(); void setValue(double value); @Override boolean equals(Object o); @Override int hashCode(); }
QueryResultDataPoint { public double getValue() { return value; } QueryResultDataPoint(); QueryResultDataPoint(long timestamp, double value); long getTimestamp(); void setTimestamp(long timestamp); double getValue(); void setValue(double value); @Override boolean equals(Object o); @Override int hashCode(); }
@Test public void testDataPointsMapIsNotNullOnGet() { OpenTSDBQueryResult subject = new OpenTSDBQueryResult(); assertTrue("DataPoints list is non-null on initialization", null != subject.getDataPoints()); }
@JsonIgnore public SortedMap<Long, Double> getDataPoints() { if (null == dps) { dps = new TreeMap<>(); } return dps; }
OpenTSDBQueryResult { @JsonIgnore public SortedMap<Long, Double> getDataPoints() { if (null == dps) { dps = new TreeMap<>(); } return dps; } }
OpenTSDBQueryResult { @JsonIgnore public SortedMap<Long, Double> getDataPoints() { if (null == dps) { dps = new TreeMap<>(); } return dps; } }
OpenTSDBQueryResult { @JsonIgnore public SortedMap<Long, Double> getDataPoints() { if (null == dps) { dps = new TreeMap<>(); } return dps; } QueryStatus getStatus(); void setStatus(QueryStatus status); String debugString(); void addTags(Map<String, List<String>> tagsToAdd); void addDataPoint(long i, double pointValue)...
OpenTSDBQueryResult { @JsonIgnore public SortedMap<Long, Double> getDataPoints() { if (null == dps) { dps = new TreeMap<>(); } return dps; } QueryStatus getStatus(); void setStatus(QueryStatus status); String debugString(); void addTags(Map<String, List<String>> tagsToAdd); void addDataPoint(long i, double pointValue)...
@Test public void testGetMean() { NewValue victim = new NewValue(); double test = victim.getMean(); assertTrue("getMean() on an uninitialized value should return NaN.", Double.isNaN(test)); double val1 = 1.1, val2 = 2.0; victim.push(val1); assertEquals("Value with one entry should return that entry for getMean", val1, ...
public double getMean() { return (numDataValues > 0) ? newMean : Double.NaN; }
NewValue { public double getMean() { return (numDataValues > 0) ? newMean : Double.NaN; } }
NewValue { public double getMean() { return (numDataValues > 0) ? newMean : Double.NaN; } }
NewValue { public double getMean() { return (numDataValues > 0) ? newMean : Double.NaN; } void clear(); void push(double x); long getNumDataValues(); double getMean(); double getVariance(); double getStandardDeviation(); double getSum(); }
NewValue { public double getMean() { return (numDataValues > 0) ? newMean : Double.NaN; } void clear(); void push(double x); long getNumDataValues(); double getMean(); double getVariance(); double getStandardDeviation(); double getSum(); }