TestVBox.java revision d331c1c91fc1c4b9f019b9824e7dd9c2cdf804c0
/* $Id:$ */
/*
* Copyright (C) 2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
import org.virtualbox_3_3.*;
public class TestVBox
{
{
switch (type)
{
case OnMachineStateChanged:
{
else
break;
}
}
}
static class EventHandler
{
EventHandler() {}
{
try {
} catch (Throwable t) {
t.printStackTrace();
}
}
}
{
// active mode for Java doesn't fully work yet, and using passive
// is more portable (the only mode for MSCOM and WS) and thus generally
// recommended
try {
for (int i=0; i<100; i++)
{
{
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
{
{
}
}
{
}
static void testMultiServer()
{
try {
} finally {
}
}
/*
static void testReadLogBI(VirtualBoxManager mgr, IVirtualBox vbox)
{
IMachine m = vbox.getMachines().get(0);
long logNo = 0;
BigInteger off = BigInteger.valueOf(0);
BigInteger size = BigInteger.valueOf(16 * 1024);
while (true)
{
byte[] buf = m.readLog(logNo, off, size);
if (buf.length == 0)
break;
System.out.print(new String(buf));
off.add(BigInteger.valueOf(buf.length));
}
}
static void testReadLog(VirtualBoxManager mgr, IVirtualBox vbox)
{
IMachine m = vbox.getMachines().get(0);
long logNo = 0;
long off = 0;
long size = 16 * 1024;
while (true)
{
byte[] buf = m.readLog(logNo, off, size);
if (buf.length == 0)
break;
System.out.print(new String(buf));
off += buf.length;
}
}
*/
{
boolean ws = false;
{
ws = true;
}
if (ws)
{
try {
} catch (VBoxException e) {
e.printStackTrace();
}
}
try
{
{
//testReadLog(mgr, vbox);
}
}
catch (VBoxException e)
{
e.printStackTrace();
}
{
e.printStackTrace();
}
if (ws)
{
try {
mgr.disconnect();
} catch (VBoxException e) {
e.printStackTrace();
}
}
}
}