use of org.n52.sos.cache.ctrl.DefaultContentModificationListener in project SOS by 52North.
the class AbstractInsertDAOTest method setUp.
public void setUp() throws OwsExceptionReport, ConverterException, EncodingException {
GEOMETRY.setSRID(4326);
SOSHibernateSessionHolder holder = new SOSHibernateSessionHolder();
holder.setConnectionProvider(this);
daoFactory.setSweHelper(new SweHelper());
SosHelper sosHelper = new SosHelper();
sosHelper.setServiceURL(URI.create("http://test.org"));
daoFactory.setSosHelper(sosHelper);
GeometryHandler geometryHandler = new GeometryHandler();
initGeometryHandler(geometryHandler);
daoFactory.setGeometryHandler(geometryHandler);
HibernateFeatureQueryHandler featureQueryHandler = new HibernateFeatureQueryHandler();
featureQueryHandler.setDaoFactory(daoFactory);
featureQueryHandler.setI18NDAORepository(i18NDAORepository);
featureQueryHandler.setGeometryHandler(geometryHandler);
featureQueryHandler.setContentCacheController(contentCacheController);
daoFactory.setFeatureQueryHandler(featureQueryHandler);
daoFactory.setDecoderRepository(decoderRepository);
daoFactory.setEncoderRepository(encoderRepository);
daoFactory.setI18NDAORepository(i18NDAORepository);
daoFactory.setSweHelper(initSweHelper());
cacheFeeder.setConnectionProvider(holder);
cacheFeeder.setI18NDAORepository(i18NDAORepository);
cacheFeeder.setGeometryHandler(geometryHandler);
initEncoder();
initDecoder();
bindingRepository.setComponentFactories(Optional.empty());
bindingRepository.setComponents(Optional.empty());
additionalObservationCreatorRepository.setComponentFactories(Optional.empty());
additionalObservationCreatorRepository.setComponents(Optional.empty());
contentCacheController.setPersistenceStrategy(Mockito.mock(ContentCachePersistenceStrategy.class));
contentCacheController.setCacheFactory(Mockito.mock(ContentCacheFactory.class));
contentCacheController.setCompleteCacheUpdateFactory(Mockito.mock(CompleteCacheUpdateFactory.class));
contentCacheController.setCache(cache);
cache.setSupportedTypeRepository(Mockito.mock(SupportedTypeRepository.class));
i18NDAORepository.init();
decoderRepository.init();
converterRepository.init();
factoryRepository.init();
bindingRepository.init();
additionalObservationCreatorRepository.init();
DefaultContentModificationListener defaultContentModificationListener = new DefaultContentModificationListener(cacheFeeder, contentCacheController);
defaultContentModificationListener.setConverterRepository(converterRepository);
serviceEventBus.register(defaultContentModificationListener);
ctx = new HibernateProcedureCreationContext(serviceMetadataRepository, decoderRepository, factoryRepository, i18NDAORepository, daoFactory, converterRepository, null, bindingRepository, null, contentCacheController, Mockito.mock(ProcedureDescriptionSettings.class));
observationCtx = new OmObservationCreatorContext(serviceMetadataRepository, i18NDAORepository, daoFactory, new ProfileHanlderMock(), additionalObservationCreatorRepository, contentCacheController, featureQueryHandler, converterRepository, factoryRepository, geometryHandler, decoderRepository, null, bindingRepository);
observationCtx.setDefaultLanguage("eng");
Session session = null;
try {
session = getSession();
HibernateMetadataCache.init(session);
} finally {
returnSession(session);
}
initDaos();
}
Aggregations