import java.util.List;
import javax.management.InstanceAlreadyExistsException;
import javax.management.ObjectName;
-import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.controller.config.api.IdentityAttributeRef;
import org.opendaylight.controller.config.api.ValidationException;
private static final String FACTORY_NAME = BGPPeerModuleFactory.NAME;
private static final IpAddress HOST = new IpAddress(new Ipv4Address("127.0.0.1"));
- private static final PortNumber portNumber = new PortNumber(1);
+ private static final PortNumber PORT_NUMBER = new PortNumber(1);
@Override
protected BindingRuntimeContext getBindingRuntimeContext() {
@Test
public void testValidationExceptionHostNotSet() throws Exception {
try {
- createBgpPeerInstance(null, portNumber, false);
+ createBgpPeerInstance(null, PORT_NUMBER, false);
fail();
} catch (final ValidationException e) {
assertTrue(e.getMessage().contains("Host value is not set."));
}
private CommitStatus createBgpPeerInstance(final boolean md5) throws Exception {
- return createBgpPeerInstance(HOST, portNumber, md5);
+ return createBgpPeerInstance(HOST, PORT_NUMBER, md5);
}
private CommitStatus createBgpPeerInstance(final IpAddress host, final PortNumber port, final boolean md5) throws Exception {
private CommitStatus createInternalBgpPeerInstance()
throws Exception {
final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
- createBgpPeerInstance(transaction, HOST, portNumber, false, true);
+ createBgpPeerInstance(transaction, HOST, PORT_NUMBER, false, true);
return transaction.commit();
}
}