Skip to content

Commit 76a9b93

Browse files
Cleanups and formatting
1 parent 7d9b7d1 commit 76a9b93

9 files changed

Lines changed: 148 additions & 232 deletions

File tree

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,16 +2271,11 @@ public HostStatsEntry getHostStats(final Connection conn, final GetHostStatsComm
22712271
}
22722272

22732273
protected HashMap<String, HostVmStateReportEntry> getHostVmStateReport(final Connection conn) {
2274-
2275-
// TODO : new VM sync model does not require a cluster-scope report, we
2276-
// need to optimize
2277-
// the report accordingly
22782274
final HashMap<String, HostVmStateReportEntry> vmStates = new HashMap<String, HostVmStateReportEntry>();
22792275
Map<VM, VM.Record> vm_map = null;
22802276
for (int i = 0; i < 2; i++) {
22812277
try {
2282-
vm_map = VM.getAllRecords(conn); // USE THIS TO GET ALL VMS FROM
2283-
// A CLUSTER
2278+
vm_map = VM.getAllRecords(conn);
22842279
break;
22852280
} catch (final Throwable e) {
22862281
s_logger.warn("Unable to get vms", e);

plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/Xenserver625StorageProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private void mountNfs(Connection conn, String remoteDir, String localDir) {
7575
}
7676
String result = hypervisorResource.callHostPluginAsync(conn, "cloud-plugin-storage", "mountNfsSecondaryStorage", 100 * 1000, "localDir", localDir, "remoteDir", remoteDir);
7777
if (StringUtils.isBlank(result)) {
78-
final String errMsg = "Could not mount secondary storage " + remoteDir + " on host " + localDir;
78+
String errMsg = "Could not mount secondary storage " + remoteDir + " on host " + localDir;
7979
s_logger.warn(errMsg);
8080
throw new CloudRuntimeException(errMsg);
8181
}

plugins/hypervisors/xenserver/src/test/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBaseTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public void actualIsoTemplateTestXenServer71() throws XenAPIException, XmlRpcExc
181181

182182
Assert.assertEquals("guest-tools.iso", returnedIsoTemplateName);
183183
}
184-
184+
185185
@Test
186186
public void getAllLocalSrForTypeTest() throws Exception {
187187
String mockHostUuid = "hostUuid";
@@ -226,14 +226,14 @@ public void getAllLocalSrForTypeTest() throws Exception {
226226
Assert.assertEquals(expectedListOfSrs.size(), allLocalSrForType.size());
227227
Assert.assertEquals(expectedListOfSrs.get(0), allLocalSrForType.get(0));
228228
}
229-
229+
230230
@Test
231231
public void getAllLocalSrForTypeNoSrsFoundTest() throws XenAPIException, XmlRpcException {
232232
Connection connectionMock = Mockito.mock(Connection.class);
233233
List<SR> allLocalSrForType = citrixResourceBase.getAllLocalSrForType(connectionMock, SRType.EXT);
234234
Assert.assertTrue(allLocalSrForType.isEmpty());
235235
}
236-
236+
237237
@Test
238238
public void getAllLocalSrsTest() throws XenAPIException, XmlRpcException {
239239
Connection connectionMock = Mockito.mock(Connection.class);
@@ -259,7 +259,6 @@ public void getAllLocalSrsTest() throws XenAPIException, XmlRpcException {
259259
inOrder.verify(citrixResourceBase).getAllLocalSrForType(connectionMock, SRType.EXT);
260260
}
261261

262-
263262
@Test
264263
public void createStoragePoolInfoTest() throws XenAPIException, XmlRpcException {
265264
Connection connectionMock = Mockito.mock(Connection.class);
@@ -343,7 +342,7 @@ public void createStartUpStorageCommandTest() throws XenAPIException, XmlRpcExce
343342
Assert.assertEquals(citrixResourceBase._dcId + "", startUpStorageCommand.getDataCenter());
344343
Assert.assertEquals(StorageResourceType.STORAGE_POOL, startUpStorageCommand.getResourceType());
345344
}
346-
345+
347346
@Test
348347
public void initializeLocalSrTest() throws XenAPIException, XmlRpcException {
349348
Connection connectionMock = Mockito.mock(Connection.class);

plugins/hypervisors/xenserver/src/test/java/com/cloud/hypervisor/xenserver/resource/XcpOssResourceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public void testPatchFilePath() {
4242
}
4343

4444
@Test(expected = CloudRuntimeException.class)
45-
public void testGetFiles(){
45+
public void testGetFiles() {
4646
testGetPathFilesExeption();
4747
}
4848

4949
@Test
50-
public void testGetFilesListReturned(){
50+
public void testGetFilesListReturned() {
5151
testGetPathFilesListReturned();
5252
}
5353
}

plugins/hypervisors/xenserver/src/test/java/com/cloud/hypervisor/xenserver/resource/XcpServerResourceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public void testPatchFilePath() {
4242
}
4343

4444
@Test(expected = CloudRuntimeException.class)
45-
public void testGetFilesExeption(){
45+
public void testGetFilesExeption() {
4646
testGetPathFilesExeption();
4747
}
4848

4949
@Test
50-
public void testGetFilesListReturned(){
50+
public void testGetFilesListReturned() {
5151
testGetPathFilesListReturned();
5252
}
5353
}

plugins/hypervisors/xenserver/src/test/java/com/cloud/hypervisor/xenserver/resource/XenServer56FP1ResourceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public void testPatchFilePath() {
4242
}
4343

4444
@Test(expected = CloudRuntimeException.class)
45-
public void testGetFiles(){
45+
public void testGetFiles() {
4646
testGetPathFilesExeption();
4747
}
4848

4949
@Test
50-
public void testGetFilesListReturned(){
50+
public void testGetFilesListReturned() {
5151
testGetPathFilesListReturned();
5252
}
5353
}

plugins/hypervisors/xenserver/src/test/java/com/cloud/hypervisor/xenserver/resource/XenServer56ResourceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public void testPatchFilePath() {
4242
}
4343

4444
@Test(expected = CloudRuntimeException.class)
45-
public void testGetFiles(){
45+
public void testGetFiles() {
4646
testGetPathFilesExeption();
4747
}
4848

4949
@Test
50-
public void testGetFilesListReturned(){
50+
public void testGetFilesListReturned() {
5151
testGetPathFilesListReturned();
5252
}
5353
}

0 commit comments

Comments
 (0)