Skip to content

Commit aeee1e4

Browse files
committed
fixing line ending in cp and core
1 parent fbf007e commit aeee1e4

3 files changed

Lines changed: 1224 additions & 1224 deletions

File tree

‎core/test/com/cloud/hypervisor/vmware/mo/TestVmwareMO.java‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@
1010
// limitations under the License.
1111
//
1212
// Automatically generated by addcopyright.py at 04/03/2012
13-
package com.cloud.hypervisor.vmware.mo;
14-
13+
package com.cloud.hypervisor.vmware.mo;
14+
1515
import java.util.GregorianCalendar;
1616

17-
import org.apache.log4j.Logger;
18-
17+
import org.apache.log4j.Logger;
18+
1919
import com.cloud.hypervisor.vmware.util.VmwareContext;
2020
import com.cloud.serializer.GsonHelper;
21-
import com.cloud.utils.testcase.Log4jEnabledTestCase;
21+
import com.cloud.utils.testcase.Log4jEnabledTestCase;
2222
import com.google.gson.Gson;
2323
import com.vmware.vim25.DynamicProperty;
2424
import com.vmware.vim25.ManagedObjectReference;
2525
import com.vmware.vim25.ObjectContent;
2626
import com.vmware.vim25.VirtualMachineConfigSpec;
27-
28-
public class TestVmwareMO extends Log4jEnabledTestCase {
27+
28+
public class TestVmwareMO extends Log4jEnabledTestCase {
2929
private static final Logger s_logger = Logger.getLogger(TestVmwareMO.class);
3030

3131
public void test() {
@@ -64,5 +64,5 @@ else if(prop.getName().equals("runtime.bootTime"))
6464
s_logger.error("Unexpected exception : ", e);
6565
}
6666
}
67-
}
68-
67+
}
68+

‎core/test/com/cloud/hypervisor/vmware/util/TestVmwareUtil.java‎

