Search in sources :

Example 1 with AdditionalObservationCreatorRepository

use of org.n52.sos.ds.hibernate.util.observation.AdditionalObservationCreatorRepository 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();
}
Also used : CompleteCacheUpdateFactory(org.n52.iceland.cache.ctrl.CompleteCacheUpdateFactory) GeometryHandler(org.n52.sos.util.GeometryHandler) OmObservationCreatorContext(org.n52.sos.ds.hibernate.util.observation.OmObservationCreatorContext) ContentCachePersistenceStrategy(org.n52.iceland.cache.ContentCachePersistenceStrategy) HibernateProcedureCreationContext(org.n52.sos.ds.hibernate.util.procedure.HibernateProcedureCreationContext) SupportedTypeRepository(org.n52.iceland.coding.SupportedTypeRepository) DefaultContentModificationListener(org.n52.sos.cache.ctrl.DefaultContentModificationListener) SOSHibernateSessionHolder(org.n52.series.db.da.sos.SOSHibernateSessionHolder) SosHelper(org.n52.sos.util.SosHelper) ContentCacheFactory(org.n52.iceland.cache.ctrl.ContentCacheFactory) SweHelper(org.n52.svalbard.util.SweHelper) Session(org.hibernate.Session)

Aggregations

Session (org.hibernate.Session)1 ContentCachePersistenceStrategy (org.n52.iceland.cache.ContentCachePersistenceStrategy)1 CompleteCacheUpdateFactory (org.n52.iceland.cache.ctrl.CompleteCacheUpdateFactory)1 ContentCacheFactory (org.n52.iceland.cache.ctrl.ContentCacheFactory)1 SupportedTypeRepository (org.n52.iceland.coding.SupportedTypeRepository)1 SOSHibernateSessionHolder (org.n52.series.db.da.sos.SOSHibernateSessionHolder)1 DefaultContentModificationListener (org.n52.sos.cache.ctrl.DefaultContentModificationListener)1 OmObservationCreatorContext (org.n52.sos.ds.hibernate.util.observation.OmObservationCreatorContext)1 HibernateProcedureCreationContext (org.n52.sos.ds.hibernate.util.procedure.HibernateProcedureCreationContext)1 GeometryHandler (org.n52.sos.util.GeometryHandler)1 SosHelper (org.n52.sos.util.SosHelper)1 SweHelper (org.n52.svalbard.util.SweHelper)1