Search in sources :

Example 1 with LogEntry

use of com.ctrip.platform.dal.dao.client.LogEntry in project dal by ctripcorp.

the class DalConnectionTest method testGetMeta.

@Test
public void testGetMeta() throws SQLException {
    Connection conn = null;
    try {
        DalConnection test = getConnection();
        assertNotNull(test.getMeta());
        LogEntry entry = new LogEntry();
        assertNotNull(test.getMeta());
        test.getMeta().populate(entry);
        assertNotNull(test.getMeta());
    } catch (Throwable e) {
        fail();
        e.printStackTrace();
    } finally {
        if (conn != null)
            conn.close();
    }
}
Also used : DalConnection(com.ctrip.platform.dal.dao.client.DalConnection) Connection(java.sql.Connection) DalConnection(com.ctrip.platform.dal.dao.client.DalConnection) LogEntry(com.ctrip.platform.dal.dao.client.LogEntry) Test(org.junit.Test)

Example 2 with LogEntry

use of com.ctrip.platform.dal.dao.client.LogEntry in project dal by ctripcorp.

the class LogEntryTest method testGetCallerInShort.

@Test
public void testGetCallerInShort() {
    LogEntry test = new LogEntry();
    assertEquals("NativeMethodAccessorImpl.invoke", test.getCallerInShort());
}
Also used : LogEntry(com.ctrip.platform.dal.dao.client.LogEntry) Test(org.junit.Test)

Example 3 with LogEntry

use of com.ctrip.platform.dal.dao.client.LogEntry in project dal by ctripcorp.

the class LogEntryTest method testGetCallerInShortPopulate.

@Test
public void testGetCallerInShortPopulate() {
    LogEntry.populateCurrentCaller("test.com.ctrip.platform.dal.dao.client.LogEntryTest.testGetCallerInShortPopulate");
    LogEntry test = new LogEntry();
    assertEquals("LogEntryTest.testGetCallerInShortPopulate", test.getCallerInShort());
    LogEntry.clearCurrentCaller();
    assertEquals("NativeMethodAccessorImpl.invoke", test.getCallerInShort());
}
Also used : LogEntry(com.ctrip.platform.dal.dao.client.LogEntry) Test(org.junit.Test)

Aggregations

LogEntry (com.ctrip.platform.dal.dao.client.LogEntry)3 Test (org.junit.Test)3 DalConnection (com.ctrip.platform.dal.dao.client.DalConnection)1 Connection (java.sql.Connection)1