use of org.n52.iceland.statistics.api.interfaces.StatisticsServiceEventHandler in project arctic-sea by 52North.
the class EventHandlerFinderTest method findDirectDefaultServiceEvent.
@Test
public void findDirectDefaultServiceEvent() {
Map<String, StatisticsServiceEventHandler<?>> handlers = new HashMap<>();
CountingOutputStreamEventHandler handler = new CountingOutputStreamEventHandler();
CountingOutputStreamEvent request = new CountingOutputStreamEvent();
handlers.put(request.getClass().getSimpleName(), handler);
Assert.assertNotNull(EventHandlerFinder.findHandler(request, handlers));
}
use of org.n52.iceland.statistics.api.interfaces.StatisticsServiceEventHandler in project arctic-sea by 52North.
the class EventHandlerFinderTest method findNoHandlers.
@Test(expected = NullPointerException.class)
public void findNoHandlers() {
Map<String, StatisticsServiceEventHandler<?>> handlers = new HashMap<>();
DefaultServiceEventHandler handler = new DefaultServiceEventHandler();
handlers.put("morpheus", handler);
GetCapabilitiesRequest request = new GetCapabilitiesRequest("SOS");
EventHandlerFinder.findHandler(request, handlers);
}
use of org.n52.iceland.statistics.api.interfaces.StatisticsServiceEventHandler in project arctic-sea by 52North.
the class EventHandlerFinderTest method findSubclassAsHandler.
@Test
public void findSubclassAsHandler() {
Map<String, StatisticsServiceEventHandler<?>> handlers = new HashMap<>();
CodedExceptionEventHandler handler = new CodedExceptionEventHandler();
OperationNotSupportedException exception = new OperationNotSupportedException("GetCapabilities");
handlers.put("CodedException", handler);
Assert.assertNotNull(EventHandlerFinder.findHandler(exception, handlers));
}
Aggregations