本文整理汇总了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");
}