init
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.eactive.eai.common.errorcode;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.jdbc.Sql;
|
||||
|
||||
import com.eactive.eai.common.lifecycle.LifecycleException;
|
||||
import com.eactive.eai.data.CoreJPATestConfiguration;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;
|
||||
|
||||
@DataJpaTest
|
||||
@ContextConfiguration(classes = { CoreJPATestConfiguration.class })
|
||||
@ComponentScan({ "com.eactive.eai.common.errorcode" })
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.common.errorcode" })
|
||||
@EntityScan({ "com.eactive.eai.data.entity.onl.errorcode" })
|
||||
@Sql({ "/com/eactive/eai/common/errorcode/init_tseaims01.sql" })
|
||||
class ErrorCodeManagerTest {
|
||||
|
||||
@Autowired
|
||||
ErrorCodeManager errorCodeManager;
|
||||
|
||||
@Test
|
||||
void testStart() throws LifecycleException {
|
||||
// given
|
||||
|
||||
// when
|
||||
errorCodeManager.start();
|
||||
|
||||
// then
|
||||
assertTrue(errorCodeManager.getAllCodeMessages().size() > 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.eactive.eai.common.server.loader;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
import com.eactive.eai.data.CoreJPATestConfiguration;
|
||||
import com.eactive.eai.data.entity.onl.server.EAIServer;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;
|
||||
|
||||
@DataJpaTest
|
||||
@ContextConfiguration(classes = CoreJPATestConfiguration.class)
|
||||
@ComponentScan("com.eactive.eai.common.server")
|
||||
@EntityScan("com.eactive.eai.data.entity.onl.server")
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.common.server" })
|
||||
class EAIServerEntityServiceTest {
|
||||
|
||||
@Autowired
|
||||
EAIServerLoader eaiServerEntityService;
|
||||
|
||||
@Test
|
||||
void testCheckConnection() {
|
||||
// given
|
||||
EAIServer eaiServer = new EAIServer();
|
||||
eaiServer.setEaisevrinstncname("test");
|
||||
eaiServer.setEaisevrip("test");
|
||||
eaiServerEntityService.save(eaiServer);
|
||||
|
||||
// when
|
||||
Boolean connected = eaiServerEntityService.checkConnection();
|
||||
// then
|
||||
assertThat(connected).isTrue();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.eactive.eai.data;
|
||||
|
||||
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
import com.eactive.eai.common.util.ApplicationContextProvider;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan({ "com.eactive.eai.data.property" })
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.data.property" })
|
||||
@EntityScan({ "com.eactive.eai.data.entity.onl.property" })
|
||||
public class CoreJPATestConfiguration {
|
||||
|
||||
@Bean
|
||||
ApplicationContextProvider applicationContextProvider() {
|
||||
return new ApplicationContextProvider();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
spring:
|
||||
jpa:
|
||||
properties:
|
||||
hibernate:
|
||||
format_sql: true
|
||||
hibernate:
|
||||
ddl-auto: update
|
||||
naming:
|
||||
physical-strategy: com.eactive.eai.data.jpa.CustomPhysicalNamingStrategy
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
logging:
|
||||
level:
|
||||
org:
|
||||
hibernate:
|
||||
type:
|
||||
descriptor:
|
||||
sql: trace
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
INSERT INTO tseaims01 (msg, msgctnt, treatmatrctnt) VALUES
|
||||
('ESBEAI000000', 'EAI처리성공', 'EAI처리성공'),
|
||||
('ESBEAI111111', 'EAI메시지 생성', 'EAI메시지생성'),
|
||||
('RDCEAIAAC018', '어댑터그룹등록 - {1}', '어댑터그룹등록'),
|
||||
('RDCEAIAHA004', '어댑터그룹[{1}], 어댑터[{2}]', '어댑터그룹'),
|
||||
('RDCEAIAHA013', 'HTTP POST 응답상태[{1}]', 'HTTPPOST응답'),
|
||||
('RDCEAIAHA014', 'HTTP GET 응답상태[{1}]', 'HTTPGET응답'),
|
||||
('RDCEAICLC205', '로드순번 음수에러 - {1}', '로드순번음수에러'),
|
||||
('RDCEAICLC208', '라이프사이클[{1}] 정지', '라이프사이클정지'),
|
||||
('RDCEAICNA001', '{1} {2} {3} {4} {5}', '소켓연결'),
|
||||
('RDCEAIINA001', '{1} {2} {3} {4} {5}', '소켓수신');
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
|
||||
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
|
||||
<hibernate-configuration>
|
||||
<session-factory name="">
|
||||
|
||||
<!-- Database connection settings -->
|
||||
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
|
||||
<property name="hibernate.connection.url">jdbc:postgresql://192.168.8.21:5433/eai</property>
|
||||
<property name="hibernate.connection.username">eai</property>
|
||||
<property name="hibernate.connection.password">eaiadmin</property>
|
||||
|
||||
<!-- Enable logging -->
|
||||
<property name="hibernate.show_sql">true</property>
|
||||
<property name="hibernate.format_sql">true</property>
|
||||
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
|
||||
|
||||
<mapping class="com.eactive.eai.dataa.property.PropGroup" />
|
||||
<mapping class="com.eactive.eai.datata.property.Prop" />
|
||||
<mapping class="com.eactive.eai.dataata.property.PropId" />
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
||||
Reference in New Issue
Block a user