package at.kugel.tool.buildtray.action;
import java.net.URL;
import at.kugel.tool.buildtray.config.Config;
import at.kugel.tool.buildtray.config.IntegrationTestConfig;
import at.kugel.tool.buildtray.config.MultiConfig;
import at.kugel.tool.buildtray.config.ReloadingConfig;
import at.kugel.tool.buildtray.status.IntegrationStatus;
import at.kugel.tool.buildtray.status.IntegrationStatusResult;
public abstract class AbstractHtmlRegularExpressionActionsTestCase {
protected IntegrationTestConfig createConfig(String configPath) {
return new IntegrationTestConfig(new ReloadingConfig(configPath));
}
protected URL getTestDataUrl(String name) {
return getClass().getClassLoader().getResource(getClass().getPackage().getName().replace('.', '/') + '/' + name);
}
protected IntegrationStatusResult refreshWith(Config mockConfig) {
return refreshWith(new Config[] { mockConfig });
}
protected IntegrationStatusResult refreshWith(Config[] configs) {
IntegrationStatus mockStatusDisplay = new IntegrationStatus();
HtmlRegularExpressionActions action = new HtmlRegularExpressionActions(new MultiConfig(configs));
action.setStatusDisplay(mockStatusDisplay);
action.refresh();
return mockStatusDisplay.resultContainer;
}
}