@Test public void config() throws Exception { try ( ApplicationFacade app = new ApplicationFacade(Application.fromBuilder(new Application.Builder().container("default", new Application.Builder.Container() .documentProcessor("docproc", "default", MockDocproc.class) .config(new MockApplicationConfig(new MockApplicationConfig.Builder() .mystruct(new MockApplicationConfig.Mystruct.Builder().id("structid").value("structvalue")) .mystructlist(new MockApplicationConfig.Mystructlist.Builder().id("listid1").value("listvalue1")) .mystructlist(new MockApplicationConfig.Mystructlist.Builder().id("listid2").value("listvalue2")) .mylist("item1") .mylist("item2") .mymap("key1", "value1") .mymap("key2", "value2") .mymapstruct("key1", new MockApplicationConfig.Mymapstruct.Builder().id("mapid1").value("mapvalue1")) .mymapstruct("key2", new MockApplicationConfig.Mymapstruct.Builder().id("mapid2").value("mapvalue2"))))))) ) { MockDocproc docproc = (MockDocproc) app.getComponentById("docproc@default"); assertNotNull(docproc); assertEquals(docproc.getConfig().mystruct().id(), "structid"); assertEquals(docproc.getConfig().mystruct().value(), "structvalue"); assertEquals(docproc.getConfig().mystructlist().size(), 2); assertEquals(docproc.getConfig().mystructlist().get(0).id(), "listid1"); assertEquals(docproc.getConfig().mystructlist().get(0).value(), "listvalue1"); assertEquals(docproc.getConfig().mystructlist().get(1).id(), "listid2"); assertEquals(docproc.getConfig().mystructlist().get(1).value(), "listvalue2"); assertEquals(docproc.getConfig().mylist().size(), 2); assertEquals(docproc.getConfig().mylist().get(0), "item1"); assertEquals(docproc.getConfig().mylist().get(1), "item2"); assertEquals(docproc.getConfig().mymap().size(), 2); assertTrue(docproc.getConfig().mymap().containsKey("key1")); assertEquals(docproc.getConfig().mymap().get("key1"), "value1"); assertTrue(docproc.getConfig().mymap().containsKey("key2")); assertEquals(docproc.getConfig().mymap().get("key2"), "value2"); assertEquals(docproc.getConfig().mymapstruct().size(), 2); assertTrue(docproc.getConfig().mymapstruct().containsKey("key1")); assertEquals(docproc.getConfig().mymapstruct().get("key1").id(), "mapid1"); assertEquals(docproc.getConfig().mymapstruct().get("key1").value(), "mapvalue1"); assertTrue(docproc.getConfig().mymapstruct().containsKey("key2")); assertEquals(docproc.getConfig().mymapstruct().get("key2").id(), "mapid2"); assertEquals(docproc.getConfig().mymapstruct().get("key2").value(), "mapvalue2"); } }
@Beta public static Application fromBuilder(Builder builder) throws Exception { return builder.build(); }
Application implements AutoCloseable { @Beta public static Application fromBuilder(Builder builder) throws Exception { return builder.build(); } }
Application implements AutoCloseable { @Beta public static Application fromBuilder(Builder builder) throws Exception { return builder.build(); } Application(Path path, Networking networking, boolean deletePathWhenClosing); }
Application implements AutoCloseable { @Beta public static Application fromBuilder(Builder builder) throws Exception { return builder.build(); } Application(Path path, Networking networking, boolean deletePathWhenClosing); @Beta static Application fromBuilder(Builder builder); static Application fromServicesXml(String xml, Networking networking); static Application fromApplicationPackage(Path path, Networking networking); static Application fromApplicationPackage(File file, Networking networking); JDisc getJDisc(String id); @Override void close(); }
Application implements AutoCloseable { @Beta public static Application fromBuilder(Builder builder) throws Exception { return builder.build(); } Application(Path path, Networking networking, boolean deletePathWhenClosing); @Beta static Application fromBuilder(Builder builder); static Application fromServicesXml(String xml, Networking networking); static Application fromApplicationPackage(Path path, Networking networking); static Application fromApplicationPackage(File file, Networking networking); JDisc getJDisc(String id); @Override void close(); static final String vespaLocalProperty; }