use of org.apache.ignite.configuration.annotation.Name in project ignite-3 by apache.
the class DirectPropertiesTest method testNamedListDirectNestedInternalId.
/**
* Same as {@link #testDirectProperties} but checks Named List properties.
*/
@Test
public void testNamedListDirectNestedInternalId() throws Exception {
DirectConfiguration cfg = registry.getConfiguration(DirectConfiguration.KEY);
cfg.children().change(list -> list.create("foo", e -> e.changeChildren2(list2 -> list2.create("boo", e2 -> {
})))).get(1, TimeUnit.SECONDS);
UUID fooId = cfg.children().get("foo").id().value();
UUID booId = cfg.children().get("foo").children2().get("boo").id().value();
assertThat(booId, is(notNullValue()));
// Check all possible ways to access "str", just to be sure. Some of these checks are clearly excessive, but they look organic.
// Using names in both lists.
assertThat(directProxy(cfg).value().children().get("foo").children2().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(cfg).children().value().get("foo").children2().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(cfg).children().get("foo").value().children2().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(cfg).children().get("foo").children2().value().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(cfg).children().get("foo").children2().get("boo").value().id(), is(equalTo(booId)));
assertThat(directProxy(cfg).children().get("foo").children2().get("boo").id().value(), is(equalTo(booId)));
assertThat(directProxy(cfg.children()).value().get("foo").children2().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(cfg.children()).get("foo").value().children2().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(cfg.children()).get("foo").children2().value().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(cfg.children()).get("foo").children2().get("boo").value().id(), is(equalTo(booId)));
assertThat(directProxy(cfg.children()).get("foo").children2().get("boo").id().value(), is(equalTo(booId)));
assertThat(directProxy(cfg.children().get("foo")).value().children2().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(cfg.children().get("foo")).children2().value().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(cfg.children().get("foo")).children2().get("boo").value().id(), is(equalTo(booId)));
assertThat(directProxy(cfg.children().get("foo")).children2().get("boo").id().value(), is(equalTo(booId)));
assertThat(directProxy(cfg.children().get("foo").children2()).value().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(cfg.children().get("foo").children2()).get("boo").value().id(), is(equalTo(booId)));
assertThat(directProxy(cfg.children().get("foo").children2()).get("boo").id().value(), is(equalTo(booId)));
assertThat(directProxy(cfg.children().get("foo").children2().get("boo")).value().id(), is(equalTo(booId)));
assertThat(directProxy(cfg.children().get("foo").children2().get("boo")).id().value(), is(equalTo(booId)));
assertThat(directProxy(cfg.children().get("foo").children2().get("boo").id()).value(), is(equalTo(booId)));
// Using internalId and name.
assertThat(getByInternalId(directProxy(cfg).value().children(), fooId).children2().get("boo").id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg).children().value(), fooId).children2().get("boo").id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg).children(), fooId).value().children2().get("boo").id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg).children(), fooId).children2().value().get("boo").id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg).children(), fooId).children2().get("boo").value().id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg).children(), fooId).children2().get("boo").id().value(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children()).value(), fooId).children2().get("boo").id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children()), fooId).value().children2().get("boo").id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children()), fooId).children2().value().get("boo").id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children()), fooId).children2().get("boo").value().id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children()), fooId).children2().get("boo").id().value(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children(), fooId)).value().children2().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children(), fooId)).children2().value().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children(), fooId)).children2().get("boo").value().id(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children(), fooId)).children2().get("boo").id().value(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2()).value().get("boo").id(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2()).get("boo").value().id(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2()).get("boo").id().value(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2().get("boo")).value().id(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2().get("boo")).id().value(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2().get("boo").id()).value(), is(equalTo(booId)));
// Using name and internalId.
assertThat(getByInternalId(directProxy(cfg).value().children().get("foo").children2(), booId).id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg).children().value().get("foo").children2(), booId).id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg).children().get("foo").value().children2(), booId).id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg).children().get("foo").children2().value(), booId).id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg).children().get("foo").children2(), booId).value().id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg).children().get("foo").children2(), booId).id().value(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children()).value().get("foo").children2(), booId).id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children()).get("foo").value().children2(), booId).id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children()).get("foo").children2().value(), booId).id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children()).get("foo").children2(), booId).value().id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children()).get("foo").children2(), booId).id().value(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children().get("foo")).value().children2(), booId).id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children().get("foo")).children2().value(), booId).id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children().get("foo")).children2(), booId).value().id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children().get("foo")).children2(), booId).id().value(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children().get("foo").children2()).value(), booId).id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children().get("foo").children2()), booId).value().id(), is(equalTo(booId)));
assertThat(getByInternalId(directProxy(cfg.children().get("foo").children2()), booId).id().value(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children().get("foo").children2(), booId)).value().id(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children().get("foo").children2(), booId)).id().value(), is(equalTo(booId)));
assertThat(directProxy(getByInternalId(cfg.children().get("foo").children2(), booId).id()).value(), is(equalTo(booId)));
// Using internalId and internalId.
assertThat(getByInternalId(getByInternalId(directProxy(cfg).value().children(), fooId).children2(), booId).id(), is(booId));
assertThat(getByInternalId(getByInternalId(directProxy(cfg).children().value(), fooId).children2(), booId).id(), is(booId));
assertThat(getByInternalId(getByInternalId(directProxy(cfg).children(), fooId).value().children2(), booId).id(), is(booId));
assertThat(getByInternalId(getByInternalId(directProxy(cfg).children(), fooId).children2().value(), booId).id(), is(booId));
assertThat(getByInternalId(getByInternalId(directProxy(cfg).children(), fooId).children2(), booId).value().id(), is(booId));
assertThat(getByInternalId(getByInternalId(directProxy(cfg).children(), fooId).children2(), booId).id().value(), is(booId));
assertThat(getByInternalId(getByInternalId(directProxy(cfg.children()).value(), fooId).children2(), booId).id(), is(booId));
assertThat(getByInternalId(getByInternalId(directProxy(cfg.children()), fooId).value().children2(), booId).id(), is(booId));
assertThat(getByInternalId(getByInternalId(directProxy(cfg.children()), fooId).children2().value(), booId).id(), is(booId));
assertThat(getByInternalId(getByInternalId(directProxy(cfg.children()), fooId).children2(), booId).value().id(), is(booId));
assertThat(getByInternalId(getByInternalId(directProxy(cfg.children()), fooId).children2(), booId).id().value(), is(booId));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId)).value().children2(), booId).id(), is(booId));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId)).children2().value(), booId).id(), is(booId));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId)).children2(), booId).value().id(), is(booId));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId)).children2(), booId).id().value(), is(booId));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId).children2()).value(), booId).id(), is(booId));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId).children2()), booId).value().id(), is(booId));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId).children2()), booId).id().value(), is(booId));
assertThat(directProxy(getByInternalId(getByInternalId(cfg.children(), fooId).children2(), booId)).value().id(), is(booId));
assertThat(directProxy(getByInternalId(getByInternalId(cfg.children(), fooId).children2(), booId)).id().value(), is(booId));
assertThat(directProxy(getByInternalId(getByInternalId(cfg.children(), fooId).children2(), booId).id()).value(), is(booId));
}
use of org.apache.ignite.configuration.annotation.Name in project ignite-3 by apache.
the class DirectPropertiesTest method testNamedListDirectNestedProperties.
/**
* Same as {@link #testDirectProperties} but checks Named List properties.
*/
@Test
public void testNamedListDirectNestedProperties() throws Exception {
DirectConfiguration cfg = registry.getConfiguration(DirectConfiguration.KEY);
cfg.children().change(list -> list.create("foo", e -> e.changeChildren2(list2 -> list2.create("boo", e2 -> {
})))).get(1, TimeUnit.SECONDS);
UUID fooId = cfg.children().get("foo").id().value();
UUID booId = cfg.children().get("foo").children2().get("boo").id().value();
assertThat(booId, is(notNullValue()));
// Check all possible ways to access "str", just to be sure. Some of these checks are clearly excessive, but they look organic.
// Using names in both lists.
assertThat(directProxy(cfg).value().children().get("foo").children2().get("boo").str(), is("bar"));
assertThat(directProxy(cfg).children().value().get("foo").children2().get("boo").str(), is("bar"));
assertThat(directProxy(cfg).children().get("foo").value().children2().get("boo").str(), is("bar"));
assertThat(directProxy(cfg).children().get("foo").children2().value().get("boo").str(), is("bar"));
assertThat(directProxy(cfg).children().get("foo").children2().get("boo").value().str(), is("bar"));
assertThat(directProxy(cfg).children().get("foo").children2().get("boo").str().value(), is("bar"));
assertThat(directProxy(cfg.children()).value().get("foo").children2().get("boo").str(), is("bar"));
assertThat(directProxy(cfg.children()).get("foo").value().children2().get("boo").str(), is("bar"));
assertThat(directProxy(cfg.children()).get("foo").children2().value().get("boo").str(), is("bar"));
assertThat(directProxy(cfg.children()).get("foo").children2().get("boo").value().str(), is("bar"));
assertThat(directProxy(cfg.children()).get("foo").children2().get("boo").str().value(), is("bar"));
assertThat(directProxy(cfg.children().get("foo")).value().children2().get("boo").str(), is("bar"));
assertThat(directProxy(cfg.children().get("foo")).children2().value().get("boo").str(), is("bar"));
assertThat(directProxy(cfg.children().get("foo")).children2().get("boo").value().str(), is("bar"));
assertThat(directProxy(cfg.children().get("foo")).children2().get("boo").str().value(), is("bar"));
assertThat(directProxy(cfg.children().get("foo").children2()).value().get("boo").str(), is("bar"));
assertThat(directProxy(cfg.children().get("foo").children2()).get("boo").value().str(), is("bar"));
assertThat(directProxy(cfg.children().get("foo").children2()).get("boo").str().value(), is("bar"));
assertThat(directProxy(cfg.children().get("foo").children2().get("boo")).value().str(), is("bar"));
assertThat(directProxy(cfg.children().get("foo").children2().get("boo")).str().value(), is("bar"));
assertThat(directProxy(cfg.children().get("foo").children2().get("boo").str()).value(), is("bar"));
// Using internalId and name.
assertThat(getByInternalId(directProxy(cfg).value().children(), fooId).children2().get("boo").str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg).children().value(), fooId).children2().get("boo").str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg).children(), fooId).value().children2().get("boo").str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg).children(), fooId).children2().value().get("boo").str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg).children(), fooId).children2().get("boo").value().str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg).children(), fooId).children2().get("boo").str().value(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children()).value(), fooId).children2().get("boo").str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children()), fooId).value().children2().get("boo").str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children()), fooId).children2().value().get("boo").str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children()), fooId).children2().get("boo").value().str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children()), fooId).children2().get("boo").str().value(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children(), fooId)).value().children2().get("boo").str(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children(), fooId)).children2().value().get("boo").str(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children(), fooId)).children2().get("boo").value().str(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children(), fooId)).children2().get("boo").str().value(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2()).value().get("boo").str(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2()).get("boo").value().str(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2()).get("boo").str().value(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2().get("boo")).value().str(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2().get("boo")).str().value(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children(), fooId).children2().get("boo").str()).value(), is("bar"));
// Using name and internalId.
assertThat(getByInternalId(directProxy(cfg).value().children().get("foo").children2(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg).children().value().get("foo").children2(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg).children().get("foo").value().children2(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg).children().get("foo").children2().value(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg).children().get("foo").children2(), booId).value().str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg).children().get("foo").children2(), booId).str().value(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children()).value().get("foo").children2(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children()).get("foo").value().children2(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children()).get("foo").children2().value(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children()).get("foo").children2(), booId).value().str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children()).get("foo").children2(), booId).str().value(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children().get("foo")).value().children2(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children().get("foo")).children2().value(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children().get("foo")).children2(), booId).value().str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children().get("foo")).children2(), booId).str().value(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children().get("foo").children2()).value(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children().get("foo").children2()), booId).value().str(), is("bar"));
assertThat(getByInternalId(directProxy(cfg.children().get("foo").children2()), booId).str().value(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children().get("foo").children2(), booId)).value().str(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children().get("foo").children2(), booId)).str().value(), is("bar"));
assertThat(directProxy(getByInternalId(cfg.children().get("foo").children2(), booId).str()).value(), is("bar"));
// Using internalId and internalId.
assertThat(getByInternalId(getByInternalId(directProxy(cfg).value().children(), fooId).children2(), booId).str(), is("bar"));
assertThat(getByInternalId(getByInternalId(directProxy(cfg).children().value(), fooId).children2(), booId).str(), is("bar"));
assertThat(getByInternalId(getByInternalId(directProxy(cfg).children(), fooId).value().children2(), booId).str(), is("bar"));
assertThat(getByInternalId(getByInternalId(directProxy(cfg).children(), fooId).children2().value(), booId).str(), is("bar"));
assertThat(getByInternalId(getByInternalId(directProxy(cfg).children(), fooId).children2(), booId).value().str(), is("bar"));
assertThat(getByInternalId(getByInternalId(directProxy(cfg).children(), fooId).children2(), booId).str().value(), is("bar"));
assertThat(getByInternalId(getByInternalId(directProxy(cfg.children()).value(), fooId).children2(), booId).str(), is("bar"));
assertThat(getByInternalId(getByInternalId(directProxy(cfg.children()), fooId).value().children2(), booId).str(), is("bar"));
assertThat(getByInternalId(getByInternalId(directProxy(cfg.children()), fooId).children2().value(), booId).str(), is("bar"));
assertThat(getByInternalId(getByInternalId(directProxy(cfg.children()), fooId).children2(), booId).value().str(), is("bar"));
assertThat(getByInternalId(getByInternalId(directProxy(cfg.children()), fooId).children2(), booId).str().value(), is("bar"));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId)).value().children2(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId)).children2().value(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId)).children2(), booId).value().str(), is("bar"));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId)).children2(), booId).str().value(), is("bar"));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId).children2()).value(), booId).str(), is("bar"));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId).children2()), booId).value().str(), is("bar"));
assertThat(getByInternalId(directProxy(getByInternalId(cfg.children(), fooId).children2()), booId).str().value(), is("bar"));
assertThat(directProxy(getByInternalId(getByInternalId(cfg.children(), fooId).children2(), booId)).value().str(), is("bar"));
assertThat(directProxy(getByInternalId(getByInternalId(cfg.children(), fooId).children2(), booId)).str().value(), is("bar"));
assertThat(directProxy(getByInternalId(getByInternalId(cfg.children(), fooId).children2(), booId).str()).value(), is("bar"));
}
Aggregations