本文整理匯總了Java中org.audit4j.handler.db.DatabaseAuditHandler.setSeparate方法的典型用法代碼示例。如果您正苦於以下問題:Java DatabaseAuditHandler.setSeparate方法的具體用法?Java DatabaseAuditHandler.setSeparate怎麽用?Java DatabaseAuditHandler.setSeparate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.audit4j.handler.db.DatabaseAuditHandler
的用法示例。
在下文中一共展示了DatabaseAuditHandler.setSeparate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testRepositoryTag
import org.audit4j.handler.db.DatabaseAuditHandler; //導入方法依賴的package包/類
@Test
public void testRepositoryTag() {
handler = new DatabaseAuditHandler();
handler.setSeparate(true);
handler.init();
String actor = "Dummy Actor";
EventBuilder builder = new EventBuilder();
builder.addActor(actor).addAction("myMethod").addOrigin("Origin1")
.addField("myParam1Name", "param1").addField("myParam2Name", new Integer(2));
AuditEvent event = builder.build();
event.setRepository("test");
handler.setAuditEvent(event);
try {
handler.handle();
} catch (HandlerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
List<String> tables = getTableList();
assertTrue(tables.contains("TEST_AUDIT"));
assertTrue(getTableRecordCount("TEST_AUDIT") > 0);
System.out.println(getTableRecordCount("TEST_AUDIT"));
System.out.println("sd");
System.out.println(tables.toString());
dropTableIfExists("TEST_AUDIT");
}
示例2: testTestRepositoryPrefixAndSuffix
import org.audit4j.handler.db.DatabaseAuditHandler; //導入方法依賴的package包/類
@Test
public void testTestRepositoryPrefixAndSuffix() {
handler = new DatabaseAuditHandler();
handler.setSeparate(true);
handler.setTable_prefix("testprefix");
handler.setTable_suffix("testsuffix");
handler.init();
String actor = "Dummy Actor";
EventBuilder builder = new EventBuilder();
builder.addActor(actor).addAction("myMethod").addOrigin("Origin1")
.addField("myParam1Name", "param1").addField("myParam2Name", new Integer(2));
AuditEvent event = builder.build();
event.setRepository("test");
handler.setAuditEvent(event);
try {
handler.handle();
} catch (HandlerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
List<String> tables = getTableList();
System.out.println(tables.toString());
assertTrue(tables.contains("TESTPREFIX_TEST_TESTSUFFIX"));
assertTrue(getTableRecordCount("TESTPREFIX_TEST_TESTSUFFIX") > 0);
System.out.println(getTableRecordCount("TESTPREFIX_TEST_TESTSUFFIX"));
System.out.println("sd");
System.out.println(tables.toString());
dropTableIfExists("TESTPREFIX_TEST_TESTSUFFIX");
}