Search in sources :

Example 16 with BaseDeployLogger

use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.

the class FileSenderTest method require_that_fields_in_inner_maps_are_modified.

@Test
public void require_that_fields_in_inner_maps_are_modified() {
    def.structMapDef("inner").addFileDef("fileVal");
    def.structMapDef("inner").addStringDef("stringVal");
    ConfigPayloadBuilder inner = builder.getMap("inner").put("foo");
    inner.setField("fileVal", "bar.txt");
    inner.setField("stringVal", "bar.txt");
    service.pathToRef.put("bar.txt", new FileNode("barhash").value());
    FileSender.sendUserConfiguredFiles(producer, serviceList, new BaseDeployLogger());
    assertThat(builder.getMap("inner").get("foo").getObject("fileVal").getValue(), is("barhash"));
    assertThat(builder.getMap("inner").get("foo").getObject("stringVal").getValue(), is("bar.txt"));
}
Also used : BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) FileNode(com.yahoo.config.FileNode) Test(org.junit.Test)

Example 17 with BaseDeployLogger

use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.

the class FileSenderTest method require_that_structs_are_modified.

@Test
public void require_that_structs_are_modified() {
    def.structDef("struct").addFileDef("fileVal");
    def.structDef("struct").addStringDef("stringVal");
    builder.getObject("struct").setField("fileVal", "foo.txt");
    builder.getObject("struct").setField("stringVal", "foo.txt");
    service.pathToRef.put("foo.txt", new FileNode("foohash").value());
    FileSender.sendUserConfiguredFiles(producer, serviceList, new BaseDeployLogger());
    assertThat(builder.getObject("struct").getObject("fileVal").getValue(), is("foohash"));
    assertThat(builder.getObject("struct").getObject("stringVal").getValue(), is("foo.txt"));
}
Also used : BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) FileNode(com.yahoo.config.FileNode) Test(org.junit.Test)

Example 18 with BaseDeployLogger

use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.

the class FileSenderTest method require_that_simple_file_fields_are_modified.

@Test
public void require_that_simple_file_fields_are_modified() {
    def.addFileDef("fileVal");
    def.addStringDef("stringVal");
    builder.setField("fileVal", "foo.txt");
    builder.setField("stringVal", "foo.txt");
    service.pathToRef.put("foo.txt", new FileNode("fooshash").value());
    FileSender.sendUserConfiguredFiles(producer, serviceList, new BaseDeployLogger());
    assertThat(builder.getObject("fileVal").getValue(), is("fooshash"));
    assertThat(builder.getObject("stringVal").getValue(), is("foo.txt"));
}
Also used : BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) FileNode(com.yahoo.config.FileNode) Test(org.junit.Test)

Example 19 with BaseDeployLogger

use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.

the class SessionFactoryTest method require_that_session_can_be_created_from_existing.

@Test
public void require_that_session_can_be_created_from_existing() throws IOException {
    LocalSession session = getLocalSession();
    assertNotNull(session);
    assertThat(session.getSessionId(), is(2l));
    LocalSession session2 = factory.createSessionFromExisting(session, new BaseDeployLogger(), TimeoutBudgetTest.day());
    assertNotNull(session2);
    assertThat(session2.getSessionId(), is(3l));
}
Also used : BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) Test(org.junit.Test) CompressedApplicationInputStreamTest(com.yahoo.vespa.config.server.http.CompressedApplicationInputStreamTest)

Example 20 with BaseDeployLogger

use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.

the class TestDriver method validate.

private void validate(ApplicationPackage appPkg) throws IOException {
    if (!validate) {
        return;
    }
    SchemaValidators schemaValidators = new SchemaValidators(new Version(6), new BaseDeployLogger());
    if (appPkg.getHosts() != null) {
        schemaValidators.hostsXmlValidator().validate(appPkg.getHosts());
    }
    schemaValidators.servicesXmlValidator().validate(appPkg.getServices());
}
Also used : Version(com.yahoo.component.Version) BaseDeployLogger(com.yahoo.config.model.application.provider.BaseDeployLogger) SchemaValidators(com.yahoo.config.model.application.provider.SchemaValidators)

Aggregations

BaseDeployLogger (com.yahoo.config.model.application.provider.BaseDeployLogger)39 Test (org.junit.Test)30 Search (com.yahoo.searchdefinition.Search)12 QueryProfiles (com.yahoo.vespa.model.container.search.QueryProfiles)12 RankProfileRegistry (com.yahoo.searchdefinition.RankProfileRegistry)10 FileNode (com.yahoo.config.FileNode)8 SDDocumentType (com.yahoo.searchdefinition.document.SDDocumentType)7 QueryProfileRegistry (com.yahoo.search.query.profile.QueryProfileRegistry)6 SDField (com.yahoo.searchdefinition.document.SDField)6 UserConfigRepo (com.yahoo.config.model.producer.UserConfigRepo)4 ConfigDefinitionKey (com.yahoo.vespa.config.ConfigDefinitionKey)4 MockFileRegistry (com.yahoo.config.model.application.provider.MockFileRegistry)3 File (java.io.File)3 Iterator (java.util.Iterator)3 Element (org.w3c.dom.Element)3 Version (com.yahoo.component.Version)2 ApplicationPackage (com.yahoo.config.application.api.ApplicationPackage)2 DeployLogger (com.yahoo.config.application.api.DeployLogger)2 MockApplicationPackage (com.yahoo.config.model.test.MockApplicationPackage)2 RankProfile (com.yahoo.searchdefinition.RankProfile)2