initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Axelor Business Solutions
|
||||
*
|
||||
* Copyright (C) 2019 Axelor (<http://axelor.com>).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License, version 3,
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.axelor.apps.contract.test;
|
||||
|
||||
import com.axelor.app.AppModule;
|
||||
import com.axelor.auth.AuthModule;
|
||||
import com.axelor.db.JpaModule;
|
||||
import com.axelor.rpc.ObjectMapperProvider;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.inject.AbstractModule;
|
||||
|
||||
public class TestModule extends AbstractModule {
|
||||
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(ObjectMapper.class).toProvider(ObjectMapperProvider.class);
|
||||
install(new JpaModule("testUnit", true, true));
|
||||
install(new AuthModule());
|
||||
install(new AppModule());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
|
||||
<persistence-unit name="testUnit" transaction-type="RESOURCE_LOCAL">
|
||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||
<exclude-unlisted-classes />
|
||||
<properties>
|
||||
|
||||
<!--
|
||||
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />
|
||||
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/testdb" />
|
||||
-->
|
||||
<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
|
||||
<property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:mem:test" />
|
||||
|
||||
<property name="javax.persistence.jdbc.user" value="sa" />
|
||||
<property name="javax.persistence.jdbc.password" value="" />
|
||||
|
||||
<!--
|
||||
value="create" to build a new database on each run;
|
||||
value="update" to modify an existing database;
|
||||
value="create-drop" means the same as "create" but also drops tables when Hibernate closes;
|
||||
value="validate" makes no changes to the database
|
||||
-->
|
||||
<property name="hibernate.hbm2ddl.auto" value="none" />
|
||||
|
||||
<!--
|
||||
<property name="hibernate.show_sql" value="true"/>
|
||||
-->
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
</persistence>
|
||||
@@ -0,0 +1,15 @@
|
||||
################################################################################
|
||||
# Application Configuration
|
||||
#
|
||||
# Note: This is an initial work. In future it will add more configuration
|
||||
# settings including database & log configuration.
|
||||
################################################################################
|
||||
|
||||
# Database settings
|
||||
# ~~~~~
|
||||
db.test.driver = org.postgresql.Driver
|
||||
db.test.ddl = none
|
||||
db.test.url = jdbc:postgresql://localhost:5432/abs
|
||||
db.test.user = axelor
|
||||
db.test.password = *******
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE xml>
|
||||
<configuration>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{40} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Log everything for axelor -->
|
||||
<logger name="com.axelor" level="debug" />
|
||||
|
||||
<!-- Good for troubleshooting hibernate issues -->
|
||||
<!-- <logger name="org.hibernate" level="info" /> -->
|
||||
|
||||
<!-- Log all SQL DML statements as they are executed -->
|
||||
<!-- <logger name="org.hibernate.SQL" level="debug" /> -->
|
||||
<!-- <logger name="org.hibernate.engine.jdbc" level="debug" /> -->
|
||||
|
||||
<!-- Log all SQL DDL statements as they are executed -->
|
||||
<!-- <logger name="org.hibernate.tool.hbm2ddl" level="info" /> -->
|
||||
|
||||
<!-- Log all JDBC parameters -->
|
||||
<!-- <logger name="org.hibernate.type" level="all" /> -->
|
||||
|
||||
<!-- Log transactions -->
|
||||
<!-- <logger name="org.hibernate.transaction" level="debug" /> -->
|
||||
|
||||
<!-- Log L2-Cache -->
|
||||
<!-- <logger name="org.hibernate.cache" level="debug" /> -->
|
||||
|
||||
<!-- Log JDBC resource acquisition -->
|
||||
<!-- <logger name="org.hibernate.jdbc" level="trace" /> -->
|
||||
<!-- <logger name="org.hibernate.service.jdbc" level="trace" /> -->
|
||||
|
||||
<!-- Log connection pooling -->
|
||||
<!-- <logger name="com.zaxxer.hikari" level="info" /> -->
|
||||
|
||||
<root level="error">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user