use of org.jmeterplugins.repository.plugins.PluginSuggester in project jmeter-plugins-manager by undera.
the class LoggerAppenderTest method testFlow.
@Test
public void testFlow() throws Exception {
PluginManager pmgr = new PluginManager();
LoggerAppender appender = new LoggerAppender("test-appender", pmgr);
PluginSuggester suggester = new PluginSuggester(pmgr);
appender.setSuggester(suggester);
assertEquals(suggester, appender.getSuggester());
Log4jLogEvent.Builder builder = Log4jLogEvent.newBuilder();
builder.setMessage(new MessageFormatMessage("Save file"));
builder.setLoggerName("SaveService");
appender.append(builder.build());
LoggerAppender.SaveServiceFilter filter = new LoggerAppender.SaveServiceFilter(Filter.Result.ACCEPT, Filter.Result.DENY);
assertEquals(Filter.Result.ACCEPT, filter.filter(builder.build()));
builder.setLoggerName("SomeLogger");
assertEquals(Filter.Result.DENY, filter.filter(builder.build()));
}
use of org.jmeterplugins.repository.plugins.PluginSuggester in project jmeter-plugins-manager by undera.
the class PluginManagerCMD method installPluginsForJmx.
protected void installPluginsForJmx(ListIterator jmxFilesIterator) throws Throwable {
if (!jmxFilesIterator.hasNext()) {
throw new IllegalArgumentException("No jmx files specified");
}
String files = jmxFilesIterator.next().toString();
PluginManager mgr = getPluginsManager();
PluginSuggester suggester = new PluginSuggester(mgr);
final Set<Plugin> pluginsToInstall = new HashSet<>();
Set<String> jmxFiles = parseParams(files).keySet();
for (String jmxPath : jmxFiles) {
pluginsToInstall.addAll(suggester.analyzeTestPlan(jmxPath));
}
mgr.togglePlugins(pluginsToInstall, true);
mgr.applyChanges(this, false, null);
}
use of org.jmeterplugins.repository.plugins.PluginSuggester in project jmeter-plugins-manager by undera.
the class LoggerPanelWrappingTest method testFlow.
@Test
public void testFlow() throws Exception {
if (!GraphicsEnvironment.getLocalGraphicsEnvironment().isHeadlessInstance()) {
PluginManager pmgr = new PluginManager();
LoggerPanelWrapping wrapping = new LoggerPanelWrapping(pmgr);
PluginSuggester suggester = new PluginSuggester(pmgr);
wrapping.setSuggester(suggester);
assertEquals(suggester, wrapping.getSuggester());
LogEvent event = new LogEvent();
event.setCategory("SaveService");
event.setMessage("Save File");
wrapping.processEvent(event);
}
}
Aggregations