use of com.emc.storageos.cimadapter.connections.cim.CimConnectionInfo in project coprhd-controller by CoprHD.
the class EcomIndicationProcessorTest method createConnectionInfo.
/**
* Creates the connection info for the connection.
*
* @return The connection info for the connection
*/
private CimConnectionInfo createConnectionInfo() {
CimConnectionInfo connectionInfo = new CimConnectionInfo();
connectionInfo.setType(CimConstants.ECOM_CONNECTION_TYPE);
connectionInfo.setHost(PROVIDER_IP);
connectionInfo.setPort(Integer.parseInt(PROVIDER_PORT));
connectionInfo.setUser(PROVIDER_USER);
connectionInfo.setPassword(PROVIDER_PW);
connectionInfo.setInteropNS(PROVIDER_INTEROP_NS);
connectionInfo.setImplNS(PROVIDER_IMPL_NS);
connectionInfo.setUseSSL(isProviderSslEnabled);
return connectionInfo;
}
use of com.emc.storageos.cimadapter.connections.cim.CimConnectionInfo in project coprhd-controller by CoprHD.
the class ConnectionManagerTest method testIsConnectedConnected.
/**
* Tests the isConnected method when passed host is not connected.
*/
@Test
public void testIsConnectedConnected() {
Assert.assertNotNull(_connectionManager);
// Create the connection info.
CimConnectionInfo connectionInfo = new CimConnectionInfo();
connectionInfo.setType(CimConstants.ECOM_CONNECTION_TYPE);
connectionInfo.setHost(PROVIDER_IP);
connectionInfo.setPort(PROVIDER_PORT);
connectionInfo.setUser(PROVIDER_USER);
connectionInfo.setPassword(PROVIDER_PWD);
connectionInfo.setInteropNS(PROVIDER_INTEROP_NS);
connectionInfo.setImplNS(BLOCK_PROVIDER_IMPL_NS);
connectionInfo.setUseSSL(Boolean.parseBoolean(providerUseSsl));
// Add the connection.
boolean wasException = false;
try {
_connectionManager.addConnection(connectionInfo);
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
// Assert the provider is connected.
try {
Assert.assertTrue(_connectionManager.isConnected(PROVIDER_IP));
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
// Remove the connection.
try {
_connectionManager.removeConnection(PROVIDER_IP);
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
}
use of com.emc.storageos.cimadapter.connections.cim.CimConnectionInfo in project coprhd-controller by CoprHD.
the class ConnectionManagerTest method testRemoveConnectionConnected.
/**
* Tests the removeConnection method when passed host is connected.
*/
@Test
public void testRemoveConnectionConnected() {
Assert.assertNotNull(_connectionManager);
// Create the connection info.
CimConnectionInfo connectionInfo = new CimConnectionInfo();
connectionInfo.setType(CimConstants.ECOM_CONNECTION_TYPE);
connectionInfo.setHost(PROVIDER_IP);
connectionInfo.setPort(PROVIDER_PORT);
connectionInfo.setUser(PROVIDER_USER);
connectionInfo.setPassword(PROVIDER_PWD);
connectionInfo.setInteropNS(PROVIDER_INTEROP_NS);
connectionInfo.setImplNS(BLOCK_PROVIDER_IMPL_NS);
connectionInfo.setUseSSL(Boolean.parseBoolean(providerUseSsl));
// Add the connection.
boolean wasException = false;
try {
_connectionManager.addConnection(connectionInfo);
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
// Assert the provider is connected.
try {
Assert.assertTrue(_connectionManager.isConnected(PROVIDER_IP));
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
// Remove the connection.
try {
_connectionManager.removeConnection(PROVIDER_IP);
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
// Assert the provider is no longer connected.
try {
Assert.assertFalse(_connectionManager.isConnected(PROVIDER_IP));
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
}
use of com.emc.storageos.cimadapter.connections.cim.CimConnectionInfo in project coprhd-controller by CoprHD.
the class ConnectionManagerTest method testAddConnectionInvalidConnectionType.
/**
* Tests the addConnection method when the connection type is not valid.
*/
@Test
public void testAddConnectionInvalidConnectionType() {
Assert.assertNotNull(_connectionManager);
// Create the connection info.
CimConnectionInfo connectionInfo = new CimConnectionInfo();
connectionInfo.setType(INVALID_CONN_TYPE);
connectionInfo.setHost(PROVIDER_IP);
connectionInfo.setPort(PROVIDER_PORT);
connectionInfo.setUser(PROVIDER_USER);
connectionInfo.setPassword(PROVIDER_PWD);
connectionInfo.setInteropNS(PROVIDER_INTEROP_NS);
connectionInfo.setImplNS(BLOCK_PROVIDER_IMPL_NS);
connectionInfo.setUseSSL(Boolean.parseBoolean(providerUseSsl));
// Add the connection.
boolean wasException = false;
try {
_connectionManager.addConnection(connectionInfo);
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertTrue(wasException);
// Assert the provider is not connected.
wasException = false;
try {
Assert.assertFalse(_connectionManager.isConnected(PROVIDER_IP));
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
}
use of com.emc.storageos.cimadapter.connections.cim.CimConnectionInfo in project coprhd-controller by CoprHD.
the class ConnectionManagerTest method testAddConnectionCIM.
/**
* Tests the addConnection method for a generic CIM connection type.
*/
@Test
public void testAddConnectionCIM() {
Assert.assertNotNull(_connectionManager);
// Create the connection info.
CimConnectionInfo connectionInfo = new CimConnectionInfo();
connectionInfo.setType(CimConstants.CIM_CONNECTION_TYPE);
connectionInfo.setHost(PROVIDER_IP);
connectionInfo.setPort(PROVIDER_PORT);
connectionInfo.setUser(PROVIDER_USER);
connectionInfo.setPassword(PROVIDER_PWD);
connectionInfo.setInteropNS(PROVIDER_INTEROP_NS);
connectionInfo.setImplNS(BLOCK_PROVIDER_IMPL_NS);
connectionInfo.setUseSSL(Boolean.parseBoolean(providerUseSsl));
// Add the connection.
boolean wasException = false;
try {
_connectionManager.addConnection(connectionInfo);
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
// Assert the provider is connected.
try {
Assert.assertTrue(_connectionManager.isConnected(PROVIDER_IP));
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
// Clean up by removing the connection.
try {
_connectionManager.removeConnection(PROVIDER_IP);
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
// Assert the provider is no longer connected.
try {
Assert.assertFalse(_connectionManager.isConnected(PROVIDER_IP));
} catch (ConnectionManagerException e) {
wasException = true;
}
Assert.assertFalse(wasException);
}
Aggregations