use of com.yahoo.config.application.api.DeployLogger in project vespa by vespa-engine.
the class ComponentValidatorTest method require_that_deploying_snapshot_bundle_gives_warning.
@Test
public void require_that_deploying_snapshot_bundle_gives_warning() throws IOException {
final StringBuffer buffer = new StringBuffer();
DeployLogger logger = new DeployLogger() {
@Override
public void log(Level level, String message) {
buffer.append(message).append('\n');
}
};
new ComponentValidator(new JarFile(JARS_DIR + "snapshot_bundle.jar")).validateAll(logger);
assertThat(buffer.toString(), containsString("Deploying snapshot bundle"));
}
use of com.yahoo.config.application.api.DeployLogger in project vespa by vespa-engine.
the class ApplicationPreprocessor method run.
public void run() throws IOException, TransformerException, ParserConfigurationException, SAXException {
DeployLogger logger = new BaseDeployLogger();
FilesApplicationPackage.Builder applicationPackageBuilder = new FilesApplicationPackage.Builder(applicationDir);
outputDir.ifPresent(applicationPackageBuilder::preprocessedDir);
ApplicationPackage preprocessed = applicationPackageBuilder.build().preprocess(new Zone(environment.orElse(Environment.defaultEnvironment()), region.orElse(RegionName.defaultName())), logger);
preprocessed.validateXML();
}
use of com.yahoo.config.application.api.DeployLogger in project vespa by vespa-engine.
the class ConfigModelContextTest method testConfigModelContext.
@Test
public void testConfigModelContext() {
AbstractConfigProducer root = new MockRoot();
String id = "foobar";
ApplicationPackage pkg = new MockApplicationPackage.Builder().withServices("<services version=\"1.0\"><admin version=\"2.0\" /></services>").build();
DeployState deployState = DeployState.createTestState(pkg);
DeployLogger logger = deployState.getDeployLogger();
ConfigModelContext ctx = ConfigModelContext.create(deployState, null, root, id);
assertThat(ctx.getApplicationPackage(), is(pkg));
assertThat(ctx.getProducerId(), is(id));
assertThat(ctx.getParentProducer(), is(root));
assertThat(ctx.getDeployLogger(), is(logger));
ctx = ConfigModelContext.create(null, root, id);
assertThat(ctx.getProducerId(), is(id));
assertThat(ctx.getParentProducer(), is(root));
AbstractConfigProducer newRoot = new MockRoot("bar");
ctx = ctx.withParent(newRoot);
assertThat(ctx.getProducerId(), is(id));
assertThat(ctx.getParentProducer(), is(not(root)));
assertThat(ctx.getParentProducer(), is(newRoot));
}
Aggregations