use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class SummaryTestCase method reference_fields_can_be_part_of_summary_classes.
@Test
public void reference_fields_can_be_part_of_summary_classes() throws ParseException {
Search adSearch = buildCampaignAdModel();
SummaryClass defaultClass = new SummaryClass(adSearch, adSearch.getSummary("default"), new BaseDeployLogger());
assertEquals(SummaryClassField.Type.LONGSTRING, defaultClass.getField("campaign_ref").getType());
assertEquals(SummaryClassField.Type.LONGSTRING, defaultClass.getField("other_campaign_ref").getType());
SummaryClass myClass = new SummaryClass(adSearch, adSearch.getSummary("my_summary"), new BaseDeployLogger());
assertNull(myClass.getField("campaign_ref"));
assertEquals(SummaryClassField.Type.LONGSTRING, myClass.getField("other_campaign_ref").getType());
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class IntegerIndex2AttributeTestCase method testIntegerIndex2Attribute.
@Test
public void testIntegerIndex2Attribute() throws IOException, ParseException {
Search search = UnprocessingSearchBuilder.buildUnprocessedFromFile("src/test/examples/integerindex2attribute.sd");
search.process();
new IntegerIndex2Attribute(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles()).process(true);
SDField f;
f = search.getConcreteField("s1");
assertTrue(f.getAttributes().isEmpty());
assertTrue(f.existsIndex("s1"));
f = search.getConcreteField("s2");
assertEquals(f.getAttributes().size(), 1);
assertTrue(f.existsIndex("s2"));
f = search.getConcreteField("as1");
assertTrue(f.getAttributes().isEmpty());
assertTrue(f.existsIndex("as1"));
f = search.getConcreteField("as2");
assertEquals(f.getAttributes().size(), 1);
assertTrue(f.existsIndex("as2"));
f = search.getConcreteField("i1");
assertEquals(f.getAttributes().size(), 1);
assertTrue(!f.existsIndex("i1"));
f = search.getConcreteField("i2");
assertEquals(f.getAttributes().size(), 1);
assertTrue(!f.existsIndex("i2"));
f = search.getConcreteField("ai1");
assertEquals(search.getConcreteField("ai1").getAttributes().size(), 1);
assertTrue(!search.getConcreteField("ai1").existsIndex("ai1"));
f = search.getConcreteField("ai2");
assertEquals(f.getAttributes().size(), 1);
assertTrue(!f.existsIndex("ai2"));
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class ComponentValidatorTest method basicComponentValidation.
@Test
public void basicComponentValidation() throws Exception {
// Valid jar file
JarFile ok = new JarFile(new File(JARS_DIR + "ok.jar"));
ComponentValidator componentValidator = new ComponentValidator(ok);
componentValidator.validateAll(new BaseDeployLogger());
// No manifest
validateWithException("nomanifest.jar", "Non-existing or invalid manifest in " + JARS_DIR + "nomanifest.jar");
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class UserConfigBuilderTest method require_that_arrays_config_is_resolved.
@Test
public void require_that_arrays_config_is_resolved() throws ParserConfigurationException, IOException, SAXException {
Element configRoot = getDocument("<config name=\"arraytypes\">" + " <intarr operation=\"append\">13</intarr>" + " <intarr operation=\"append\">10</intarr>" + " <intarr operation=\"append\">1337</intarr>" + "</config>");
UserConfigRepo map = UserConfigBuilder.build(configRoot, configDefinitionStore, new BaseDeployLogger());
assertFalse(map.isEmpty());
ConfigDefinitionKey key = new ConfigDefinitionKey("arraytypes", "config");
assertNotNull(map.get(key));
ArraytypesConfig config = createConfig(ArraytypesConfig.class, map.get(key));
assertThat(config.intarr().size(), is(3));
assertThat(config.intarr(0), is(13));
assertThat(config.intarr(1), is(10));
assertThat(config.intarr(2), is(1337));
}
use of com.yahoo.config.model.application.provider.BaseDeployLogger in project vespa by vespa-engine.
the class UserConfigBuilderTest method require_that_simple_config_is_resolved.
@Test
public void require_that_simple_config_is_resolved() throws ParserConfigurationException, IOException, SAXException {
Element configRoot = getDocument("<config name=\"simpletypes\">" + " <intval>13</intval>" + "</config>" + "<config name=\"simpletypes\" version=\"1\">" + " <stringval>foolio</stringval>" + "</config>");
UserConfigRepo map = UserConfigBuilder.build(configRoot, configDefinitionStore, new BaseDeployLogger());
assertFalse(map.isEmpty());
ConfigDefinitionKey key = new ConfigDefinitionKey("simpletypes", "config");
assertNotNull(map.get(key));
SimpletypesConfig config = createConfig(SimpletypesConfig.class, map.get(key));
assertThat(config.intval(), is(13));
assertThat(config.stringval(), is("foolio"));
}
Aggregations