Merge "Bug 1029: Remove dead code: sal-dom-demo"
authorTony Tkacik <ttkacik@cisco.com>
Mon, 19 May 2014 09:07:59 +0000 (09:07 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 19 May 2014 09:07:59 +0000 (09:07 +0000)
19 files changed:
opendaylight/md-sal/clustered-data-store/implementation/pom.xml [deleted file]
opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/cluster/store/ClusteredDataStoreImplModule.java [deleted file]
opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/cluster/store/ClusteredDataStoreImplModuleFactory.java [deleted file]
opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/datastore/ClusteredDataStore.java [deleted file]
opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreImpl.java [deleted file]
opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreManager.java [deleted file]
opendaylight/md-sal/clustered-data-store/implementation/src/main/yang/odl-sal-dom-clustered-store-cfg.yang [deleted file]
opendaylight/md-sal/clustered-data-store/implementation/src/test/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreImplTest.java [deleted file]
opendaylight/md-sal/clustered-data-store/implementation/src/test/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreManagerTest.java [deleted file]
opendaylight/md-sal/clustered-data-store/integrationtest/pom.xml [deleted file]
opendaylight/md-sal/clustered-data-store/integrationtest/src/test/java/org/opendaylight/controller/datastore/ClusteredDataStoreIT.java [deleted file]
opendaylight/md-sal/clustered-data-store/integrationtest/src/test/resources/controller.xml [deleted file]
opendaylight/md-sal/clustered-data-store/integrationtest/src/test/resources/logback.xml [deleted file]
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/NodeMapping.java
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Arguments.java
opendaylight/md-sal/sal-data-api/pom.xml [deleted file]
opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/inventory/InventoryService.java
opendaylight/md-sal/samples/l2switch/implementation/src/main/java/org/opendaylight/controller/sample/l2switch/md/packet/PacketHandler.java

diff --git a/opendaylight/md-sal/clustered-data-store/implementation/pom.xml b/opendaylight/md-sal/clustered-data-store/implementation/pom.xml
deleted file mode 100644 (file)
index fe0b516..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.opendaylight.controller</groupId>
-        <artifactId>sal-parent</artifactId>
-        <version>1.1-SNAPSHOT</version>
-        <relativePath>../..</relativePath>
-    </parent>
-    <scm>
-        <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-        <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-        <tag>HEAD</tag>
-    </scm>
-
-    <artifactId>clustered-datastore-implementation</artifactId>
-    <version>0.4.1-SNAPSHOT</version>
-    <packaging>bundle</packaging>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                    </instructions>
-                    <manifestLocation>${project.basedir}/META-INF</manifestLocation>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.opendaylight.yangtools</groupId>
-                <artifactId>yang-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>generate-sources</goal>
-                        </goals>
-                        <configuration>
-                            <codeGenerators>
-                                <generator>
-                                    <codeGeneratorClass>
-                                        org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-                                    </codeGeneratorClass>
-                                    <outputBaseDir>${project.build.directory}/generated-sources/config</outputBaseDir>
-                                    <additionalConfiguration>
-                                        <namespaceToPackage1>
-                                            urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang
-                                        </namespaceToPackage1>
-                                    </additionalConfiguration>
-                                </generator>
-                                <generator>
-                                    <codeGeneratorClass>org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl</codeGeneratorClass>
-                                    <outputBaseDir>target/site/models</outputBaseDir>
-                                </generator>
-                            </codeGenerators>
-                            <inspectDependencies>true</inspectDependencies>
-                        </configuration>
-                    </execution>
-                </executions>
-                <dependencies>
-                    <dependency>
-                        <groupId>org.opendaylight.controller</groupId>
-                        <artifactId>yang-jmx-generator-plugin</artifactId>
-                        <version>0.2.3-SNAPSHOT</version>
-                    </dependency>
-                    <dependency>
-                        <groupId>org.opendaylight.yangtools</groupId>
-                        <artifactId>maven-sal-api-gen-plugin</artifactId>
-                        <version>${yangtools.version}</version>
-                        <type>jar</type>
-                    </dependency>
-                </dependencies>
-            </plugin>
-        </plugins>
-    </build>
-    <dependencies>
-
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-core-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-common-util</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>clustering.services</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-all</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-binding</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-data-api</artifactId>
-        </dependency>
-
-    </dependencies>
-</project>
diff --git a/opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/cluster/store/ClusteredDataStoreImplModule.java b/opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/cluster/store/ClusteredDataStoreImplModule.java
deleted file mode 100644 (file)
index 5fc2c01..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-/**
-* Generated file
-
-* Generated from: yang module name: odl-sal-dom-clustered-store-cfg  yang module local name: dom-clustered-store-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Wed Nov 27 17:09:17 CET 2013
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.md.sal.dom.cluster.store;
-
-import org.opendaylight.controller.datastore.internal.ClusteredDataStoreManager;
-import org.osgi.framework.BundleContext;
-
-/**
-*
-*/
-public final class ClusteredDataStoreImplModule extends org.opendaylight.controller.config.yang.md.sal.dom.cluster.store.AbstractClusteredDataStoreImplModule
-{
-
-    private BundleContext bundleContext;
-
-    public ClusteredDataStoreImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
-        super(identifier, dependencyResolver);
-    }
-
-    public ClusteredDataStoreImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, ClusteredDataStoreImplModule oldModule, java.lang.AutoCloseable oldInstance) {
-        super(identifier, dependencyResolver, oldModule, oldInstance);
-    }
-
-    @Override
-    public void validate(){
-        super.validate();
-        // Add custom validation for module attributes here.
-    }
-
-    @Override
-    public java.lang.AutoCloseable createInstance() {
-        ClusteredDataStoreManager manager = new ClusteredDataStoreManager();
-        manager.setContext(bundleContext);
-        manager.start();
-        return manager;
-    }
-
-    public void setBundleContext(BundleContext bundleContext) {
-        this.bundleContext = bundleContext;
-    }
-}
diff --git a/opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/cluster/store/ClusteredDataStoreImplModuleFactory.java b/opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/cluster/store/ClusteredDataStoreImplModuleFactory.java
deleted file mode 100644 (file)
index 40c5587..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-/**
-* Generated file
-
-* Generated from: yang module name: odl-sal-dom-clustered-store-cfg  yang module local name: dom-clustered-store-impl
-* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator
-* Generated at: Wed Nov 27 17:09:17 CET 2013
-*
-* Do not modify this file unless it is present under src/main directory
-*/
-package org.opendaylight.controller.config.yang.md.sal.dom.cluster.store;
-
-import org.opendaylight.controller.config.api.DependencyResolver;
-import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
-import org.opendaylight.controller.config.spi.Module;
-import org.osgi.framework.BundleContext;
-
-/**
-*
-*/
-public class ClusteredDataStoreImplModuleFactory extends org.opendaylight.controller.config.yang.md.sal.dom.cluster.store.AbstractClusteredDataStoreImplModuleFactory
-{
-
-    @Override
-    public Module createModule(String instanceName, DependencyResolver dependencyResolver, BundleContext bundleContext) {
-        ClusteredDataStoreImplModule module = 
-        (ClusteredDataStoreImplModule) super.createModule(instanceName, dependencyResolver, bundleContext);
-        module.setBundleContext(bundleContext);
-        return module;
-    }
-    
-    @Override
-    public Module createModule(String instanceName, DependencyResolver dependencyResolver,
-            DynamicMBeanWithInstance old, BundleContext bundleContext) throws Exception {
-        ClusteredDataStoreImplModule module = 
-                (ClusteredDataStoreImplModule) super.createModule(instanceName, dependencyResolver, old, bundleContext);
-        module.setBundleContext(bundleContext);
-        return module;
-    }
-
-}
diff --git a/opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/datastore/ClusteredDataStore.java b/opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/datastore/ClusteredDataStore.java
deleted file mode 100644 (file)
index 1aecb96..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-
-package org.opendaylight.controller.datastore;
-
-import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler;
-import org.opendaylight.controller.md.sal.common.api.data.DataReader;
-import org.opendaylight.controller.sal.core.api.data.DataStore;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
-
-public interface ClusteredDataStore extends DataStore {
-
-
-}
diff --git a/opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreImpl.java b/opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreImpl.java
deleted file mode 100644 (file)
index 0809ba3..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.datastore.internal;
-
-import com.google.common.base.Preconditions;
-
-import org.opendaylight.controller.clustering.services.CacheConfigException;
-import org.opendaylight.controller.clustering.services.CacheExistException;
-import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
-import org.opendaylight.controller.clustering.services.IClusterServices;
-import org.opendaylight.controller.datastore.ClusteredDataStore;
-import org.opendaylight.controller.md.sal.common.api.data.DataModification;
-import org.opendaylight.controller.sal.common.util.Rpcs;
-import org.opendaylight.yangtools.yang.common.RpcError;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * The ClusteredDataStoreImpl stores global data to be shared across a controller cluster. It uses Clustering Services.
- */
-public class ClusteredDataStoreImpl implements ClusteredDataStore {
-
-
-    public static final String OPERATIONAL_DATA_CACHE = "clustered_data_store.operational_data_cache";
-    public static final String CONFIGURATION_DATA_CACHE = "clustered_data_store.configuration_data_cache";
-
-    private final ConcurrentMap<InstanceIdentifier, CompositeNode> operationalDataCache;
-    private final ConcurrentMap<InstanceIdentifier, CompositeNode> configurationDataCache;
-
-    private Logger logger = LoggerFactory.getLogger(ClusteredDataStoreImpl.class);
-
-    public ClusteredDataStoreImpl(IClusterGlobalServices clusterGlobalServices) throws CacheConfigException {
-        logger.trace("Constructing clustered data store");
-        Preconditions.checkNotNull(clusterGlobalServices, "clusterGlobalServices cannot be null");
-
-        operationalDataCache = getOrCreateCache(clusterGlobalServices, OPERATIONAL_DATA_CACHE);
-
-        Preconditions.checkNotNull(operationalDataCache, "operationalDataCache cannot be null");
-
-        configurationDataCache = getOrCreateCache(clusterGlobalServices, CONFIGURATION_DATA_CACHE);
-
-        Preconditions.checkNotNull(configurationDataCache, "configurationDataCache cannot be null");
-    }
-
-    @Override
-    public DataCommitTransaction<InstanceIdentifier, CompositeNode> requestCommit(DataModification<InstanceIdentifier, CompositeNode> modification) {
-        return new ClusteredDataStoreTransaction(modification);
-    }
-
-    @Override
-    public CompositeNode readOperationalData(InstanceIdentifier path) {
-        Preconditions.checkNotNull(path, "path cannot be null");
-        return operationalDataCache.get(path);
-    }
-
-    @Override
-    public boolean containsConfigurationPath(InstanceIdentifier path) {
-        return configurationDataCache.containsKey(path);
-    }
-
-    @Override
-    public boolean containsOperationalPath(InstanceIdentifier path) {
-        return operationalDataCache.containsKey(path);
-    }
-
-    @Override
-    public Iterable<InstanceIdentifier> getStoredConfigurationPaths() {
-        return configurationDataCache.keySet();
-    }
-
-    @Override
-    public Iterable<InstanceIdentifier> getStoredOperationalPaths() {
-        return operationalDataCache.keySet();
-    }
-
-
-
-    @Override
-    public CompositeNode readConfigurationData(InstanceIdentifier path) {
-        Preconditions.checkNotNull(path, "path cannot be null");
-        return configurationDataCache.get(path);
-    }
-
-    private RpcResult<Void> finish(final ClusteredDataStoreTransaction transaction) {
-      final DataModification<InstanceIdentifier,CompositeNode> modification = transaction.getModification();
-
-      this.configurationDataCache.putAll(modification.getUpdatedConfigurationData());
-      this.operationalDataCache.putAll(modification.getUpdatedOperationalData());
-
-      for (final InstanceIdentifier removal : modification.getRemovedConfigurationData()) {
-        this.configurationDataCache.remove(removal);
-      }
-
-      for (final InstanceIdentifier removal : modification.getRemovedOperationalData()) {
-        this.operationalDataCache.remove(removal  );
-      }
-
-      Set<RpcError> _emptySet = Collections.<RpcError>emptySet();
-      return Rpcs.<Void>getRpcResult(true, null, _emptySet);
-    }
-
-    private RpcResult<Void> rollback(final ClusteredDataStoreTransaction transaction) {
-      Set<RpcError> _emptySet = Collections.<RpcError>emptySet();
-      return Rpcs.<Void>getRpcResult(true, null, _emptySet);
-    }
-
-
-    private ConcurrentMap getOrCreateCache(IClusterGlobalServices clusterGlobalServices, String name) throws CacheConfigException {
-        ConcurrentMap cache = clusterGlobalServices.getCache(name);
-
-        if(cache == null) {
-            try {
-                cache = clusterGlobalServices.createCache(name, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
-            } catch (CacheExistException e) {
-                cache = clusterGlobalServices.getCache(name);
-            }
-        }
-        return cache;
-    }
-
-    private class ClusteredDataStoreTransaction implements DataCommitTransaction<InstanceIdentifier, CompositeNode> {
-        private final DataModification<InstanceIdentifier,CompositeNode> modification;
-
-        public ClusteredDataStoreTransaction(DataModification<InstanceIdentifier,CompositeNode> modification){
-            Preconditions.checkNotNull(modification, "modification cannot be null");
-
-            this.modification = modification;
-        }
-
-        @Override
-        public DataModification<InstanceIdentifier, CompositeNode> getModification() {
-            return this.modification;
-        }
-
-        @Override
-        public RpcResult<Void> finish() throws IllegalStateException {
-            return ClusteredDataStoreImpl.this.finish(this);
-        }
-
-        @Override
-        public RpcResult<Void> rollback() throws IllegalStateException {
-            return ClusteredDataStoreImpl.this.rollback(this);
-        }
-    }
-}
diff --git a/opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreManager.java b/opendaylight/md-sal/clustered-data-store/implementation/src/main/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreManager.java
deleted file mode 100644 (file)
index b0a099f..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.datastore.internal;
-
-import java.util.Hashtable;
-
-import com.google.common.base.Preconditions;
-
-import org.opendaylight.controller.clustering.services.CacheConfigException;
-import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
-import org.opendaylight.controller.datastore.ClusteredDataStore;
-import org.opendaylight.controller.md.sal.common.api.data.DataModification;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-public class ClusteredDataStoreManager implements //
-        ClusteredDataStore, //
-        ServiceTrackerCustomizer<IClusterGlobalServices, IClusterGlobalServices>, //
-        AutoCloseable {
-
-    private ClusteredDataStore clusteredDataStore = null;
-    private IClusterGlobalServices clusterGlobalServices = null;
-    private BundleContext context;
-
-    private ServiceReference<IClusterGlobalServices> firstClusterGlobalReference;
-    private ServiceTracker<IClusterGlobalServices, IClusterGlobalServices> clusterTracker;
-
-    @Override
-    public DataCommitTransaction<InstanceIdentifier, CompositeNode> requestCommit(
-            DataModification<InstanceIdentifier, CompositeNode> modification) {
-        Preconditions.checkState(clusteredDataStore != null, "clusteredDataStore cannot be null");
-        return clusteredDataStore.requestCommit(modification);
-    }
-
-    @Override
-    public CompositeNode readOperationalData(InstanceIdentifier path) {
-        Preconditions.checkState(clusteredDataStore != null, "clusteredDataStore cannot be null");
-        return clusteredDataStore.readOperationalData(path);
-    }
-
-    @Override
-    public CompositeNode readConfigurationData(InstanceIdentifier path) {
-        Preconditions.checkState(clusteredDataStore != null, "clusteredDataStore cannot be null");
-        return clusteredDataStore.readConfigurationData(path);
-    }
-
-    public Iterable<InstanceIdentifier> getStoredConfigurationPaths() {
-        Preconditions.checkState(clusteredDataStore != null, "clusteredDataStore cannot be null");
-        return clusteredDataStore.getStoredConfigurationPaths();
-    }
-
-    public Iterable<InstanceIdentifier> getStoredOperationalPaths() {
-        Preconditions.checkState(clusteredDataStore != null, "clusteredDataStore cannot be null");
-        return clusteredDataStore.getStoredOperationalPaths();
-    }
-
-    public boolean containsConfigurationPath(InstanceIdentifier path) {
-        Preconditions.checkState(clusteredDataStore != null, "clusteredDataStore cannot be null");
-        return clusteredDataStore.containsConfigurationPath(path);
-    }
-
-    public boolean containsOperationalPath(InstanceIdentifier path) {
-        Preconditions.checkState(clusteredDataStore != null, "clusteredDataStore cannot be null");
-        return clusteredDataStore.containsOperationalPath(path);
-    }
-
-    public void setClusterGlobalServices(IClusterGlobalServices clusterGlobalServices) {
-        this.clusterGlobalServices = clusterGlobalServices;
-        try {
-            // Adding creation of the clustered data store in its own method
-            // to make the method unit testable
-            clusteredDataStore = createClusteredDataStore();
-        } catch (CacheConfigException e) {
-            throw new IllegalStateException("could not construct clusteredDataStore");
-        }
-    }
-
-    @Override
-    public IClusterGlobalServices addingService(ServiceReference<IClusterGlobalServices> reference) {
-        if (clusterGlobalServices == null) {
-            setClusterGlobalServices(context.getService(reference));
-            return clusterGlobalServices;
-        }
-        return null;
-    }
-
-    @Override
-    public void modifiedService(ServiceReference<IClusterGlobalServices> reference, IClusterGlobalServices service) {
-
-    }
-
-    @Override
-    public void removedService(ServiceReference<IClusterGlobalServices> reference, IClusterGlobalServices service) {
-        if (clusterGlobalServices == service) {
-            clusterGlobalServices = null;
-            clusteredDataStore = null;
-        }
-    }
-
-    public BundleContext getContext() {
-        return context;
-    }
-
-    public void setContext(BundleContext context) {
-        this.context = context;
-    }
-    
-    
-    /**
-     * Function called by the dependency manager when all the required
-     * dependencies are satisfied
-     * 
-     */
-    public void start() {
-        if (context != null) {
-            clusterTracker = new ServiceTracker<>(context, IClusterGlobalServices.class, this);
-            clusterTracker.open();
-            
-            context.registerService(ClusteredDataStore.class, this, new Hashtable<String,Object>());
-        }
-    }
-
-    protected ClusteredDataStore createClusteredDataStore() throws CacheConfigException {
-        return new ClusteredDataStoreImpl(clusterGlobalServices);
-    }
-
-    @Override
-    public void close() throws Exception {
-        clusterTracker.close();
-    }
-}
diff --git a/opendaylight/md-sal/clustered-data-store/implementation/src/main/yang/odl-sal-dom-clustered-store-cfg.yang b/opendaylight/md-sal/clustered-data-store/implementation/src/main/yang/odl-sal-dom-clustered-store-cfg.yang
deleted file mode 100644 (file)
index 95a26d7..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-module odl-sal-dom-clustered-store-cfg {
-       yang-version 1;
-    namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:cluster:store";
-    prefix "binding-impl";
-
-       import config { prefix config; revision-date 2013-04-05; }
-       import opendaylight-md-sal-dom {prefix sal;}
-
-    description
-        "Service definition for MD-SAL Clustered Store.";
-    revision "2013-10-28" {
-        description
-            "Initial revision";
-    }
-
-    identity dom-clustered-store-impl {
-        base config:module-type;
-        config:provided-service sal:dom-data-store;
-        config:java-name-prefix ClusteredDataStoreImpl;
-    }
-
-    augment "/config:modules/config:module/config:state" {
-        case dom-clustered-store-impl {
-            when "/config:modules/config:module/config:type = 'dom-clustered-store-impl'";
-        }
-    }
-    
-}
\ No newline at end of file
diff --git a/opendaylight/md-sal/clustered-data-store/implementation/src/test/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreImplTest.java b/opendaylight/md-sal/clustered-data-store/implementation/src/test/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreImplTest.java
deleted file mode 100644 (file)
index 4c97b19..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.datastore.internal;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.opendaylight.controller.clustering.services.CacheConfigException;
-import org.opendaylight.controller.clustering.services.CacheExistException;
-import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
-import org.opendaylight.controller.clustering.services.IClusterServices;
-import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler;
-import org.opendaylight.controller.md.sal.common.api.data.DataModification;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
-
-import java.util.EnumSet;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-public class ClusteredDataStoreImplTest {
-    @Before
-    public void setUp(){
-
-    }
-
-    @Test
-    public void constructor_WhenPassedANullClusteringServices_ShouldThrowANullPointerException() throws CacheExistException, CacheConfigException {
-        try {
-            new ClusteredDataStoreImpl(null);
-        } catch(NullPointerException npe){
-            assertEquals("clusterGlobalServices cannot be null", npe.getMessage());
-        }
-    }
-
-    @Test
-    public void constructor_WhenClusteringServicesReturnsANullOperationalDataCache_ShouldThrowANullPointerException() throws CacheExistException, CacheConfigException {
-        try {
-            new ClusteredDataStoreImpl(mock(IClusterGlobalServices.class));
-        } catch(NullPointerException npe){
-            assertEquals("operationalDataCache cannot be null", npe.getMessage());
-        }
-    }
-
-    @Test
-    public void constructor_WhenClusteringServicesReturnsANullOConfigurationDataCache_ShouldThrowANullPointerException() throws CacheExistException, CacheConfigException {
-        IClusterGlobalServices mockClusterGlobalServices = mock(IClusterGlobalServices.class);
-
-        // Confused about the following line?
-        // See this http://stackoverflow.com/questions/10952629/a-strange-generics-edge-case-with-mockito-when-and-generic-type-inference
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.OPERATIONAL_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(new ConcurrentHashMap<Object, Object>());
-
-
-        try {
-            new ClusteredDataStoreImpl(mockClusterGlobalServices);
-        } catch(NullPointerException npe){
-            assertEquals("configurationDataCache cannot be null", npe.getMessage());
-        }
-    }
-
-    @Test
-    public void constructor_WhenOperationalDataCacheIsAlreadyPresent_ShouldNotAttemptToCreateCache() throws CacheExistException, CacheConfigException {
-        IClusterGlobalServices mockClusterGlobalServices = mock(IClusterGlobalServices.class);
-
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.getCache(ClusteredDataStoreImpl.OPERATIONAL_DATA_CACHE)).thenReturn(new ConcurrentHashMap<Object, Object>());
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.getCache(ClusteredDataStoreImpl.CONFIGURATION_DATA_CACHE)).thenReturn(new ConcurrentHashMap<Object, Object>());
-
-        new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        verify(mockClusterGlobalServices, never()).createCache(ClusteredDataStoreImpl.OPERATIONAL_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
-    }
-
-    @Test
-    public void constructor_WhenConfigurationDataCacheIsAlreadyPresent_ShouldNotAttemptToCreateCache() throws CacheExistException, CacheConfigException {
-        IClusterGlobalServices mockClusterGlobalServices = mock(IClusterGlobalServices.class);
-
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.getCache(ClusteredDataStoreImpl.OPERATIONAL_DATA_CACHE)).thenReturn(new ConcurrentHashMap<Object, Object>());
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.getCache(ClusteredDataStoreImpl.CONFIGURATION_DATA_CACHE)).thenReturn(new ConcurrentHashMap<Object, Object>());
-
-        new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        verify(mockClusterGlobalServices, never()).createCache(ClusteredDataStoreImpl.CONFIGURATION_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
-    }
-
-
-    @Test
-    public void constructor_WhenPassedAValidClusteringServices_ShouldNotThrowAnyExceptions() throws CacheExistException, CacheConfigException {
-        IClusterGlobalServices mockClusterGlobalServices = createClusterGlobalServices();
-
-        new ClusteredDataStoreImpl(mockClusterGlobalServices);
-    }
-
-
-    @Test
-    public void readOperationalData_WhenPassedANullPath_ShouldThrowANullPointerException() throws CacheExistException, CacheConfigException {
-        IClusterGlobalServices mockClusterGlobalServices = createClusterGlobalServices();
-
-        ClusteredDataStoreImpl store = new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        try {
-            store.readOperationalData(null);
-        } catch(NullPointerException npe){
-            assertEquals("path cannot be null", npe.getMessage());
-        }
-    }
-
-    @Test
-    public void readOperationalData_WhenPassedAKeyThatDoesNotExistInTheCache_ShouldReturnNull() throws CacheExistException, CacheConfigException {
-        InstanceIdentifier path = InstanceIdentifier.builder().toInstance();
-
-        IClusterGlobalServices mockClusterGlobalServices = createClusterGlobalServices();
-
-        ClusteredDataStoreImpl store = new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        assertNull(store.readOperationalData(path));
-    }
-
-    @Test
-    public void readOperationalData_WhenPassedAKeyThatDoesExistInTheCache_ShouldReturnTheValueObject() throws CacheExistException, CacheConfigException {
-        InstanceIdentifier path = InstanceIdentifier.builder().toInstance();
-
-        IClusterGlobalServices mockClusterGlobalServices = createClusterGlobalServices();
-
-        ConcurrentMap<InstanceIdentifier, CompositeNode> mockOperationalDataCache = mock(ConcurrentMap.class);
-
-        CompositeNode valueObject = mock(CompositeNode.class);
-
-        when(mockOperationalDataCache.get(path)).thenReturn(valueObject);
-
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.OPERATIONAL_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(mockOperationalDataCache);
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.CONFIGURATION_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(new ConcurrentHashMap<Object, Object>());
-
-
-        ClusteredDataStoreImpl store = new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        assertEquals(valueObject, store.readOperationalData(path));
-    }
-
-
-
-    @Test
-    public void readConfigurationData_WhenPassedANullPath_ShouldThrowANullPointerException() throws CacheExistException, CacheConfigException {
-
-        IClusterGlobalServices mockClusterGlobalServices = createClusterGlobalServices();
-
-        ClusteredDataStoreImpl store = new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        try {
-            store.readConfigurationData(null);
-        } catch(NullPointerException npe){
-            assertEquals("path cannot be null", npe.getMessage());
-        }
-    }
-
-
-    @Test
-    public void readConfigurationData_WhenPassedAKeyThatDoesNotExistInTheCache_ShouldReturnNull() throws CacheExistException, CacheConfigException {
-        InstanceIdentifier path = InstanceIdentifier.builder().toInstance();
-
-        IClusterGlobalServices mockClusterGlobalServices = createClusterGlobalServices();
-
-        ClusteredDataStoreImpl store = new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        assertNull(store.readConfigurationData(path));
-    }
-
-    @Test
-    public void readConfigurationData_WhenPassedAKeyThatDoesExistInTheCache_ShouldReturnTheValueObject() throws CacheExistException, CacheConfigException {
-        InstanceIdentifier path = InstanceIdentifier.builder().toInstance();
-
-        IClusterGlobalServices mockClusterGlobalServices = createClusterGlobalServices();
-
-        ConcurrentMap<InstanceIdentifier, CompositeNode> mockConfigurationDataCache = mock(ConcurrentMap.class);
-
-        CompositeNode valueObject = mock(CompositeNode.class);
-
-        when(mockConfigurationDataCache.get(path)).thenReturn(valueObject);
-
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.OPERATIONAL_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(mock(ConcurrentMap.class));
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.CONFIGURATION_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(mockConfigurationDataCache);
-
-
-        ClusteredDataStoreImpl store = new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        assertEquals(valueObject, store.readConfigurationData(path));
-    }
-
-
-    @Test
-    public void requestCommit_ShouldReturnADataTransaction() throws CacheExistException, CacheConfigException {
-        IClusterGlobalServices mockClusterGlobalServices = createClusterGlobalServices();
-
-        ClusteredDataStoreImpl store = new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        assertNotNull(store.requestCommit(mock(DataModification.class)));
-
-
-    }
-
-    @Test
-    public void finishingADataTransaction_ShouldUpdateTheUnderlyingCache() throws CacheExistException, CacheConfigException {
-        IClusterGlobalServices mockClusterGlobalServices = mock(IClusterGlobalServices.class);
-
-        ConcurrentMap mockConfigurationDataCache = mock(ConcurrentMap.class);
-        ConcurrentMap mockOperationalDataCache = mock(ConcurrentMap.class);
-
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.OPERATIONAL_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(mockOperationalDataCache);
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.CONFIGURATION_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(mockConfigurationDataCache);
-
-        ClusteredDataStoreImpl store = new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        DataModification mockModification = mock(DataModification.class);
-
-        Map configurationData = mock(Map.class);
-        Map operationalData = mock(Map.class);
-
-        when(mockModification.getUpdatedConfigurationData()).thenReturn(configurationData);
-        when(mockModification.getUpdatedOperationalData()).thenReturn(operationalData);
-
-        DataCommitHandler.DataCommitTransaction<InstanceIdentifier, CompositeNode> transaction = store.requestCommit(mockModification);
-
-        transaction.finish();
-
-        verify(mockConfigurationDataCache).putAll(mockModification.getUpdatedConfigurationData());
-        verify(mockOperationalDataCache).putAll(mockModification.getUpdatedOperationalData());
-    }
-
-
-    @Test
-    public void rollingBackADataTransaction_ShouldDoNothing() throws CacheExistException, CacheConfigException {
-        IClusterGlobalServices mockClusterGlobalServices = mock(IClusterGlobalServices.class);
-
-        ConcurrentMap mockConfigurationDataCache = mock(ConcurrentMap.class);
-        ConcurrentMap mockOperationalDataCache = mock(ConcurrentMap.class);
-
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.OPERATIONAL_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(mockOperationalDataCache);
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.CONFIGURATION_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(mockConfigurationDataCache);
-
-        ClusteredDataStoreImpl store = new ClusteredDataStoreImpl(mockClusterGlobalServices);
-
-        DataModification mockModification = mock(DataModification.class);
-
-        Map configurationData = mock(Map.class);
-        Map operationalData = mock(Map.class);
-
-        when(mockModification.getUpdatedConfigurationData()).thenReturn(configurationData);
-        when(mockModification.getUpdatedOperationalData()).thenReturn(operationalData);
-
-        DataCommitHandler.DataCommitTransaction<InstanceIdentifier, CompositeNode> transaction = store.requestCommit(mockModification);
-
-        transaction.rollback();
-
-        verify(mockConfigurationDataCache, never()).putAll(mockModification.getUpdatedConfigurationData());
-        verify(mockOperationalDataCache, never()).putAll(mockModification.getUpdatedOperationalData());
-
-    }
-
-
-    private IClusterGlobalServices createClusterGlobalServices() throws CacheExistException, CacheConfigException {
-        IClusterGlobalServices mockClusterGlobalServices = mock(IClusterGlobalServices.class);
-
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.OPERATIONAL_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(mock(ConcurrentMap.class));
-        Mockito.<ConcurrentMap<?,?>>when(mockClusterGlobalServices.createCache(ClusteredDataStoreImpl.CONFIGURATION_DATA_CACHE, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL))).thenReturn(mock(ConcurrentMap.class));
-
-        return mockClusterGlobalServices;
-    }
-}
diff --git a/opendaylight/md-sal/clustered-data-store/implementation/src/test/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreManagerTest.java b/opendaylight/md-sal/clustered-data-store/implementation/src/test/java/org/opendaylight/controller/datastore/internal/ClusteredDataStoreManagerTest.java
deleted file mode 100644 (file)
index 10f9622..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.datastore.internal;
-
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.felix.dm.Component;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.opendaylight.controller.clustering.services.CacheConfigException;
-import org.opendaylight.controller.clustering.services.CacheExistException;
-import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
-import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler.DataCommitTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.DataModification;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
-
-import static junit.framework.Assert.assertNotNull;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
-
-public class ClusteredDataStoreManagerTest {
-
-    private static ClusteredDataStoreManager clusteredDSMgr = null;
-    private IClusterGlobalServices icClusterGlbServices = mock(IClusterGlobalServices.class);
-
-    @BeforeClass
-    public static void construct() {
-        clusteredDSMgr = new ClusteredDataStoreManager();
-        assertNotNull(clusteredDSMgr);
-    }
-
-    @Test
-    public void construct_OnSetClusterGlobalServices_AssertNoException() {
-        doReturn(new ConcurrentHashMap<InstanceIdentifier, CompositeNode>()).when(icClusterGlbServices).getCache(ClusteredDataStoreImpl.CONFIGURATION_DATA_CACHE);
-        doReturn(new ConcurrentHashMap<InstanceIdentifier, CompositeNode>()).when(icClusterGlbServices).getCache(ClusteredDataStoreImpl.OPERATIONAL_DATA_CACHE);
-        clusteredDSMgr.setClusterGlobalServices(icClusterGlbServices);
-    }
-
-    @Test
-    public void construct_init_AssertNoException() throws CacheExistException, CacheConfigException {
-        ClusteredDataStoreImpl clusteredDSImpl = mock(ClusteredDataStoreImpl.class);
-
-        ClusteredDataStoreManager clusteredDSManager = spy(new ClusteredDataStoreManager());
-        doReturn(clusteredDSImpl).when(clusteredDSManager).createClusteredDataStore();
-        clusteredDSManager.start();
-    }
-
-
-    @Test
-    public void construct_readOperationalData_AssertNoException() throws CacheExistException, CacheConfigException {
-        ClusteredDataStoreImpl clusteredDSImpl = mock(ClusteredDataStoreImpl.class);
-
-        ClusteredDataStoreManager clusteredDSManager = spy(new ClusteredDataStoreManager());
-        doReturn(clusteredDSImpl).when(clusteredDSManager).createClusteredDataStore();
-        Component c = mock(Component.class);
-        
-        clusteredDSManager.start();
-        clusteredDSManager.setClusterGlobalServices(icClusterGlbServices);
-        CompositeNode o = mock(CompositeNode.class);
-
-        when(clusteredDSImpl.readOperationalData(any(InstanceIdentifier.class))).thenReturn(o);
-        assertEquals(o, clusteredDSManager.readOperationalData(any(InstanceIdentifier.class)));
-    }
-
-    @Test
-    public void construct_readConfigurationData_AssertNoException() throws CacheExistException, CacheConfigException {
-        ClusteredDataStoreImpl clusteredDSImpl = mock(ClusteredDataStoreImpl.class);
-
-        ClusteredDataStoreManager clusteredDSManager = spy(new ClusteredDataStoreManager());
-        doReturn(clusteredDSImpl).when(clusteredDSManager).createClusteredDataStore();
-        Component c = mock(Component.class);
-
-        clusteredDSManager.start();
-        clusteredDSManager.setClusterGlobalServices(icClusterGlbServices);
-        
-        CompositeNode o = mock(CompositeNode.class);
-
-        when(clusteredDSImpl.readConfigurationData(any(InstanceIdentifier.class))).thenReturn(o);
-        assertEquals(o, clusteredDSManager.readConfigurationData(any(InstanceIdentifier.class)));
-    }
-
-    @Test
-    public void construct_requestCommit_AssertNoException() throws CacheExistException, CacheConfigException {
-        ClusteredDataStoreImpl clusteredDSImpl = mock(ClusteredDataStoreImpl.class);
-
-        ClusteredDataStoreManager clusteredDSManager = spy(new ClusteredDataStoreManager());
-        doReturn(clusteredDSImpl).when(clusteredDSManager).createClusteredDataStore();
-        IClusterGlobalServices globalServices = mock(IClusterGlobalServices.class);
-        clusteredDSManager.setClusterGlobalServices(globalServices);
-        clusteredDSManager.start();
-        DataCommitTransaction dataCommitTransaction = mock(DataCommitTransaction.class);
-
-        when(clusteredDSImpl.requestCommit(any(DataModification.class))).thenReturn(dataCommitTransaction);
-        assertEquals(dataCommitTransaction, clusteredDSManager.requestCommit(any(DataModification.class)));
-    }
-}
diff --git a/opendaylight/md-sal/clustered-data-store/integrationtest/pom.xml b/opendaylight/md-sal/clustered-data-store/integrationtest/pom.xml
deleted file mode 100644 (file)
index 2d68b47..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.opendaylight.controller</groupId>
-        <artifactId>commons.integrationtest</artifactId>
-        <version>0.5.1-SNAPSHOT</version>
-        <relativePath>../../../commons/integrationtest</relativePath>
-    </parent>
-    <scm>
-        <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
-        <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
-        <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:Main</url>
-    </scm>
-
-    <artifactId>clustered-datastore.integrationtest</artifactId>
-    <version>0.4.0-SNAPSHOT</version>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>xml-apis</groupId>
-                <artifactId>xml-apis</artifactId>
-                <version>1.4.01</version>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-binding-it</artifactId>
-            <version>1.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-common-api</artifactId>
-            <version>1.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-common-util</artifactId>
-            <version>1.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-common-impl</artifactId>
-            <version>1.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-binding-broker-impl</artifactId>
-            <version>1.0-SNAPSHOT</version>
-            <exclusions>
-                <exclusion>
-                    <artifactId>xml-apis</artifactId>
-                    <groupId>xml-apis</groupId>
-                </exclusion>
-                <exclusion>
-                    <artifactId>reflections</artifactId>
-                    <groupId>org.reflections</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal</artifactId>
-            <version>0.7.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>clustering.services</artifactId>
-            <version>0.5.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-binding</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools.thirdparty</groupId>
-            <artifactId>antlr4-runtime-osgi-nohead</artifactId>
-            <version>4.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>protocol_plugins.stub</artifactId>
-            <version>0.4.1-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal.implementation</artifactId>
-            <version>0.4.1-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>containermanager</artifactId>
-            <version>0.5.1-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>containermanager.it.implementation</artifactId>
-            <version>0.5.1-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>clustering.stub</artifactId>
-            <version>0.4.1-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>clustered-datastore-implementation</artifactId>
-            <version>0.4.1-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools.thirdparty</groupId>
-            <artifactId>xtend-lib-osgi</artifactId>
-            <version>2.4.3</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-binding-broker-impl</artifactId>
-            <version>1.0-SNAPSHOT</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-container-native</artifactId>
-            <version>${exam.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-junit4</artifactId>
-            <version>${exam.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-netconf-connector</artifactId>
-            <version>${netconf.version}</version>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <artifactId>xml-apis</artifactId>
-                    <groupId>xml-apis</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>logback-config</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-persister-impl</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-persister-file-xml-adapter</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>netconf-impl</artifactId>
-            <version>${netconf.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>netconf-client</artifactId>
-            <version>${netconf.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-common</artifactId>
-            <version>1.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-common</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>concepts</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-data-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-all</artifactId>
-            <version>1.9.5</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-manager</artifactId>
-            <version>0.2.3-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller.model</groupId>
-            <artifactId>model-flow-management</artifactId>
-            <version>1.0-SNAPSHOT</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools.thirdparty</groupId>
-            <artifactId>antlr4-runtime-osgi-nohead</artifactId>
-            <version>4.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools.thirdparty</groupId>
-            <artifactId>xtend-lib-osgi</artifactId>
-            <version>2.4.3</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>sal-binding-broker-impl</artifactId>
-            <version>1.0-SNAPSHOT</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-container-native</artifactId>
-            <version>${exam.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-junit4</artifactId>
-            <version>${exam.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-netconf-connector</artifactId>
-            <version>${netconf.version}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-parser-impl</artifactId>
-            <version>${yangtools.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools</groupId>
-            <artifactId>yang-model-util</artifactId>
-            <version>${yangtools.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>logback-config</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-persister-impl</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>netconf-impl</artifactId>
-            <version>${netconf.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>netconf-client</artifactId>
-            <version>${netconf.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-link-mvn</artifactId>
-            <version>${exam.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>equinoxSDK381</groupId>
-            <artifactId>org.eclipse.osgi</artifactId>
-            <version>3.8.1.v20120830-144521</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>log4j-over-slf4j</artifactId>
-            <version>1.7.2</version>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-core</artifactId>
-            <version>1.0.9</version>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-            <version>1.0.9</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller.model</groupId>
-            <artifactId>model-flow-service</artifactId>
-            <version>1.0-SNAPSHOT</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller</groupId>
-            <artifactId>config-manager</artifactId>
-            <version>0.2.3-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.controller.model</groupId>
-            <artifactId>model-flow-management</artifactId>
-            <version>1.0-SNAPSHOT</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools.thirdparty</groupId>
-            <artifactId>antlr4-runtime-osgi-nohead</artifactId>
-            <version>4.0</version>
-        </dependency>
-    </dependencies>
-    <properties>
-        <!-- Sonar jacoco plugin to get integration test coverage info -->
-        <sonar.jacoco.reportPath>../implementation/target/jacoco.exec</sonar.jacoco.reportPath>
-        <sonar.jacoco.itReportPath>../implementaiton/target/jacoco-it.exec</sonar.jacoco.itReportPath>
-    </properties>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.jacoco</groupId>
-                <artifactId>jacoco-maven-plugin</artifactId>
-                <configuration>
-                    <destFile>../implementation/target/jacoco-it.exec</destFile>
-                    <includes><include>org.opendaylight.controller.*</include></includes>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>pre-test</id>
-                        <goals>
-                            <goal>prepare-agent</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>post-test</id>
-                        <configuration>
-                            <skip>true</skip>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/opendaylight/md-sal/clustered-data-store/integrationtest/src/test/java/org/opendaylight/controller/datastore/ClusteredDataStoreIT.java b/opendaylight/md-sal/clustered-data-store/integrationtest/src/test/java/org/opendaylight/controller/datastore/ClusteredDataStoreIT.java
deleted file mode 100644 (file)
index a1fa9e3..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.datastore;
-
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.systemPackages;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler.DataCommitTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.DataModification;
-import org.opendaylight.controller.test.sal.binding.it.TestHelper;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.util.Filter;
-import org.ops4j.pax.exam.util.PathUtils;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@RunWith(PaxExam.class)
-//@ExamReactorStrategy(PerClass.class)
-public class ClusteredDataStoreIT {
-    private Logger log = LoggerFactory.getLogger(ClusteredDataStoreIT.class);
-    // get the OSGI bundle context
-    @Inject
-    private BundleContext bc;
-    @Inject
-    @Filter(timeout=60*1000)
-    private ClusteredDataStore clusteredDS;
-
-    // Configure the OSGi container
-    @Configuration
-    public Option[] config() {
-        return options(
-                //
-                systemProperty("logback.configurationFile").value(
-                        "file:" + PathUtils.getBaseDir() + "/src/test/resources/logback.xml"),
-                // To start OSGi console for inspection remotely
-                systemProperty("osgi.console").value("2401"),
-                // Set the systemPackages (used by clustering)
-                systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
-                systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
-                // List framework bundles
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
-                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
-                // List logger bundles
-                mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
-                mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
-                mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
-                mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
-                // needed by statisticsmanager
-                mavenBundle("org.opendaylight.controller", "containermanager").versionAsInProject(),
-                mavenBundle("org.opendaylight.controller", "containermanager.it.implementation").versionAsInProject(),
-                mavenBundle("org.opendaylight.controller", "clustering.services").versionAsInProject(),
-                mavenBundle("org.opendaylight.controller", "clustering.stub").versionAsInProject(),
-
-                // List all the bundles on which the test case depends
-                mavenBundle("org.opendaylight.controller", "sal").versionAsInProject(),
-                TestHelper.baseModelBundles(),
-                TestHelper.configMinumumBundles(),
-                TestHelper.bindingIndependentSalBundles(),
-                TestHelper.bindingAwareSalBundles(),
-                TestHelper.mdSalCoreBundles(),
-                mavenBundle("org.opendaylight.controller", "config-api").versionAsInProject(),
-                mavenBundle("org.opendaylight.controller", "sal.implementation").versionAsInProject(),
-                mavenBundle("org.opendaylight.controller", "protocol_plugins.stub").versionAsInProject(),
-
-                mavenBundle("org.osgi", "org.osgi.core").versionAsInProject(),
-                // adding new maven bundles
-                mavenBundle("org.mockito", "mockito-all").versionAsInProject(),
-
-                // needed by hosttracker
-                mavenBundle("org.opendaylight.controller", "clustered-datastore-implementation").versionAsInProject(),
-                mavenBundle("org.jboss.spec.javax.transaction", "jboss-transaction-api_1.1_spec").versionAsInProject(),
-                mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
-                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
-                junitBundles());
-    }
-
-    private String stateToString(int state) {
-        switch (state) {
-        case Bundle.ACTIVE:
-            return "ACTIVE";
-        case Bundle.INSTALLED:
-            return "INSTALLED";
-        case Bundle.RESOLVED:
-            return "RESOLVED";
-        case Bundle.UNINSTALLED:
-            return "UNINSTALLED";
-        default:
-            return "Not CONVERTED";
-        }
-    }
-
-    @Test
-    public void testBundleContextClusteredDS_NotNull() throws Exception {
-        ServiceReference serviceReference = bc.getServiceReference(ClusteredDataStore.class);
-        ClusteredDataStore store = ClusteredDataStore.class.cast(bc.getService(serviceReference));
-        assertNotNull(store);
-    }
-
-    @Test
-    public void testInjected_ClusteredDS_NotNull() {
-        assertNotNull(clusteredDS);
-    }
-
-    @Test
-    public void requestCommit_readConfigurationData_ShouldVerifyDataAndNoException() {
-        DataModification dataModification = mock(DataModification.class);
-        HashMap map = new HashMap();
-        List list = new ArrayList();
-        list.add("key");
-        InstanceIdentifier key = new InstanceIdentifier(list);
-        map.put(key, mock(CompositeNode.class));
-        when(dataModification.getUpdatedConfigurationData()).thenReturn(map);
-        DataCommitTransaction dataCommitTrans = clusteredDS.requestCommit(dataModification);
-        dataCommitTrans.finish();
-        Object value = clusteredDS.readConfigurationData(key);
-        Assert.assertNotNull(value);
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void requestCommit_ShouldThrowException() {
-        DataModification dataModification = null;
-        DataCommitTransaction dataCommitTrans = clusteredDS.requestCommit(dataModification);
-        dataCommitTrans.finish();
-    }
-
-    @Test
-    public void requestCommit_readOperationalData_ShouldVerifyDataAndNoException() {
-        DataModification dataModification = mock(DataModification.class);
-        HashMap map = new HashMap();
-        List list = new ArrayList();
-        list.add("key");
-        InstanceIdentifier key = new InstanceIdentifier(list);
-        map.put(key, mock(CompositeNode.class));
-        when(dataModification.getUpdatedOperationalData()).thenReturn(map);
-        DataCommitTransaction dataCommitTrans = clusteredDS.requestCommit(dataModification);
-        dataCommitTrans.finish();
-        Object value = clusteredDS.readOperationalData(key);
-        Assert.assertNotNull(value);
-    }
-
-    @Test
-    public void requestCommit_readConfigurationData_NonExistingKey_ShouldVerifyNoMappedValueAndNoException() {
-        DataModification dataModification = mock(DataModification.class);
-        HashMap map = new HashMap();
-        List list = new ArrayList();
-        list.add("key");
-        InstanceIdentifier key = new InstanceIdentifier(list);
-        map.put(key, "value");
-        when(dataModification.getUpdatedConfigurationData()).thenReturn(map);
-        DataCommitTransaction dataCommitTrans = clusteredDS.requestCommit(dataModification);
-        dataCommitTrans.finish();
-        list = new ArrayList();
-        list.add("key1");
-        InstanceIdentifier key1 = new InstanceIdentifier(list);
-
-        Object value = clusteredDS.readConfigurationData(key1);
-        assertNull(value);
-    }
-
-    @Test
-    public void requestCommit_readOperationalData_NonExistingKey_ShouldVerifyNoMappedValueAndNoException() {
-        DataModification dataModification = mock(DataModification.class);
-        HashMap map = new HashMap();
-        List list = new ArrayList();
-        list.add("key");
-        InstanceIdentifier key = new InstanceIdentifier(list);
-        map.put(key, mock(CompositeNode.class));
-        when(dataModification.getUpdatedOperationalData()).thenReturn(map);
-        DataCommitTransaction dataCommitTrans = clusteredDS.requestCommit(dataModification);
-        dataCommitTrans.finish();
-        list = new ArrayList();
-        list.add("key1");
-        InstanceIdentifier key1 = new InstanceIdentifier(list);
-
-        Object value = clusteredDS.readOperationalData(key1);
-        assertNull(value);
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void requestCommit_readConfigurationData_WithNullPathShouldThrowException() {
-        DataModification dataModification = mock(DataModification.class);
-        HashMap map = new HashMap();
-        List list = new ArrayList();
-        list.add("key");
-        InstanceIdentifier key = new InstanceIdentifier(list);
-        map.put(key, "value");
-        when(dataModification.getUpdatedConfigurationData()).thenReturn(map);
-        DataCommitTransaction dataCommitTrans = clusteredDS.requestCommit(dataModification);
-        dataCommitTrans.finish();
-        Object value = clusteredDS.readConfigurationData(null);
-    }
-
-    @Test(expected = NullPointerException.class)
-    public void requestCommit_readOperationalData_WithNullPathShouldThrowException() {
-        DataModification dataModification = mock(DataModification.class);
-        HashMap map = new HashMap();
-        List list = new ArrayList();
-        list.add("key");
-        InstanceIdentifier key = new InstanceIdentifier(list);
-        map.put(key, "value");
-        when(dataModification.getOriginalOperationalData()).thenReturn(map);
-        DataCommitTransaction dataCommitTrans = clusteredDS.requestCommit(dataModification);
-        dataCommitTrans.finish();
-        Object value = clusteredDS.readOperationalData(null);
-    }
-
-}
diff --git a/opendaylight/md-sal/clustered-data-store/integrationtest/src/test/resources/controller.xml b/opendaylight/md-sal/clustered-data-store/integrationtest/src/test/resources/controller.xml
deleted file mode 100644 (file)
index 5f43ddc..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persisted-snapshots>
-    <snapshots>
-        <snapshot>
-            <required-capabilities>
-                <capability>
-                    urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:cluster:store?module=odl-sal-dom-clustered-store-cfg&amp;revision=2013-10-28
-                </capability>
-            </required-capabilities>
-            <configuration>
-
-                <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
-                    <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-                        <module>
-                            <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:cluster:store">
-                                prefix:dom-clustered-store-impl
-                            </type>
-                            <name>cluster-data-store</name>
-                        </module>
-                    </modules>
-
-                    <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
-
-                    </services>
-                </data>
-
-            </configuration>
-        </snapshot>
-    </snapshots>
-</persisted-snapshots>
diff --git a/opendaylight/md-sal/clustered-data-store/integrationtest/src/test/resources/logback.xml b/opendaylight/md-sal/clustered-data-store/integrationtest/src/test/resources/logback.xml
deleted file mode 100644 (file)
index 5246f01..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<configuration scan="true">
-
-  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-    <encoder>
-      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-      </pattern>
-    </encoder>
-  </appender>
-
-  <root level="debug">
-    <appender-ref ref="STDOUT" />
-  </root>
-</configuration>
index c4c1ee9..9276238 100644 (file)
@@ -54,10 +54,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.No
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.yang.binding.Identifier;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableItem;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
 
 import com.google.common.base.Objects;
 import com.google.common.base.Preconditions;
@@ -83,32 +80,20 @@ public final class NodeMapping {
       return  new org.opendaylight.controller.sal.core.Node(NodeMapping.MD_SAL_TYPE, aDNodeId);
   }
 
-  public static NodeId toNodeId(final InstanceIdentifier<? extends Object> node) {
-    Preconditions.<InstanceIdentifier<? extends Object>>checkNotNull(node);
-    List<PathArgument> path = node.getPath();
-    Preconditions.<List<PathArgument>>checkNotNull(path);
-    int size = path.size();
-    Preconditions.checkArgument(size >= 2);
-    final PathArgument arg = path.get(1);
-    final IdentifiableItem item = Arguments.<IdentifiableItem>checkInstanceOf(arg, IdentifiableItem.class);
-    Identifier<?> key = item.getKey();
-    final NodeKey nodeKey = Arguments.<NodeKey>checkInstanceOf(key, NodeKey.class);
-    return nodeKey.getId();
+  public static NodeId toNodeId(final InstanceIdentifier<?> id) {
+    final NodeKey key = id.firstKeyOf(Node.class, NodeKey.class);
+    Preconditions.checkArgument(key != null, "No node identifier found in %s", id);
+    return key.getId();
   }
 
   public static String toADNodeId(final NodeId nodeId) {
-    Preconditions.<NodeId>checkNotNull(nodeId);
     return nodeId.getValue();
   }
 
   public static org.opendaylight.controller.sal.core.NodeConnector toADNodeConnector(final NodeConnectorRef source) throws ConstructionException {
-    Preconditions.<NodeConnectorRef>checkNotNull(source);
-    final InstanceIdentifier<?> path = Preconditions.<InstanceIdentifier<? extends Object>>checkNotNull(source.getValue());
-    Preconditions.checkArgument(path.getPath().size() >= 3);
-    final PathArgument arg = path.getPath().get(2);
-    final IdentifiableItem item = Arguments.<IdentifiableItem>checkInstanceOf(arg,IdentifiableItem.class);
-    final NodeConnectorKey connectorKey = Arguments.<NodeConnectorKey>checkInstanceOf(item.getKey(), NodeConnectorKey.class);
-    return NodeMapping.toADNodeConnector(connectorKey.getId(), NodeMapping.toNodeId(path));
+    final InstanceIdentifier<?> id = Preconditions.checkNotNull(source.getValue());
+    final NodeConnectorKey key = id.firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
+    return NodeMapping.toADNodeConnector(key.getId(), NodeMapping.toNodeId(id));
   }
 
   public static org.opendaylight.controller.sal.core.NodeConnector toADNodeConnector(final NodeConnectorId ncid, final NodeId nid) throws ConstructionException {
@@ -161,6 +146,7 @@ public final class NodeMapping {
   public static NodeConnectorRef toNodeConnectorRef(final org.opendaylight.controller.sal.core.NodeConnector nodeConnector) {
 
     final NodeRef node = NodeMapping.toNodeRef(nodeConnector.getNode());
+    @SuppressWarnings("unchecked")
     final InstanceIdentifier<Node> nodePath = ((InstanceIdentifier<Node>) node.getValue());
     NodeConnectorId nodeConnectorId = null;
 
index a13d2bb..644e904 100644 (file)
@@ -57,8 +57,6 @@
     <!-- Clustering -->
     <module>remoterpc-routingtable/implementation</module>
     <module>sal-remoterpc-connector/implementation</module>
-    <!--module>clustered-data-store/implementation</module>
-        -->
     <!-- Documentation -->
     <module>sal-rest-docgen</module>
 
index 902665d..a4017c2 100644 (file)
@@ -7,16 +7,16 @@
  */
 package org.opendaylight.controller.sal.common.util;
 
-public class Arguments {
+public final class Arguments {
 
     private Arguments() {
         throw new UnsupportedOperationException("Utility class");
     }
-    
+
     /**
      * Checks if value is instance of provided class
-     * 
-     * 
+     *
+     *
      * @param value Value to check
      * @param type Type to check
      * @return Reference which was checked
@@ -24,7 +24,7 @@ public class Arguments {
     @SuppressWarnings("unchecked")
     public static <T> T checkInstanceOf(Object value, Class<T> type) {
         if(!type.isInstance(value))
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException(String.format("Value %s is not of type %s", value, type));
         return (T) value;
     }
 }
diff --git a/opendaylight/md-sal/sal-data-api/pom.xml b/opendaylight/md-sal/sal-data-api/pom.xml
deleted file mode 100644 (file)
index 6b73e29..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-  <modelVersion>4.0.0</modelVersion>\r
-  <parent>\r
-    <groupId>org.opendaylight.controller</groupId>\r
-    <artifactId>sal-parent</artifactId>\r
-    <version>1.0-SNAPSHOT</version>\r
-  </parent>\r
-   <artifactId>sal-data-api</artifactId>\r
-   <scm>\r
-     <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
-     <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
-     <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>\r
-   </scm>\r
-\r
-</project>\r
index a12f394..1ec65e8 100644 (file)
@@ -21,7 +21,11 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 
 /**
  * InventoryService provides functions related to Nodes & NodeConnectors.
index ecf116b..b4ea942 100644 (file)
@@ -19,7 +19,8 @@ import org.opendaylight.controller.sal.packet.RawPacket;
 import org.opendaylight.controller.sal.utils.HexEncode;
 import org.opendaylight.controller.sal.utils.NetUtils;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.address.tracker.rev140402.l2.addresses.L2Address;