diff --git a/core/api/src/test/java/org/onosproject/store/service/ConsistentMapAdapter.java b/core/api/src/test/java/org/onosproject/store/service/ConsistentMapAdapter.java
new file mode 100644
index 0000000..e6df572
--- /dev/null
+++ b/core/api/src/test/java/org/onosproject/store/service/ConsistentMapAdapter.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.store.service;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.function.Predicate;
+
+/**
+ * Testing adapter for the consistent map.
+ */
+public class ConsistentMapAdapter<K, V> implements ConsistentMap<K, V> {
+    @Override
+    public int size() {
+        return 0;
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return false;
+    }
+
+    @Override
+    public boolean containsKey(K key) {
+        return false;
+    }
+
+    @Override
+    public boolean containsValue(V value) {
+        return false;
+    }
+
+    @Override
+    public Versioned<V> get(K key) {
+        return null;
+    }
+
+    @Override
+    public Versioned<V> computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
+        return null;
+    }
+
+    @Override
+    public Versioned<V> compute(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
+        return null;
+    }
+
+    @Override
+    public Versioned<V> computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
+        return null;
+    }
+
+    @Override
+    public Versioned<V> computeIf(K key, Predicate<? super V> condition,
+                                  BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
+        return null;
+    }
+
+    @Override
+    public Versioned<V> put(K key, V value) {
+        return null;
+    }
+
+    @Override
+    public Versioned<V> putAndGet(K key, V value) {
+        return null;
+    }
+
+    @Override
+    public Versioned<V> remove(K key) {
+        return null;
+    }
+
+    @Override
+    public void clear() {
+
+    }
+
+    @Override
+    public Set<K> keySet() {
+        return null;
+    }
+
+    @Override
+    public Collection<Versioned<V>> values() {
+        return null;
+    }
+
+    @Override
+    public Set<Map.Entry<K, Versioned<V>>> entrySet() {
+        return null;
+    }
+
+    @Override
+    public Versioned<V> putIfAbsent(K key, V value) {
+        return null;
+    }
+
+    @Override
+    public boolean remove(K key, V value) {
+        return false;
+    }
+
+    @Override
+    public boolean remove(K key, long version) {
+        return false;
+    }
+
+    @Override
+    public boolean replace(K key, V oldValue, V newValue) {
+        return false;
+    }
+
+    @Override
+    public boolean replace(K key, long oldVersion, V newValue) {
+        return false;
+    }
+
+    @Override
+    public void addListener(MapEventListener<K, V> listener) {
+
+    }
+
+    @Override
+    public void removeListener(MapEventListener<K, V> listener) {
+
+    }
+}
diff --git a/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java b/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java
new file mode 100644
index 0000000..1494b8a
--- /dev/null
+++ b/core/api/src/test/java/org/onosproject/store/service/TestConsistentMap.java
@@ -0,0 +1,261 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.store.service;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
+import org.onosproject.core.ApplicationId;
+import static org.onosproject.store.service.MapEvent.Type;
+import static org.onosproject.store.service.MapEvent.Type.*;
+
+/**
+ * Test implementation of the consistent map.
+ */
+public final class TestConsistentMap<K, V> extends ConsistentMapAdapter<K, V> {
+
+    private final List<MapEventListener<K, V>> listeners;
+    private final HashMap<K, V> map;
+    private final String mapName;
+
+    private TestConsistentMap(String mapName) {
+        map = new HashMap<>();
+        listeners = new LinkedList<>();
+        this.mapName = mapName;
+    }
+
+    private Versioned<V> version(V v) {
+        return new Versioned<>(v, 1, System.currentTimeMillis());
+    }
+
+    /**
+     * Notify all listeners of an event.
+     */
+    private void notifyListeners(String mapName, Type type,
+                                 K key, Versioned<V> value) {
+        MapEvent<K, V> event = new MapEvent<>(mapName, type, key, value);
+        listeners.forEach(
+                listener -> listener.event(event)
+        );
+    }
+
+    @Override
+    public int size() {
+        return map.size();
+    }
+
+    @Override
+    public boolean isEmpty() {
+        return map.isEmpty();
+    }
+
+    @Override
+    public boolean containsKey(K key) {
+        return map.containsKey(key);
+    }
+
+    @Override
+    public boolean containsValue(V value) {
+        return map.containsValue(value);
+    }
+
+    @Override
+    public Versioned<V> get(K key) {
+        return version(map.get(key));
+    }
+
+    @Override
+    public Versioned<V> computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) {
+        Versioned<V> result = version(map.computeIfAbsent(key, mappingFunction));
+        notifyListeners(mapName, INSERT, key, result);
+        return result;
+    }
+
+    @Override
+    public Versioned<V> compute(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
+        return version(map.compute(key, remappingFunction));
+    }
+
+    @Override
+    public Versioned<V> computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
+        return version(map.computeIfPresent(key, remappingFunction));
+    }
+
+    @Override
+    public Versioned<V> computeIf(K key, Predicate<? super V> condition,
+                                  BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
+        return null;
+    }
+
+    @Override
+    public Versioned<V> put(K key, V value) {
+        Versioned<V> result = version(map.put(key, value));
+        notifyListeners(mapName, INSERT, key, result);
+        return result;
+    }
+
+    @Override
+    public Versioned<V> putAndGet(K key, V value) {
+        Versioned<V> result = version(map.put(key, value));
+        notifyListeners(mapName, UPDATE, key, result);
+        return result;
+    }
+
+    @Override
+    public Versioned<V> remove(K key) {
+        Versioned<V> result = version(map.remove(key));
+        notifyListeners(mapName, REMOVE, key, result);
+        return result;
+    }
+
+    @Override
+    public void clear() {
+        map.clear();
+    }
+
+    @Override
+    public Set<K> keySet() {
+        return map.keySet();
+    }
+
+    @Override
+    public Collection<Versioned<V>> values() {
+        return map
+                .values()
+                .stream()
+                .map(this::version)
+                .collect(Collectors.toList());
+    }
+
+    @Override
+    public Set<Map.Entry<K, Versioned<V>>> entrySet() {
+        return super.entrySet();
+    }
+
+    @Override
+    public Versioned<V> putIfAbsent(K key, V value) {
+        Versioned<V> result =  version(map.putIfAbsent(key, value));
+        if (map.get(key).equals(value)) {
+            notifyListeners(mapName, INSERT, key, result);
+        }
+        return result;
+    }
+
+    @Override
+    public boolean remove(K key, V value) {
+        boolean removed = map.remove(key, value);
+        if (removed) {
+            notifyListeners(mapName, REMOVE, key, null);
+        }
+        return removed;
+    }
+
+    @Override
+    public boolean remove(K key, long version) {
+        boolean removed =  map.remove(key, version);
+        if (removed) {
+            notifyListeners(mapName, REMOVE, key, null);
+        }
+        return removed;
+    }
+
+    @Override
+    public boolean replace(K key, V oldValue, V newValue) {
+        boolean replaced = map.replace(key, oldValue, newValue);
+        if (replaced) {
+            notifyListeners(mapName, REMOVE, key, null);
+        }
+        return replaced;
+    }
+
+    @Override
+    public boolean replace(K key, long oldVersion, V newValue) {
+        boolean replaced =  map.replace(key, map.get(key), newValue);
+        if (replaced) {
+            notifyListeners(mapName, REMOVE, key, null);
+        }
+        return replaced;
+    }
+
+    @Override
+    public void addListener(MapEventListener<K, V> listener) {
+        listeners.add(listener);
+    }
+
+    @Override
+    public void removeListener(MapEventListener<K, V> listener) {
+        listeners.remove(listener);
+    }
+
+    public static Builder builder() {
+        return new Builder();
+    }
+
+    public static class Builder<K, V> implements ConsistentMapBuilder<K, V> {
+        String mapName = "map";
+
+        @Override
+        public ConsistentMapBuilder<K, V> withName(String mapName) {
+            this.mapName = mapName;
+            return this;
+        }
+
+        @Override
+        public ConsistentMapBuilder<K, V> withApplicationId(ApplicationId id) {
+            return this;
+        }
+
+        @Override
+        public ConsistentMapBuilder<K, V> withSerializer(Serializer serializer) {
+            return this;
+        }
+
+        @Override
+        public ConsistentMapBuilder<K, V> withPartitionsDisabled() {
+            return this;
+        }
+
+        @Override
+        public ConsistentMapBuilder<K, V> withUpdatesDisabled() {
+            return this;
+        }
+
+        @Override
+        public ConsistentMapBuilder<K, V> withPurgeOnUninstall() {
+            return this;
+        }
+
+        @Override
+        public ConsistentMap<K, V> build() {
+            return new TestConsistentMap<>(mapName);
+        }
+
+        @Override
+        public AsyncConsistentMap<K, V> buildAsyncMap() {
+            return null;
+        }
+
+    }
+
+}
diff --git a/core/api/src/test/java/org/onosproject/store/service/TestStorageService.java b/core/api/src/test/java/org/onosproject/store/service/TestStorageService.java
index d79796c..4901cfa 100644
--- a/core/api/src/test/java/org/onosproject/store/service/TestStorageService.java
+++ b/core/api/src/test/java/org/onosproject/store/service/TestStorageService.java
@@ -25,7 +25,7 @@
 
     @Override
     public <K, V> ConsistentMapBuilder<K, V> consistentMapBuilder() {
-        throw new UnsupportedOperationException("consistentMapBuilder");
+        return TestConsistentMap.builder();
     }
 
     @Override
