2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.dmaap.mr.tools;
23 import static org.junit.Assert.assertTrue;
25 import java.io.FileNotFoundException;
26 import java.io.IOException;
27 import java.io.PrintStream;
28 import java.util.ArrayList;
29 import java.util.concurrent.TimeUnit;
31 import org.junit.After;
32 import org.junit.Before;
33 import org.junit.Test;
35 import com.att.nsa.apiClient.http.HttpTracer;
36 import com.att.nsa.cmdtool.CommandNotReadyException;
37 import org.onap.dmaap.mr.client.HostSelector;
38 import org.onap.dmaap.mr.client.MRClient;
39 import org.onap.dmaap.mr.client.MRPublisher.message;
40 import org.onap.dmaap.mr.test.support.MRBatchingPublisherMock.Entry;
42 public class MRCommandContextTest {
43 private MRCommandContext command = null;
44 private String[] parts = new String[5];
47 public void setUp() throws Exception {
48 command = new MRCommandContext();
50 for (int i = 0; i < parts.length; i++) {
51 parts[i] = "String" + (i + 1);
57 public void tearDown() throws Exception {
62 public void testRequestShutdown() {
64 command.requestShutdown();
70 public void testShouldContinue() {
72 command.shouldContinue();
78 public void testSetAuth() {
80 command.setAuth("key", "pwd");
86 public void testClearAuth() {
94 public void testCheckClusterReady() {
96 command.checkClusterReady();
102 public void testGetCluster() {
104 command.getCluster();
110 public void testClearCluster() {
112 command.clearCluster();
118 public void testAddClusterHost() {
120 command.addClusterHost("host");
126 public void testGetApiKey() {
134 public void testGetApiPwd() {
142 public void testUseTracer() {
144 command.useTracer(null);
150 public void testNoTracer() {
158 public void testApplyTracer() {
160 command.applyTracer(null);