NetconfTopologyManager and UT mods/improvements 21/71921/2
authorTom Pantelis <tompantelis@gmail.com>
Fri, 11 May 2018 01:57:44 +0000 (21:57 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Fri, 11 May 2018 02:25:38 +0000 (22:25 -0400)
commitfb24733359ca4429adf88aa0c9fd5d2500d411fb
tree730cdee1954ac38dcb79924ec8592633116b311b
parentd682d29c57e64070078813dd1e70883a4ba258ee
NetconfTopologyManager and UT mods/improvements

NetconfTopologyManagerTest:

 - separated the test cases for successful and failed CSS registration
   to make it easier to understand/follow.

 - added additional scenarios/coverage/verification for DTCL
   create/update/replace/delete notifications.

 - removed the manipulation and direct verification of the
   NetconfTopologyManager internal maps via reflection. These
   are internal implementation details that the UTs shouldn't
   have knowledge of. The maps are indirectly verified via
   verification of the stored mocks.

 - used the real DataBroker to verify the initilization of the
   Topology nodes. This is easier than mocking a write trannsaction
   correctly.

NetconfTopologyManager:

 - changed the Maps to ConcurrentHashMap as they are accessed by
   multiple threads and could even be accessed concurrently.

 - added a hook for the UTs to create mock NetconfTopologyContexts

 - if CSS registration fails, it should just close the NetconfTopologyContext
   and not itself.

 - other minor changes.

NetconfTopologyContext:

 - implement AutoCloseable and rename closeFinal to the standard close.

 - Renamed the AtomicBooleans for clarity.

Change-Id: Id095a4ff9395d68912a92b0b59d725e062ddd9fc
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
netconf/netconf-topology-singleton/pom.xml
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyContext.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManager.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfTopologyManagerTest.java