2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Modifications Copyright © 2021 Orange.
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.dmaap.mr.tools;
25 import com.att.nsa.cmdtool.CommandNotReadyException;
26 import org.junit.After;
27 import org.junit.Before;
28 import org.junit.Test;
29 import org.junit.runner.RunWith;
30 import org.mockito.InjectMocks;
31 import org.mockito.Mock;
32 import org.mockito.MockitoAnnotations;
33 import org.powermock.core.classloader.annotations.PowerMockIgnore;
34 import org.powermock.modules.junit4.PowerMockRunner;
36 import java.io.PrintStream;
38 import static org.junit.Assert.assertTrue;
40 @RunWith(PowerMockRunner.class)
41 @PowerMockIgnore("jdk.internal.reflect.*")
42 public class TraceCommandTest {
44 private TraceCommand command;
45 private String[] parts = new String[5];
47 private PrintStream printStream;
50 public void setUp() throws Exception {
51 MockitoAnnotations.initMocks(this);
52 for (int i = 0; i < parts.length; i++) {
53 parts[i] = "String" + (i + 1);
59 public void tearDown() throws Exception {
64 public void testGetMatches() {
72 public void testCheckReady() {
75 command.checkReady(new MRCommandContext());
76 } catch (CommandNotReadyException e) {
77 // TODO Auto-generated catch block
85 public void testExecute() {
88 command.execute(parts, new MRCommandContext(), printStream);
89 } catch (CommandNotReadyException e) {
90 // TODO Auto-generated catch block
98 public void testDisplayHelp() {
100 command.displayHelp(printStream);