@Test public void basicTest() throws Exception { final String testStoreName = "TestStore"; final DOMSchemaService domSchemaService = mock(DOMSchemaService.class); doReturn(null).when(domSchemaService).registerSchemaContextListener(any(EffectiveModelContextListener.class)); final InMemoryDOMDataStore inMemoryDOMDataStore = InMemoryDOMDataStoreFactory.create(testStoreName, domSchemaService); assertNotNull(inMemoryDOMDataStore); assertEquals(testStoreName, inMemoryDOMDataStore.getIdentifier()); final DOMDataTreeChangeListener domDataTreeChangeListener = mock(DOMDataTreeChangeListener.class); doReturn("testListener").when(domDataTreeChangeListener).toString(); doNothing().when(domDataTreeChangeListener).onDataTreeChanged(any()); doNothing().when(domDataTreeChangeListener).onInitialData(); inMemoryDOMDataStore.onModelContextUpdated(TestModel.createTestContext()); inMemoryDOMDataStore.registerTreeChangeListener(YangInstanceIdentifier.empty(), domDataTreeChangeListener); final AutoCloseable autoCloseable = mock(AutoCloseable.class); doNothing().when(autoCloseable).close(); inMemoryDOMDataStore.setCloseable(autoCloseable); inMemoryDOMDataStore.close(); doThrow(UnsupportedOperationException.class).when(autoCloseable).close(); inMemoryDOMDataStore.close(); verify(autoCloseable, atLeast(2)).close(); }
public static InMemoryDOMDataStore create(final String name, final @Nullable DOMSchemaService schemaService) { return create(name, InMemoryDOMDataStoreConfigProperties.getDefault(), schemaService); }
InMemoryDOMDataStoreFactory { public static InMemoryDOMDataStore create(final String name, final @Nullable DOMSchemaService schemaService) { return create(name, InMemoryDOMDataStoreConfigProperties.getDefault(), schemaService); } }
InMemoryDOMDataStoreFactory { public static InMemoryDOMDataStore create(final String name, final @Nullable DOMSchemaService schemaService) { return create(name, InMemoryDOMDataStoreConfigProperties.getDefault(), schemaService); } private  InMemoryDOMDataStoreFactory(); }
InMemoryDOMDataStoreFactory { public static InMemoryDOMDataStore create(final String name, final @Nullable DOMSchemaService schemaService) { return create(name, InMemoryDOMDataStoreConfigProperties.getDefault(), schemaService); } private  InMemoryDOMDataStoreFactory(); static InMemoryDOMDataStore create(final String name, final @Nullable DOMSchemaService schemaService); static InMemoryDOMDataStore create(final String name, final InMemoryDOMDataStoreConfigProperties properties,
            @Nullable final DOMSchemaService schemaService); }
InMemoryDOMDataStoreFactory { public static InMemoryDOMDataStore create(final String name, final @Nullable DOMSchemaService schemaService) { return create(name, InMemoryDOMDataStoreConfigProperties.getDefault(), schemaService); } private  InMemoryDOMDataStoreFactory(); static InMemoryDOMDataStore create(final String name, final @Nullable DOMSchemaService schemaService); static InMemoryDOMDataStore create(final String name, final InMemoryDOMDataStoreConfigProperties properties,
            @Nullable final DOMSchemaService schemaService);  }