xueliang
Committed by Gerrit Code Review

[ONOS-5295] JUNIT Test cases for volt-onus, volt-setonu and volt-onustats as FUJ…

…ITSU NETCONF commands

Change-Id: I8f80bc651adf2bfbfa7ce8587e03b1373222f37a
......@@ -79,13 +79,8 @@ public class FujitsuVoltPonLinkConfig extends AbstractHandlerBehaviour
private static final int LOF_THRESHOLD_MAX = 10;
private static final int LOS_THRESHOLD_MIN = 1;
private static final int LOS_THRESHOLD_MAX = 10;
private static final int FIRST_PART = 0;
private static final int SECOND_PART = 1;
private static final int THIRD_PART = 2;
private static final int RANGE_MIN = 0;
private static final int RANGE_MAX = 1;
private static final int ZERO = 0;
private static final int THREE = 3;
@Override
public String getPonLinks(String target) {
......@@ -100,7 +95,7 @@ public class FujitsuVoltPonLinkConfig extends AbstractHandlerBehaviour
log.warn("Not master for {} Use {} to execute command",
ncDeviceId,
mastershipService.getMasterFor(ncDeviceId));
return reply;
return null;
}
try {
......@@ -114,11 +109,11 @@ public class FujitsuVoltPonLinkConfig extends AbstractHandlerBehaviour
pon = Integer.parseInt(target);
if (pon <= ZERO) {
log.error("Invalid integer for ponlink-id:{}", target);
return reply;
return null;
}
} catch (NumberFormatException e) {
log.error("Non-number input for ponlink-id:{}", target);
return reply;
return null;
}
request.append(buildStartTag(GPON_PONLINK_PORTS));
request.append(buildStartTag(GPON_PONLINK_PORT));
......
......@@ -42,6 +42,14 @@ public final class FujitsuVoltXmlUtility {
public static final String VOLT_NE_OPEN = ANGLE_LEFT + VOLT_NE + SPACE;
public static final String VOLT_NE_CLOSE = ANGLE_LEFT + SLASH + VOLT_NE + ANGLE_RIGHT;
public static final int FIRST_PART = 0;
public static final int SECOND_PART = 1;
public static final int THIRD_PART = 2;
public static final int ZERO = 0;
public static final int ONE = 1;
public static final int TWO = 2;
public static final int THREE = 3;
private FujitsuVoltXmlUtility() {
// Preventing any allocation
}
......
......@@ -52,9 +52,6 @@ public class FujitsuVoltControllerConfigTest {
private static final String TEST_VOLT_OFCONFIG = "volt-ofconfig";
private static final String TEST_OFCONFIG_ID = "ofconfig-id";
private static final String TEST_END_LICENSE_HEADER = "-->";
private static final int FIRST_PART = 0;
private static final int SECOND_PART = 1;
private static final int THIRD_PART = 2;
private static final Map<Integer, String> GET_CONTROLLERS = new HashMap<Integer, String>() {
{
......
......@@ -42,9 +42,6 @@ public class FujitsuVoltPonLinkConfigTest {
private static final String TEST_VOLT_PORTS = "volt-ports";
private static final String TEST_GPON_PONLINK_PORTS = "gpon-ponlink-ports";
private static final String TEST_GPON_PONLINK_PORT = "gpon-ponlink-port";
private static final int FIRST_PART = 0;
private static final int SECOND_PART = 1;
private static final int THIRD_PART = 2;
private static final Map<Integer, String> INVALID_GET_TCS = new HashMap<Integer, String>() {
{
......
......@@ -55,6 +55,10 @@ final class FujitsuVoltXmlUtilityMock {
public static final String TEST_VOLT_NAMESPACE = TEST_VOLT_NE_OPEN +
TEST_VOLT_NE_NAMESPACE;
public static final int FIRST_PART = 0;
public static final int SECOND_PART = 1;
public static final int THIRD_PART = 2;
public static final int ONE = 1;
private FujitsuVoltXmlUtilityMock() {
}
......