use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class TestMSIService method testGetMSIInstalledFor420Server.
@Test
public void testGetMSIInstalledFor420Server() throws DataGridConnectionRefusedException, DataGridRuleException {
List<String> msis = new ArrayList<>(mlxMSIList);
msis.addAll(irods42MSIs);
msis.addAll(otherMSIList);
when(mockRuleService.execGetMSIsRule(anyString())).thenReturn(msis);
when(irodsServices.isAtLeastIrods420()).thenReturn(true);
DataGridServer server = msiService.getMSIsInstalled("server1.test.com");
assertTrue(server.isThereAnyMSI());
assertMap(mlxMSIList, server.getMetalnxMSIs());
assertMap(irods42MSIs, server.getIRODSMSIs());
assertMap(otherMSIList, server.getOtherMSIs());
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class TestMSIService method testGetMSIInstalledFor41XServer.
@Test
public void testGetMSIInstalledFor41XServer() throws DataGridConnectionRefusedException, DataGridRuleException {
List<String> msis = new ArrayList<>(mlxMSIList);
msis.addAll(irods41XMSIs);
msis.addAll(otherMSIList);
when(mockRuleService.execGetMSIsRule(anyString())).thenReturn(msis);
when(irodsServices.isAtLeastIrods420()).thenReturn(false);
DataGridServer server = msiService.getMSIsInstalled("server1.test.com");
assertTrue(server.isThereAnyMSI());
assertMap(mlxMSIList, server.getMetalnxMSIs());
assertMap(irods41XMSIs, server.getIRODSMSIs());
assertMap(otherMSIList, server.getOtherMSIs());
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class TestMSIService method testOtherMSIInstalledFor420.
@Test
public void testOtherMSIInstalledFor420() throws DataGridConnectionRefusedException, DataGridRuleException {
when(mockRuleService.execGetMSIsRule(anyString())).thenReturn(otherMSIList);
when(irodsServices.isAtLeastIrods420()).thenReturn(true);
DataGridServer server = msiService.getMSIsInstalled("server1.test.com");
assertTrue(server.isThereAnyMSI());
assertMap(otherMSIList, server.getOtherMSIs());
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class TestMSIService method testNoOtherMSIListed.
@Test
public void testNoOtherMSIListed() throws DataGridConnectionRefusedException, DataGridRuleException {
String testMSI = "libmsitest_installed.so";
List<String> otherMSIListWithEmptyString = new ArrayList<>();
otherMSIListWithEmptyString.add("");
otherMSIListWithEmptyString.add(testMSI);
when(irodsServices.isAtLeastIrods420()).thenReturn(false);
when(mockRuleService.execGetMSIsRule(anyString())).thenReturn(otherMSIListWithEmptyString);
when(mockConfigService.getOtherMSIsExpected()).thenReturn(otherMSIListWithEmptyString);
DataGridServer server = msiService.getMSIsInstalled("server1.test.com");
assertTrue(server.isThereAnyMSI());
assertFalse(server.getOtherMSIs().isEmpty());
assertEquals(1, server.getOtherMSIs().size());
assertTrue(server.getOtherMSIs().containsKey(testMSI));
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class TestMSIService method setUp.
@Before
public void setUp() throws JargonException, DataGridException {
MockitoAnnotations.initMocks(this);
DataGridServer s1 = new DataGridServer();
s1.setHostname("server1.test.com");
s1.setMSIVersion(msiVersion);
s1.setIp("192.168.0.1");
s1.setResources(new ArrayList<>());
DataGridServer s2 = new DataGridServer();
s2.setHostname("server2.test.com");
s2.setMSIVersion(msiVersion);
s2.setIp("192.168.0.2");
s2.setResources(new ArrayList<>());
servers.add(s1);
servers.add(s2);
when(mockResourceService.getAllResourceServers(anyListOf(DataGridResource.class))).thenReturn(servers);
when(mockRuleService.execGetVersionRule(anyString())).thenReturn(msiVersion);
when(mockRuleService.execGetMSIsRule(anyString())).thenReturn(msiList);
when(mockConfigService.getMlxMSIsExpected()).thenReturn(mlxMSIList);
when(mockConfigService.getIrods41MSIsExpected()).thenReturn(irods41XMSIs);
when(mockConfigService.getIrods42MSIsExpected()).thenReturn(irods42MSIs);
when(mockConfigService.getOtherMSIsExpected()).thenReturn(otherMSIList);
}
Aggregations