Move methods _showDropStats(....) and _clearDropStats(....) from drop-test artifact to drop-test-karaf artifact.
Change-Id: Iaaa5cab7fd6f3774784a0121c7a98bbe3dbdfaae
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.droptestkaraf;
+
+import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
+
+import java.io.PrintStream;
+import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
+
+@Command(scope = "drop-test", name = "clearDropStats", description = "Clear drop statistics.")
+public class ClearDropStatsCommandProvider extends OsgiCommandSupport {
+
+ @Override
+ protected Object doExecute() throws Exception {
+ PrintStream out = session.getConsole();
+ final DropTestRpcProvider rpcProvider = DropTestActivator.getDropRpcProvider();
+ final DropTestDsProvider provider = DropTestActivator.getDropDsProvider();
+
+ out.println("Clearing drop statistics... ");
+ rpcProvider.clearStats();
+ provider.clearStats();
+ out.println("Done.");
+
+ return null;
+ }
+
+}
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.droptestkaraf;
+
+import java.io.PrintStream;
+import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.console.OsgiCommandSupport;
+import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
+import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
+
+@Command(scope = "drop-test", name = "showDropStats", description = "Show drop statistics.")
+public class ShowDropStatsCommandProvider extends OsgiCommandSupport {
+
+ @Override
+ protected Object doExecute() throws Exception {
+ PrintStream out = session.getConsole();
+ final DropTestRpcProvider rpcProvider = DropTestActivator.getDropRpcProvider();
+ final DropTestDsProvider provider = DropTestActivator.getDropDsProvider();
+
+ out.format("RPC Test Statistics: %s%n", rpcProvider.getStats().toString());
+ out.format("FRM Test Statistics: %s%n", provider.getStats().toString());
+
+ return null;
+ }
+
+}
<null/>
</completers>
</command>
+ <command name="drop-test/showDropStats">
+ <action class="org.opendaylight.openflowplugin.droptestkaraf.ShowDropStatsCommandProvider"/>
+ </command>
+ <command name="drop-test/clearDropStats">
+ <action class="org.opendaylight.openflowplugin.droptestkaraf.ClearDropStatsCommandProvider"/>
+ </command>
</command-bundle>
-
+
<bean id="onOffCompleter" class="org.opendaylight.openflowplugin.droptestkaraf.DropAllPacketsCompleter"/>
</blueprint>
\ No newline at end of file