Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotCacheDbSqlSessionFactoryIfNotConfigured()
        public virtual void shouldNotCacheDbSqlSessionFactoryIfNotConfigured()
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final TestEngineCfg cfg = new TestEngineCfg();
            TestEngineCfg cfg = new TestEngineCfg();

            // if
            cfg.initSqlSessionFactory();

            // then
            assertNull(ProcessEngineConfigurationImpl.cachedSqlSessionFactory);
            assertNotNull(cfg.SqlSessionFactory);
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotReuseCachedSqlSessionIfNotConfigured()
        public virtual void shouldNotReuseCachedSqlSessionIfNotConfigured()
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final TestEngineCfg cfg = new TestEngineCfg();
            TestEngineCfg     cfg = new TestEngineCfg();
            SqlSessionFactory existingSessionFactory = mock(typeof(SqlSessionFactory));

            // given
            ProcessEngineConfigurationImpl.cachedSqlSessionFactory = existingSessionFactory;

            // if
            cfg.initSqlSessionFactory();

            // then
            assertSame(existingSessionFactory, ProcessEngineConfigurationImpl.cachedSqlSessionFactory);
            assertNotSame(existingSessionFactory, cfg.SqlSessionFactory);
        }