Changeset 29166 in vbox
- Timestamp:
- May 6, 2010 3:27:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/java/tests/TestVBox.java
r29101 r29166 17 17 public class TestVBox 18 18 { 19 public static void main(String[] args) { 19 public static void main(String[] args) 20 { 20 21 VirtualBoxManager mgr = VirtualBoxManager.getInstance(null); 21 22 22 23 System.out.println("\n--> initialized\n"); 23 24 24 try { 25 try 26 { 27 IVirtualBox vbox = mgr.getVBox(); 28 System.out.println("VirtualBox version: " + vbox.getVersion() + "\n"); 25 29 26 IVirtualBox vbox = mgr.getVBox(); 27 28 System.out.println("vers="+vbox.getVersion()); 30 /* list all VMs and print some info for each */ 29 31 IMachine[] machs = vbox.getMachines(null); 30 //IMachine m = vbox.findMachine("SL");31 32 for (IMachine m : machs) 32 33 { 33 System.out.println(" mach="+m.getName()+" RAM="+m.getMemorySize()+"M");34 System.out.println("VM name: " + m.getName() + ", RAM size: " + m.getMemorySize() + "MB"); 34 35 } 35 36 37 /* do something silly, start the first VM in the list */ 36 38 String m = machs[0].getName(); 39 System.out.println("\nAttempting to start VM '" + m + "'"); 37 40 if (mgr.startVm(m, 7000)) 38 41 { … … 44 47 System.out.println("cannot start machine "+m); 45 48 } 46 } catch (Throwable e) { 49 } 50 catch (Throwable e) 51 { 47 52 e.printStackTrace(); 48 53 }
Note:
See TracChangeset
for help on using the changeset viewer.