Skip to content
Snippets Groups Projects
Commit dbba98f7 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

Fixing SBGNML tests

parent f45d4a8e
No related branches found
No related tags found
2 merge requests!630WIP: Resolve "The privileges of a new user are not saved in some cases",!499Spring config update
Pipeline #7309 failed
......@@ -20,11 +20,7 @@ import lcsb.mapviewer.persist.DbUtils;
import lcsb.mapviewer.persist.dao.map.ModelDao;
@Transactional
@ContextConfiguration(locations = { "/applicationContext-persist.xml",
"/test-applicationContext.xml",
"/test-dataSource.xml",
})
@ContextConfiguration(classes = SpringSBGNMLConverterTestConfig.class)
@RunWith(SpringJUnit4ClassRunner.class)
public class DbSerializationTest {
@Autowired
......
package lcsb.mapviewer.converter.model.sbgnml;
import lcsb.mapviewer.persist.SpringPersistConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
@Configuration
@Import({SpringPersistConfig.class})
public class SpringSBGNMLConverterTestConfig {
@Bean
public NoOpPasswordEncoder passwordEncoder() {
return (NoOpPasswordEncoder) NoOpPasswordEncoder.getInstance();
}
}
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<!-- Testing Password Encoder used for hashing passwords -->
<bean id="PasswordEncoder" class="org.springframework.security.crypto.password.NoOpPasswordEncoder"/>
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<context:property-placeholder
ignore-resource-not-found="true"
location="classpath:test-db.properties,file:/etc/minerva/test-db.properties" />
<!-- Data Source Declaration -->
<bean id="DataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="driverClass" value="org.postgresql.Driver" />
<property name="jdbcUrl" value="${database.uri}" />
<property name="user" value="${database.username}" />
<property name="password" value="${database.password}" />
<property name="maxPoolSize" value="90" />
<property name="maxStatements" value="5" />
<property name="minPoolSize" value="5" />
</bean>
<bean id="DbInit" class="lcsb.mapviewer.persist.CustomDatabasePopulator">
<property name="dataSource"><ref bean="DataSource"/></property>
</bean>
<bean id="startupScripts" class="org.springframework.jdbc.datasource.init.DataSourceInitializer">
<property name="dataSource"><ref bean="DataSource"/></property>
<property name="databasePopulator"><ref bean="DbInit"/></property>
<property name="enabled" value="true"/>
</bean>
</beans>
database.uri=jdbc:postgresql://localhost:5432/map_viewer
database.username=map_viewer
database.password=123qweasdzxc
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment