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
Showing
7 changed files
with
15 additions
and
14 deletions
This diff is collapsed. Click to expand it.
... | @@ -79,13 +79,8 @@ public class FujitsuVoltPonLinkConfig extends AbstractHandlerBehaviour | ... | @@ -79,13 +79,8 @@ public class FujitsuVoltPonLinkConfig extends AbstractHandlerBehaviour |
79 | private static final int LOF_THRESHOLD_MAX = 10; | 79 | private static final int LOF_THRESHOLD_MAX = 10; |
80 | private static final int LOS_THRESHOLD_MIN = 1; | 80 | private static final int LOS_THRESHOLD_MIN = 1; |
81 | private static final int LOS_THRESHOLD_MAX = 10; | 81 | private static final int LOS_THRESHOLD_MAX = 10; |
82 | - private static final int FIRST_PART = 0; | ||
83 | - private static final int SECOND_PART = 1; | ||
84 | - private static final int THIRD_PART = 2; | ||
85 | private static final int RANGE_MIN = 0; | 82 | private static final int RANGE_MIN = 0; |
86 | private static final int RANGE_MAX = 1; | 83 | private static final int RANGE_MAX = 1; |
87 | - private static final int ZERO = 0; | ||
88 | - private static final int THREE = 3; | ||
89 | 84 | ||
90 | @Override | 85 | @Override |
91 | public String getPonLinks(String target) { | 86 | public String getPonLinks(String target) { |
... | @@ -100,7 +95,7 @@ public class FujitsuVoltPonLinkConfig extends AbstractHandlerBehaviour | ... | @@ -100,7 +95,7 @@ public class FujitsuVoltPonLinkConfig extends AbstractHandlerBehaviour |
100 | log.warn("Not master for {} Use {} to execute command", | 95 | log.warn("Not master for {} Use {} to execute command", |
101 | ncDeviceId, | 96 | ncDeviceId, |
102 | mastershipService.getMasterFor(ncDeviceId)); | 97 | mastershipService.getMasterFor(ncDeviceId)); |
103 | - return reply; | 98 | + return null; |
104 | } | 99 | } |
105 | 100 | ||
106 | try { | 101 | try { |
... | @@ -114,11 +109,11 @@ public class FujitsuVoltPonLinkConfig extends AbstractHandlerBehaviour | ... | @@ -114,11 +109,11 @@ public class FujitsuVoltPonLinkConfig extends AbstractHandlerBehaviour |
114 | pon = Integer.parseInt(target); | 109 | pon = Integer.parseInt(target); |
115 | if (pon <= ZERO) { | 110 | if (pon <= ZERO) { |
116 | log.error("Invalid integer for ponlink-id:{}", target); | 111 | log.error("Invalid integer for ponlink-id:{}", target); |
117 | - return reply; | 112 | + return null; |
118 | } | 113 | } |
119 | } catch (NumberFormatException e) { | 114 | } catch (NumberFormatException e) { |
120 | log.error("Non-number input for ponlink-id:{}", target); | 115 | log.error("Non-number input for ponlink-id:{}", target); |
121 | - return reply; | 116 | + return null; |
122 | } | 117 | } |
123 | request.append(buildStartTag(GPON_PONLINK_PORTS)); | 118 | request.append(buildStartTag(GPON_PONLINK_PORTS)); |
124 | request.append(buildStartTag(GPON_PONLINK_PORT)); | 119 | request.append(buildStartTag(GPON_PONLINK_PORT)); | ... | ... |
... | @@ -42,6 +42,14 @@ public final class FujitsuVoltXmlUtility { | ... | @@ -42,6 +42,14 @@ public final class FujitsuVoltXmlUtility { |
42 | public static final String VOLT_NE_OPEN = ANGLE_LEFT + VOLT_NE + SPACE; | 42 | public static final String VOLT_NE_OPEN = ANGLE_LEFT + VOLT_NE + SPACE; |
43 | public static final String VOLT_NE_CLOSE = ANGLE_LEFT + SLASH + VOLT_NE + ANGLE_RIGHT; | 43 | public static final String VOLT_NE_CLOSE = ANGLE_LEFT + SLASH + VOLT_NE + ANGLE_RIGHT; |
44 | 44 | ||
45 | + public static final int FIRST_PART = 0; | ||
46 | + public static final int SECOND_PART = 1; | ||
47 | + public static final int THIRD_PART = 2; | ||
48 | + public static final int ZERO = 0; | ||
49 | + public static final int ONE = 1; | ||
50 | + public static final int TWO = 2; | ||
51 | + public static final int THREE = 3; | ||
52 | + | ||
45 | private FujitsuVoltXmlUtility() { | 53 | private FujitsuVoltXmlUtility() { |
46 | // Preventing any allocation | 54 | // Preventing any allocation |
47 | } | 55 | } | ... | ... |
... | @@ -52,9 +52,6 @@ public class FujitsuVoltControllerConfigTest { | ... | @@ -52,9 +52,6 @@ public class FujitsuVoltControllerConfigTest { |
52 | private static final String TEST_VOLT_OFCONFIG = "volt-ofconfig"; | 52 | private static final String TEST_VOLT_OFCONFIG = "volt-ofconfig"; |
53 | private static final String TEST_OFCONFIG_ID = "ofconfig-id"; | 53 | private static final String TEST_OFCONFIG_ID = "ofconfig-id"; |
54 | private static final String TEST_END_LICENSE_HEADER = "-->"; | 54 | private static final String TEST_END_LICENSE_HEADER = "-->"; |
55 | - private static final int FIRST_PART = 0; | ||
56 | - private static final int SECOND_PART = 1; | ||
57 | - private static final int THIRD_PART = 2; | ||
58 | 55 | ||
59 | private static final Map<Integer, String> GET_CONTROLLERS = new HashMap<Integer, String>() { | 56 | private static final Map<Integer, String> GET_CONTROLLERS = new HashMap<Integer, String>() { |
60 | { | 57 | { | ... | ... |
drivers/fujitsu/src/test/java/org/onosproject/drivers/fujitsu/FujitsuVoltOnuConfigTest.java
0 → 100644
This diff is collapsed. Click to expand it.
... | @@ -42,9 +42,6 @@ public class FujitsuVoltPonLinkConfigTest { | ... | @@ -42,9 +42,6 @@ public class FujitsuVoltPonLinkConfigTest { |
42 | private static final String TEST_VOLT_PORTS = "volt-ports"; | 42 | private static final String TEST_VOLT_PORTS = "volt-ports"; |
43 | private static final String TEST_GPON_PONLINK_PORTS = "gpon-ponlink-ports"; | 43 | private static final String TEST_GPON_PONLINK_PORTS = "gpon-ponlink-ports"; |
44 | private static final String TEST_GPON_PONLINK_PORT = "gpon-ponlink-port"; | 44 | private static final String TEST_GPON_PONLINK_PORT = "gpon-ponlink-port"; |
45 | - private static final int FIRST_PART = 0; | ||
46 | - private static final int SECOND_PART = 1; | ||
47 | - private static final int THIRD_PART = 2; | ||
48 | 45 | ||
49 | private static final Map<Integer, String> INVALID_GET_TCS = new HashMap<Integer, String>() { | 46 | private static final Map<Integer, String> INVALID_GET_TCS = new HashMap<Integer, String>() { |
50 | { | 47 | { | ... | ... |
... | @@ -55,6 +55,10 @@ final class FujitsuVoltXmlUtilityMock { | ... | @@ -55,6 +55,10 @@ final class FujitsuVoltXmlUtilityMock { |
55 | public static final String TEST_VOLT_NAMESPACE = TEST_VOLT_NE_OPEN + | 55 | public static final String TEST_VOLT_NAMESPACE = TEST_VOLT_NE_OPEN + |
56 | TEST_VOLT_NE_NAMESPACE; | 56 | TEST_VOLT_NE_NAMESPACE; |
57 | 57 | ||
58 | + public static final int FIRST_PART = 0; | ||
59 | + public static final int SECOND_PART = 1; | ||
60 | + public static final int THIRD_PART = 2; | ||
61 | + public static final int ONE = 1; | ||
58 | 62 | ||
59 | private FujitsuVoltXmlUtilityMock() { | 63 | private FujitsuVoltXmlUtilityMock() { |
60 | } | 64 | } | ... | ... |
-
Please register or login to post a comment