use of com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg in project vespa by vespa-engine.
the class QrserverAndGatewayPortAllocationTest method testPorts.
@Test
public void testPorts() throws IOException, SAXException {
String appDir = "src/test/cfg/application/app_qrserverandgw/";
VespaModelCreatorWithFilePkg creator = new VespaModelCreatorWithFilePkg(appDir);
VespaModel vespaModel = creator.create();
List<Container> qrservers = vespaModel.getContainerClusters().get("container").getContainers();
assertThat(qrservers.size(), is(1));
assertThat(qrservers.get(0).getSearchPort(), is(Container.BASEPORT));
}
use of com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg in project vespa by vespa-engine.
the class SystemModelTestCase method getVespaModelDoNotValidateXml.
private static VespaModel getVespaModelDoNotValidateXml(String configPath) {
ConfigModelRegistry registry = MapConfigModelRegistry.createFromList(new SimpleConfigModel.Builder(), new ApiConfigModel.Builder());
VespaModelCreatorWithFilePkg creator = new VespaModelCreatorWithFilePkg(configPath, registry);
// do not validate against schema -- the xml files used here are not valid
return creator.create(false);
}
use of com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg in project vespa by vespa-engine.
the class NoPrefixForIndexesTest method requireThatPrefixIsIllegalForMixedAttributeAndIndexField.
@Test
public void requireThatPrefixIsIllegalForMixedAttributeAndIndexField() {
try {
new VespaModelCreatorWithFilePkg("src/test/cfg/application/validation/prefix_index_and_attribute/").create();
fail();
} catch (IllegalArgumentException e) {
assertEquals("For search 'simple', field 'artist': match/index:prefix is not supported for indexes.", e.getMessage());
}
}
use of com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg in project vespa by vespa-engine.
the class NoPrefixForIndexesTest method requireThatPrefixIsIllegalForIndexField.
@Test
public void requireThatPrefixIsIllegalForIndexField() {
try {
new VespaModelCreatorWithFilePkg("src/test/cfg/application/validation/prefix_index/").create();
fail();
} catch (IllegalArgumentException e) {
assertEquals("For search 'simple', field 'artist': match/index:prefix is not supported for indexes.", e.getMessage());
}
}
use of com.yahoo.vespa.model.test.utils.VespaModelCreatorWithFilePkg in project vespa by vespa-engine.
the class ContainerIncludeTest method included_file_with_xml_schema_violation.
@Test
public void included_file_with_xml_schema_violation() throws Exception {
try {
VespaModelCreatorWithFilePkg creator = new VespaModelCreatorWithFilePkg("src/test/cfg/container/data/include_xml_error/");
creator.create(true);
fail("Expected exception due to xml schema violation ('zearcer')");
} catch (IllegalArgumentException e) {
assertThat(e.getMessage(), containsString("XML error"));
assertThat(e.getMessage(), containsString("zearcer"));
}
}
Aggregations