|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.elca.el4j.tests.tcpforwarder.TcpForwarderTest
public class TcpForwarderTest
This class is a TestSuite for the TCP Forwarder Module. It tests 1) Wheter a store call to a database (using hibernate) is forwarded to the right port. 2) The Application Context can be created and the Dao retrieved with the connection to the database cut.
| Field Summary | |
|---|---|
private static String[] |
CONFIG_LOCATIONS
Config locations. |
(package private) static int |
DELAY
Delay between the single test steps (in milliseconds). |
(package private) static int |
DERBY_DEST_PORT
Port of the Derby database. |
(package private) static int |
INPUT_PORT
New input port -> Forwarder between INPUT_PORT and target port resp. |
private ConfigurableApplicationContext |
m_appContext
Application context to load beans. |
private ConvenienceGenericHibernateDao<Name,Integer> |
m_dao
Data Access Object. |
private TcpForwarder |
m_forwarder
The TCP Forwarder. |
private boolean |
m_isDB2
Are we executing the tests on a DB2 database? |
(package private) static int |
ORACLE_DEST_PORT
Port of the Oracle database. |
(package private) static String |
ORACLE_SERVER_NAME
Original domain name of the Oracle database server. |
private static org.slf4j.Logger |
s_logger
Private logger. |
| Constructor Summary | |
|---|---|
TcpForwarderTest()
|
|
| Method Summary | |
|---|---|
private void |
executeFirstInsert()
Execute store of data object to test database. |
private void |
executeSecondInsert()
Execute the second store, which is supposed to fail, because the TCP fowarder is unplugged. |
private void |
executeThirdInsert()
Execute third store to check if database connection works after we have plugged it again. |
private ApplicationContext |
getApplicationContext()
|
private ConvenienceGenericHibernateDao<Name,Integer> |
getDao()
|
void |
setUp()
|
void |
tearDown()
|
void |
testForwarder()
This test uses a tcp forwarder to connect to a databse and verifies that this connection has been established, then cuts the connection to the database and verifies that there is no connectivity to the database any more, then reconnects to the database again and tests whether the connection has been re-established. |
void |
testSpringWithoutDBConnection()
This test tries to start Spring when there is no connection to a database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final int DELAY
static final int INPUT_PORT
static final int DERBY_DEST_PORT
static final int ORACLE_DEST_PORT
static final String ORACLE_SERVER_NAME
private static final String[] CONFIG_LOCATIONS
private static org.slf4j.Logger s_logger
private ConfigurableApplicationContext m_appContext
private boolean m_isDB2
private TcpForwarder m_forwarder
private ConvenienceGenericHibernateDao<Name,Integer> m_dao
| Constructor Detail |
|---|
public TcpForwarderTest()
| Method Detail |
|---|
public void setUp()
public void tearDown()
public void testForwarder()
throws Exception
Exception
public void testSpringWithoutDBConnection()
throws Exception
Exceptionprivate ApplicationContext getApplicationContext()
private ConvenienceGenericHibernateDao<Name,Integer> getDao()
private void executeFirstInsert()
throws InterruptedException
InterruptedExceptionprivate void executeSecondInsert()
private void executeThirdInsert()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||