init
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package com.eactive.eai.flowcontrol.jms;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.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.dao.DAOException;
|
||||
import com.eactive.eai.data.CommonJPATestConfiguration;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;
|
||||
|
||||
@DataJpaTest
|
||||
@ContextConfiguration(classes = { CommonJPATestConfiguration.class })
|
||||
@ComponentScan({ "com.eactive.eai.flowcontrol.jms" })
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.flowcontrol.jms" })
|
||||
@EntityScan({ "com.eactive.eai.data.entity.onl.flowcontrol.jms" })
|
||||
@Sql({ "/com/eactive/eai/flowcontrol/jms/init_tseaiqm02.sql" })
|
||||
class FCQueueReceiverDAOTest {
|
||||
|
||||
@Autowired
|
||||
FCQueueReceiverDAO fcQueueReceiverDAO;
|
||||
|
||||
// @Test
|
||||
// void getAllReceivers() throws DAOException {
|
||||
// // given
|
||||
//
|
||||
// // when
|
||||
// fcQueueReceiverDAO.getAllReceivers();
|
||||
//
|
||||
// // then
|
||||
// assertNotNull(fcQueueReceiverDAO.getAllReceivers());
|
||||
// assertTrue(fcQueueReceiverDAO.getAllReceivers().size() > 0);
|
||||
// }
|
||||
|
||||
@Test
|
||||
void getReceiver() throws DAOException {
|
||||
// given
|
||||
String queRcverName = "FlowRouterQueue_0101";
|
||||
|
||||
// when
|
||||
fcQueueReceiverDAO.getReceiver(queRcverName);
|
||||
|
||||
// then
|
||||
assertNotNull(fcQueueReceiverDAO.getReceiver(queRcverName));
|
||||
assertTrue(fcQueueReceiverDAO.getReceiver(queRcverName).getQueueName().length() > 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.eactive.eai.flowcontrol.jms;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
|
||||
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.boot.test.mock.mockito.MockBean;
|
||||
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.common.server.EAIServerManager;
|
||||
import com.eactive.eai.data.CommonJPATestConfiguration;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;;
|
||||
|
||||
@DataJpaTest
|
||||
@ContextConfiguration(classes = { CommonJPATestConfiguration.class })
|
||||
@ComponentScan({ "com.eactive.eai.flowcontrol.jms" })
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.flowcontrol.jms" })
|
||||
@EntityScan({ "com.eactive.eai.data.entity.onl.flowcontrol.jms" })
|
||||
@Sql({ "/com/eactive/eai/flowcontrol/jms/init_tseaiqm02.sql" })
|
||||
class FCQueueReceiverManagerTest {
|
||||
@Autowired
|
||||
FCQueueReceiverManager fcQueueReceiverManager;
|
||||
|
||||
@MockBean
|
||||
EAIServerManager eaiServerManager;
|
||||
|
||||
@Test
|
||||
void getAllReceivers() throws LifecycleException {
|
||||
// given
|
||||
given(eaiServerManager.getLocalServerName()).willReturn("fepSvr11");
|
||||
// when
|
||||
fcQueueReceiverManager.start();
|
||||
|
||||
// then
|
||||
assertNotNull(fcQueueReceiverManager.getAllFCQueueReceiverVos());
|
||||
assertTrue(fcQueueReceiverManager.getAllFCQueueReceiverVos().size() > 0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.eactive.eai.flowcontrol.jms;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
|
||||
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.boot.test.mock.mockito.MockBean;
|
||||
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.dao.DAOException;
|
||||
import com.eactive.eai.common.server.EAIServerManager;
|
||||
import com.eactive.eai.data.CommonJPATestConfiguration;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;
|
||||
|
||||
@DataJpaTest
|
||||
@ContextConfiguration(classes = { CommonJPATestConfiguration.class, EAIServerManager.class })
|
||||
@ComponentScan({ "com.eactive.eai.flowcontrol.jms" })
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.flowcontrol.jms" })
|
||||
@EntityScan({ "com.eactive.eai.data.entity.onl.flowcontrol.jms" })
|
||||
@Sql({ "/com/eactive/eai/flowcontrol/jms/init_tseaiqm01.sql" })
|
||||
class QueueMonitorDAOTest {
|
||||
|
||||
@Autowired
|
||||
QueueMonitorDAO queueMonitorDAO;
|
||||
|
||||
@MockBean
|
||||
EAIServerManager eaiServerManager;
|
||||
|
||||
@Test
|
||||
void getAllC2RServices() throws DAOException {
|
||||
// given
|
||||
given(eaiServerManager.getLocalServerName()).willReturn("fepSvr11");
|
||||
|
||||
// when
|
||||
queueMonitorDAO.getAllQueue();
|
||||
|
||||
// then
|
||||
assertNotNull(queueMonitorDAO.getAllQueue());
|
||||
assertTrue(queueMonitorDAO.getAllQueue().size() > 0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.eactive.eai.flowcontrol.jms;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
|
||||
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.boot.test.mock.mockito.MockBean;
|
||||
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.common.server.EAIServerManager;
|
||||
import com.eactive.eai.data.CommonJPATestConfiguration;
|
||||
import com.eactive.eai.data.jpa.BaseRepositoryImpl;;
|
||||
|
||||
@DataJpaTest
|
||||
@ContextConfiguration(classes = { CommonJPATestConfiguration.class, EAIServerManager.class })
|
||||
@ComponentScan({ "com.eactive.eai.flowcontrol.jms" })
|
||||
@EnableJpaRepositories(repositoryBaseClass = BaseRepositoryImpl.class, basePackages = {
|
||||
"com.eactive.eai.flowcontrol.jms" })
|
||||
@EntityScan({ "com.eactive.eai.data.entity.onl.flowcontrol.jms" })
|
||||
@Sql({ "/com/eactive/eai/flowcontrol/jms/init_tseaiqm01.sql" })
|
||||
class QueueMonitorManagerTest {
|
||||
|
||||
@Autowired
|
||||
QueueMonitorManager queueMonitorManager;
|
||||
|
||||
@MockBean
|
||||
EAIServerManager eaiServerManager;
|
||||
|
||||
@Test
|
||||
void getAllC2RServices() throws LifecycleException {
|
||||
// given
|
||||
given(eaiServerManager.getLocalServerName()).willReturn("fepSvr11");
|
||||
|
||||
// when
|
||||
queueMonitorManager.start();
|
||||
|
||||
// then
|
||||
assertNotNull(queueMonitorManager.getAllQueueMonitorVos());
|
||||
assertTrue(queueMonitorManager.getAllQueueMonitorVos().size() > 0);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user