2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowplugin.impl.karaf;
11 import java.io.PrintStream;
12 import java.util.List;
13 import java.util.function.Function;
14 import org.apache.felix.service.command.CommandSession;
15 import org.junit.Before;
16 import org.junit.runner.RunWith;
17 import org.mockito.Mock;
18 import org.mockito.Mockito;
19 import org.mockito.junit.MockitoJUnitRunner;
22 * Created by mirehak on 7/29/15.
24 @RunWith(MockitoJUnitRunner.class)
25 public abstract class AbstractKarafTest {
27 protected CommandSession cmdSession;
29 protected PrintStream console;
33 Mockito.when(cmdSession.getConsole()).thenReturn(console);
37 public abstract void doSetUp();
39 public static boolean checkNoActivity(List<String> allStatLines, Function<String, Boolean> checkFunction) {
40 boolean noActivity = true;
41 for (String statLine : allStatLines) {
42 noActivity &= checkFunction.apply(statLine);