Search in sources :

Example 6 with DeployLogger

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"));
}
Also used : Level(java.util.logging.Level) DeployLogger(com.yahoo.config.application.api.DeployLogger) BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) JarFile(java.util.jar.JarFile) Test(org.junit.Test)

Example 7 with DeployLogger

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();
}
Also used : BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) DeployLogger(com.yahoo.config.application.api.DeployLogger) BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) FilesApplicationPackage(com.yahoo.config.model.application.provider.FilesApplicationPackage) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) FilesApplicationPackage(com.yahoo.config.model.application.provider.FilesApplicationPackage)

Example 8 with DeployLogger

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));
}
Also used : MockRoot(com.yahoo.config.model.test.MockRoot) DeployState(com.yahoo.config.model.deploy.DeployState) AbstractConfigProducer(com.yahoo.config.model.producer.AbstractConfigProducer) DeployLogger(com.yahoo.config.application.api.DeployLogger) ApplicationPackage(com.yahoo.config.application.api.ApplicationPackage) MockApplicationPackage(com.yahoo.config.model.test.MockApplicationPackage) Test(org.junit.Test)

Aggregations

DeployLogger (com.yahoo.config.application.api.DeployLogger)8 Slime (com.yahoo.slime.Slime)5 ApplicationId (com.yahoo.config.provision.ApplicationId)3 TenantName (com.yahoo.config.provision.TenantName)3 DeployHandlerLogger (com.yahoo.vespa.config.server.deploy.DeployHandlerLogger)3 ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)2 BaseDeployLogger (com.yahoo.config.model.application.provider.BaseDeployLogger)2 TimeoutBudget (com.yahoo.vespa.config.server.TimeoutBudget)2 Tenant (com.yahoo.vespa.config.server.tenant.Tenant)2 Test (org.junit.Test)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 ConfigChangeAction (com.yahoo.config.model.api.ConfigChangeAction)1 ModelContext (com.yahoo.config.model.api.ModelContext)1 ModelCreateResult (com.yahoo.config.model.api.ModelCreateResult)1 ServiceInfo (com.yahoo.config.model.api.ServiceInfo)1 com.yahoo.config.model.application.provider (com.yahoo.config.model.application.provider)1 FilesApplicationPackage (com.yahoo.config.model.application.provider.FilesApplicationPackage)1 DeployState (com.yahoo.config.model.deploy.DeployState)1 AbstractConfigProducer (com.yahoo.config.model.producer.AbstractConfigProducer)1 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)1