use of com.yahoo.config.model.test.TestDriver in project vespa by vespa-engine.
the class MonitoringConfigSnoopTest method initRoot.
public void initRoot(int interval) throws Exception {
TestDriver tester = new TestDriver();
root = tester.buildModel(getAdminXml(interval) + getContent());
}
use of com.yahoo.config.model.test.TestDriver in project vespa by vespa-engine.
the class MonitoringConfigSnoopTest method correct_config_is_snooped_default_interval.
@Test
public void correct_config_is_snooped_default_interval() throws Exception {
String getAdminXmlIntervalNotSpecified = "<admin version='2.0'>" + " <adminserver hostalias='mockhost' />" + "</admin>";
TestDriver tester = new TestDriver();
root = tester.buildModel(getAdminXmlIntervalNotSpecified + getContent());
assertThat(getConfig().snapshot().periods().size(), is(2));
assertThat(getConfig().snapshot().periods(0), is(60));
assertThat(getConfig().snapshot().periods(1), is(300));
}
use of com.yahoo.config.model.test.TestDriver in project vespa by vespa-engine.
the class TldTest method requireThatServicesIsParsed.
@Test
public void requireThatServicesIsParsed() {
ApplicationPackage app = new MockApplicationPackage.Builder().withHosts("<hosts><host name='localhost'><alias>mockhost</alias></host><host name='my.other.host'><alias>mockhost2</alias></host></hosts>").withServices("<services>" + " <admin version='2.0'>" + " <adminserver hostalias='mockhost' />" + " </admin>" + " <jdisc version='1.0' id='default'>" + " <search />" + " <nodes>" + " <node hostalias='mockhost'/>" + " </nodes>" + " </jdisc>" + " <content version='1.0' id='foo'>" + " <redundancy>1</redundancy>" + " <documents>" + " <document type='music' mode='index'/>" + " </documents>" + " <group>" + " <node hostalias='mockhost' distribution-key='0'/>" + " <node hostalias='mockhost2' distribution-key='1'/>" + " </group>" + " <tuning>" + " <dispatch>" + " <max-hits-per-partition>69</max-hits-per-partition>" + " <use-local-node>true</use-local-node>" + " </dispatch>" + " </tuning>" + " </content>" + "</services>").withSearchDefinition(MockApplicationPackage.MUSIC_SEARCHDEFINITION).build();
PartitionsConfig.Builder builder = new PartitionsConfig.Builder();
new TestDriver(true).buildModel(app).getConfig(builder, "foo/search/cluster.foo/tlds/default.0.tld.0");
PartitionsConfig config = new PartitionsConfig(builder);
assertEquals(1, config.dataset().size());
assertEquals(69, config.dataset(0).maxhitspernode());
assertEquals(1, config.dataset(0).engine().size());
}
Aggregations