Java源码示例:org.audit4j.core.layout.Layout
示例1
/**
* Run the Layout getLayout() method test.
*
* @throws Exception the exception
* @generatedBy CodePro at 2/4/15 9:28 AM
*/
@Test
public void testGetLayout_1()
throws Exception {
ConcurrentConfigurationContext fixture = new ConcurrentConfigurationContext();
fixture.setMetaData(new DummyMetaData());
fixture.setRunStatus(RunStatus.DISABLED);
fixture.setLayout(new SimpleLayout());
fixture.addFilter((AuditEventFilter) null);
fixture.addHandler(new ConsoleAuditHandler());
Layout result = fixture.getLayout();
// add additional test code here
assertNotNull(result);
}
示例2
/**
* Run the void setLayout(Layout) method test.
*
* @throws Exception the exception
* @generatedBy CodePro at 2/4/15 9:28 AM
*/
@Test
public void testSetLayout_1()
throws Exception {
ConcurrentConfigurationContext fixture = new ConcurrentConfigurationContext();
fixture.setMetaData(new DummyMetaData());
fixture.setRunStatus(RunStatus.DISABLED);
fixture.setLayout(new SimpleLayout());
fixture.addFilter((AuditEventFilter) null);
fixture.addHandler(new ConsoleAuditHandler());
Layout layout = new SimpleLayout();
fixture.setLayout(layout);
// add additional test code here
}
示例3
private Layout getLayout() {
//CustomizableLayout layout = new CustomizableLayout();
//layout.setTemplate("${eventDate}|${uuid}|actor=${actor}|${action}|origin=${origin} => ${foreach fields field}${field.name} ${field.type}:${field.value}, ${end}");
//return layout;
return new SimpleLayout();
}
示例4
private Layout getLayout() {
//CustomizableLayout layout = new CustomizableLayout();
//layout.setTemplate("${eventDate}|${uuid}|actor=${actor}|${action}|origin=${origin} => ${foreach fields field}${field.name} ${field.type}:${field.value}, ${end}");
//return layout;
return new SimpleLayout();
}
示例5
/**
* Load config.
*
* @param servletContext
* the servlet context
* @return the configuration
*/
Configuration loadConfig(ServletContext servletContext) {
String handlers = servletContext.getInitParameter(ContextConfigParams.PARAM_HANDLERS);
String layout = servletContext.getInitParameter(ContextConfigParams.PARAM_LAYOUT);
String filters = servletContext.getInitParameter(ContextConfigParams.PARAM_FILTERS);
String options = servletContext.getInitParameter(ContextConfigParams.PARAM_OPTIONS);
String metaData = servletContext.getInitParameter(ContextConfigParams.PARAM_META_DATA);
String properties = servletContext.getInitParameter(ContextConfigParams.PARAM_PROPERTIES);
Configuration config = Configuration.INSTANCE;
if (handlers != null && !handlers.equals("")) {
config.setHandlers(new ReflectUtil<Handler>().getNewInstanceList(handlers.split(";")));
}
config.setLayout(new ReflectUtil<Layout>().getNewInstance(layout));
if (filters != null && !filters.equals("")) {
config.setFilters(new ReflectUtil<AuditEventFilter>().getNewInstanceList(filters.split(";")));
}
config.setCommands(options);
config.setMetaData(new ReflectUtil<MetaData>().getNewInstance(metaData));
if (properties != null && !properties.equals("")) {
String[] propertiesList = properties.split(";");
for (String property : propertiesList) {
String[] keyValue = property.split(":");
config.addProperty(keyValue[0], keyValue[1]);
}
}
return config;
}
示例6
private Layout getLayout() {
CustomizableLayout layout = new CustomizableLayout();
layout.setTemplate("${eventDate}|gg|${uuid}|${actor}|${action}|${origin} => ${foreach fields field}[${field.name}:${field.value}]${end}");
return layout;
}
示例7
public GivenSomeState audit4j_starting_with_a_programming_configuration_using_ConsoleAuditHandler_with_layout(Layout layout) {
Configuration configuration = getConfigurationForConsoleHandler();
configuration.setLayout(layout);
AuditManager.startWithConfiguration(configuration);
return self();
}
示例8
/**
* Gets the layout.
*
* @return the layout
*/
public Layout getLayout() {
return layout;
}
示例9
/**
* Sets the layout.
*
* @param layout
* the new layout
*/
public void setLayout(Layout layout) {
this.layout = layout;
}
示例10
/**
* Gets the layout.
*
* @return the layout
*/
public Layout getLayout() {
return layout;
}
示例11
/**
* Sets the layout.
*
* @param layout
* the new layout
*/
public void setLayout(Layout layout) {
this.layout = layout;
}
示例12
/**
* Sets the layout.
*
* @param layout
* the new layout
*/
public void setLayout(Layout layout) {
this.layout = layout;
}