-/*
-
-TODO: find a null pointer in here...
- String[] hl = { "host1", "host2", "host3" };
- String loc = "central-onap";
- MR_Cluster cluster = new MR_Cluster( loc, "localhost", "", hl );
- mcs.addMr_Cluster( cluster, err );
- Topic topic = new Topic();
- topic.setTopicName( "test5" );
- topic.setFqtnStyle( FqtnType.Validator("none") );
- topic.setReplicationCase( ReplicationType.Validator("none") );
- String f = topic.getFqtn();
+
+ Topic topic = factory.genSimpleTopic("test5");
+ Topic nTopic = ts.updateTopic( topic, err );
+
+ assertTrue( err.getCode() == 200 );
+ }
+
+ @Test
+ public void bridgeTest6() {
+ ApiError err = new ApiError();
+
+ String t = "org.onap.dmaap.bridgingTopic";
+ Topic topic = factory.genSimpleTopic(t);
+ topic.setReplicationCase( ReplicationType.REPLICATION_EDGE_TO_CENTRAL );
+
+ String c = "publisher";
+ String[] a = { "sub", "view" };
+ MR_Client sub = factory.genMR_Client("central", topic.getFqtn(), c, a );
+ String[] b = { "pub", "view" };
+ MR_Client pub = factory.genMR_Client( "edge", topic.getFqtn(), c, b );
+ ArrayList<MR_Client> clients = new ArrayList<MR_Client>();
+
+ clients.add( sub );
+ clients.add( pub );
+
+ topic.setClients( clients );
+
+ Topic nTopic = ts.updateTopic( topic, err );
+
+ assertTrue( err.getCode() == 200 );
+ }
+ @Test
+ public void bridgeTest7() {
+ ApiError err = new ApiError();
+
+ String t = "org.onap.dmaap.bridgingTopic7";
+ Topic topic = factory.genSimpleTopic(t);
+ topic.setReplicationCase( ReplicationType.REPLICATION_CENTRAL_TO_EDGE );
+
+ String c = "publisher";
+ String[] a = { "sub", "view" };
+ MR_Client sub = factory.genMR_Client("edge", topic.getFqtn(), c, a );
+ String[] b = { "pub", "view" };
+ MR_Client pub = factory.genMR_Client( "central", topic.getFqtn(), c, b );
+ ArrayList<MR_Client> clients = new ArrayList<MR_Client>();
+
+ clients.add( sub );
+ clients.add( pub );
+
+ topic.setClients( clients );
+