use of org.apache.ignite.spi.systemview.view.CacheGroupView in project ignite by apache.
the class SystemViewSelfTest method testCacheGroupsView.
/**
* Tests work of {@link SystemView} for cache groups.
*/
@Test
public void testCacheGroupsView() throws Exception {
try (IgniteEx g = startGrid()) {
Set<String> grpNames = new HashSet<>(Arrays.asList("grp-1", "grp-2"));
for (String grpName : grpNames) g.createCache(new CacheConfiguration<>("cache-" + grpName).setGroupName(grpName));
SystemView<CacheGroupView> grps = g.context().systemView().view(CACHE_GRPS_VIEW);
assertEquals(g.context().cache().cacheGroupDescriptors().size(), F.size(grps.iterator()));
for (CacheGroupView row : grps) grpNames.remove(row.cacheGroupName());
assertTrue(grpNames.toString(), grpNames.isEmpty());
}
}
Aggregations