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.testcommon;
11 public class DropTestStats {
12 private final int rcvd;
13 private final int sent;
14 private final int excs;
15 private volatile int ftrSuccess;
16 protected volatile int ftrFailed;
17 private final int runablesExecuted;
18 private final int runablesRejected;
20 private final String message;
22 public DropTestStats(int sent, int rcvd) {
26 this.runablesExecuted = 0;
31 public DropTestStats(int sent, int rcvd, int excs) {
36 this.runablesExecuted = 0;
40 public DropTestStats(int sent, int rcvd, int excs, int ftrFailed, int ftrSuccess, int runablesExecuted, int runablesRejected) {
44 this.ftrFailed = ftrFailed;
45 this.ftrSuccess = ftrSuccess;
47 this.runablesExecuted = runablesExecuted;
48 this.runablesRejected = runablesRejected;
51 public DropTestStats(String message) {
55 this.message = message;
56 this.runablesExecuted = -1;
60 public int getSent() {
64 public int getRcvd() {
68 public String getMessage() {
73 public String toString() {
74 StringBuilder result = new StringBuilder();
75 if (this.message == null) {
76 result.append("\n Rcvd:");
77 result.append(this.rcvd);
78 result.append("\n Sent: ");
79 result.append(this.sent);
80 result.append("\n Exceptions: ");
81 result.append(this.excs);
83 result.append("\n future success :");
84 result.append(this.ftrSuccess);
85 result.append("\n future failed :");
86 result.append(this.ftrFailed);
87 result.append("\n run() executions :");
88 result.append(this.runablesExecuted);
89 result.append("\n run() rejected :");
90 result.append(this.runablesRejected);
93 result.append(this.message);
96 return result.toString();