diff --git a/incubator/store/src/test/java/org/onosproject/incubator/store/config/impl/DistributedNetworkConfigStoreTest.java b/incubator/store/src/test/java/org/onosproject/incubator/store/config/impl/DistributedNetworkConfigStoreTest.java
new file mode 100644
index 0000000..9f37d78
--- /dev/null
+++ b/incubator/store/src/test/java/org/onosproject/incubator/store/config/impl/DistributedNetworkConfigStoreTest.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.incubator.store.config.impl;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.onosproject.incubator.net.config.Config;
+import org.onosproject.incubator.net.config.ConfigFactory;
+import org.onosproject.incubator.net.config.SubjectFactory;
+import org.onosproject.store.service.TestStorageService;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.hamcrest.Matchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+public class DistributedNetworkConfigStoreTest {
+    private DistributedNetworkConfigStore configStore;
+
+    /**
+     * Sets up the config store and the storage service test harness.
+     */
+    @Before
+    public void setUp() {
+        configStore = new DistributedNetworkConfigStore();
+        configStore.storageService = new TestStorageService();
+        configStore.setDelegate(event -> { });
+        configStore.activate();
+    }
+
+    /**
+     * Tears down the config store.
+     */
+    @After
+    public void tearDown() {
+        configStore.deactivate();
+    }
+
+    /**
+     * Config class for testing.
+     */
+    public class BasicConfig extends Config<String> { }
+
+    /**
+     * Config factory class for testing.
+     */
+    public class MockConfigFactory extends ConfigFactory<String, BasicConfig> {
+        protected MockConfigFactory(SubjectFactory<String> subjectFactory,
+                                Class<BasicConfig> configClass, String configKey) {
+            super(subjectFactory, configClass, configKey);
+        }
+        @Override
+        public BasicConfig createConfig() {
+            return new BasicConfig();
+        }
+    }
+
+    /**
+     * Tests creation, query and removal of a config.
+     */
+    @Test
+    public void testCreateConfig() {
+        configStore.addConfigFactory(new MockConfigFactory(null, BasicConfig.class, "config1"));
+
+        configStore.createConfig("config1", BasicConfig.class);
+        assertThat(configStore.getConfigClasses("config1"), hasSize(1));
+        assertThat(configStore.getSubjects(String.class, BasicConfig.class), hasSize(1));
+        assertThat(configStore.getSubjects(String.class), hasSize(1));
+
+        BasicConfig queried = configStore.getConfig("config1", BasicConfig.class);
+        assertThat(queried, notNullValue());
+
+        configStore.clearConfig("config1", BasicConfig.class);
+        assertThat(configStore.getConfigClasses("config1"), hasSize(0));
+        assertThat(configStore.getSubjects(String.class, BasicConfig.class), hasSize(0));
+        assertThat(configStore.getSubjects(String.class), hasSize(0));
+
+        BasicConfig queriedAfterClear = configStore.getConfig("config1", BasicConfig.class);
+        assertThat(queriedAfterClear, nullValue());
+    }
+
+    /**
+     * Tests creation, query and removal of a factory.
+     */
+    @Test
+    public void testCreateFactory() {
+        MockConfigFactory mockFactory = new MockConfigFactory(null, BasicConfig.class, "config1");
+
+        assertThat(configStore.getConfigFactory(BasicConfig.class), nullValue());
+
+        configStore.addConfigFactory(mockFactory);
+        assertThat(configStore.getConfigFactory(BasicConfig.class), is(mockFactory));
+
+        configStore.removeConfigFactory(mockFactory);
+        assertThat(configStore.getConfigFactory(BasicConfig.class), nullValue());
+    }
+
+    /**
+     * Tests applying a config.
+     */
+    @Test
+    public void testApplyConfig() {
+        configStore.addConfigFactory(new MockConfigFactory(null, BasicConfig.class, "config1"));
+
+        configStore.applyConfig("config1", BasicConfig.class, new ObjectMapper().createObjectNode());
+        assertThat(configStore.getConfigClasses("config1"), hasSize(1));
+        assertThat(configStore.getSubjects(String.class, BasicConfig.class), hasSize(1));
+        assertThat(configStore.getSubjects(String.class), hasSize(1));
+    }
+}