Lines changed: 91 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -10,94 +10,94 @@
1010
// limitations under the License.
1111
//
1212
// Automatically generated by addcopyright.py at 04/03/2012
13-
package com.cloud.hypervisor.vmware.util;
14-
import java.io.File;
15-
16-
import junit.framework.Assert;
17-
18-
import org.apache.log4j.Logger;
19-
20-
import com.cloud.hypervisor.vmware.resource.SshHelper;
21-
import com.cloud.hypervisor.vmware.resource.VmwareContextFactory;
22-
import com.cloud.utils.Pair;
23-
import com.cloud.utils.testcase.Log4jEnabledTestCase;
24-
import com.vmware.vim25.ManagedObjectReference;
25-
26-
public class TestVmwareUtil extends Log4jEnabledTestCase {
27-
private static final Logger s_logger = Logger.getLogger(TestVmwareUtil.class);
28-
29-
public void testContextCreation() {
30-
try {
31-
VmwareContext context = VmwareContextFactory.create("vsphere-1.lab.vmops.com", "Administrator", "Suite219");
32-
Assert.assertTrue(true);
33-
context.close();
34-
} catch(Exception e) {
35-
s_logger.error("Unexpected exception : ", e);
36-
}
37-
}
38-
39-
public void testSearchIndex() {
40-
try {
41-
VmwareContext context = VmwareContextFactory.create("vsphere-1.lab.vmops.com", "Administrator", "Suite219");
42-
Assert.assertTrue(true);
43-
44-
ManagedObjectReference morHost = context.getService().findByDnsName(context.getServiceContent().getSearchIndex(),
45-
null, "esxhost-1.lab.vmops.com", false);
46-
Assert.assertTrue(morHost.getType().equalsIgnoreCase("HostSystem"));
47-
48-
morHost = context.getService().findByIp(context.getServiceContent().getSearchIndex(),
49-
null, "192.168.1.168", false);
50-
Assert.assertTrue(morHost == null);
51-
context.close();
52-
} catch(Exception e) {
53-
s_logger.error("Unexpected exception : ", e);
54-
}
55-
}
56-
57-
public void testVmxFileDownload() {
58-
try {
59-
VmwareContext context = VmwareContextFactory.create("vsphere-1.lab.vmops.com", "Administrator", "Suite219");
60-
byte[] vmxContent = context.getResourceContent("https://vsphere-1.lab.vmops.com/folder/ServerRoom-Fedora32/ServerRoom-Fedora32.vmx?dcPath=cupertino&dsName=NFS%20datastore");
61-
System.out.print(new String(vmxContent));
62-
context.close();
63-
} catch(Exception e) {
64-
s_logger.error("Unexpected exception : ", e);
65-
}
66-
}
67-
68-
public void testVmxFileParser() {
69-
String[] tokens = "[NFS datastore] Fedora-clone-test/Fedora-clone-test.vmx".split("\\[|\\]|/");
70-
71-
for(String str : tokens) {
72-
System.out.println("Token " + str);
73-
}
74-
}
75-
76-
public void testSsh() {
77-
try {
78-
File file = new File("c:\\temp\\id_rsa.kelven");
79-
if(!file.exists()) {
80-
System.out.println("key file does not exist!");
81-
}
82-
83-
Pair<Boolean, String> result = SshHelper.sshExecute("192.168.1.107", 22, "kelven", file, null, "ls -al");
84-
System.out.println("Result: " + result.second());
85-
} catch(Exception e) {
86-
s_logger.error("Unexpected exception : ", e);
87-
}
88-
}
89-
90-
public void testScp() {
91-
try {
92-
File file = new File("c:\\temp\\id_rsa.kelven");
93-
if(!file.exists()) {
94-
System.out.println("key file does not exist!");
95-
}
96-
97-
SshHelper.scpTo("192.168.1.107", 22, "kelven", file, null, "~", "Hello, world".getBytes(),
98-
"hello.txt", null);
99-
} catch(Exception e) {
100-
s_logger.error("Unexpected exception : ", e);
101-
}
102-
}
103-
}
13+
package com.cloud.hypervisor.vmware.util;
14+
import java.io.File;
15+
16+
import junit.framework.Assert;
17+
18+
import org.apache.log4j.Logger;
19+
20+
import com.cloud.hypervisor.vmware.resource.SshHelper;
21+
import com.cloud.hypervisor.vmware.resource.VmwareContextFactory;
22+
import com.cloud.utils.Pair;
23+
import com.cloud.utils.testcase.Log4jEnabledTestCase;
24+
import com.vmware.vim25.ManagedObjectReference;
25+
26+
public class TestVmwareUtil extends Log4jEnabledTestCase {
27+
private static final Logger s_logger = Logger.getLogger(TestVmwareUtil.class);
28+
29+
public void testContextCreation() {
30+
try {
31+
VmwareContext context = VmwareContextFactory.create("vsphere-1.lab.vmops.com", "Administrator", "Suite219");
32+
Assert.assertTrue(true);
33+
context.close();
34+
} catch(Exception e) {
35+
s_logger.error("Unexpected exception : ", e);
36+
}
37+
}
38+
39+
public void testSearchIndex() {
40+
try {
41+
VmwareContext context = VmwareContextFactory.create("vsphere-1.lab.vmops.com", "Administrator", "Suite219");
42+
Assert.assertTrue(true);
43+
44+
ManagedObjectReference morHost = context.getService().findByDnsName(context.getServiceContent().getSearchIndex(),
45+
null, "esxhost-1.lab.vmops.com", false);
46+
Assert.assertTrue(morHost.getType().equalsIgnoreCase("HostSystem"));
47+
48+
morHost = context.getService().findByIp(context.getServiceContent().getSearchIndex(),
49+
null, "192.168.1.168", false);
50+
Assert.assertTrue(morHost == null);
51+
context.close();
52+
} catch(Exception e) {
53+
s_logger.error("Unexpected exception : ", e);
54+
}
55+
}
56+
57+
public void testVmxFileDownload() {
58+
try {
59+
VmwareContext context = VmwareContextFactory.create("vsphere-1.lab.vmops.com", "Administrator", "Suite219");
60+
byte[] vmxContent = context.getResourceContent("https://vsphere-1.lab.vmops.com/folder/ServerRoom-Fedora32/ServerRoom-Fedora32.vmx?dcPath=cupertino&dsName=NFS%20datastore");
61+
System.out.print(new String(vmxContent));
62+
context.close();
63+
} catch(Exception e) {
64+
s_logger.error("Unexpected exception : ", e);
65+
}
66+
}
67+
68+
public void testVmxFileParser() {
69+
String[] tokens = "[NFS datastore] Fedora-clone-test/Fedora-clone-test.vmx".split("\\[|\\]|/");
70+
71+
for(String str : tokens) {
72+
System.out.println("Token " + str);
73+
}
74+
}
75+
76+
public void testSsh() {
77+
try {
78+
File file = new File("c:\\temp\\id_rsa.kelven");
79+
if(!file.exists()) {
80+
System.out.println("key file does not exist!");
81+
}
82+
83+
Pair<Boolean, String> result = SshHelper.sshExecute("192.168.1.107", 22, "kelven", file, null, "ls -al");
84+
System.out.println("Result: " + result.second());
85+
} catch(Exception e) {
86+
s_logger.error("Unexpected exception : ", e);
87+
}
88+
}
89+
90+
public void testScp() {
91+
try {
92+
File file = new File("c:\\temp\\id_rsa.kelven");
93+
if(!file.exists()) {
94+
System.out.println("key file does not exist!");
95+
}
96+
97+
SshHelper.scpTo("192.168.1.107", 22, "kelven", file, null, "~", "Hello, world".getBytes(),
98+
"hello.txt", null);
99+
} catch(Exception e) {
100+
s_logger.error("Unexpected exception : ", e);
101+
}
102+
}
103+
}

0 commit comments

Comments
 (0)