org.momeunit.ant.emulator
Class Emulator

java.lang.Object
  extended by org.momeunit.ant.core.WtkTool
      extended by org.momeunit.ant.emulator.Emulator
Direct Known Subclasses:
SunEmulator

public abstract class Emulator
extends WtkTool

Abstract base class of all emulators. Extends WtkTool. Contains execute(String, File, File) abstract method that every emulator must implement. Contains device property accessible via setDevice(String) and getDevice() methods.

Version:
1.1.2
Author:
Sergio Morozov

Field Summary
static String DEVICE_PROPERTY
          Name of device property.
 
Constructor Summary
Emulator()
          Instantiates emulator.
Emulator(File wtkHome)
          Instantiates emulator with given WTK home directory.
 
Method Summary
abstract  Process execute(String midletClass, File jad, File jar)
          Abstract method intended to start emulator that every emulator must implement.
 String getDevice()
          Returns the device used when running emulator.
 void setDevice(String device)
          Sets the device used when running emulator.
 
Methods inherited from class org.momeunit.ant.core.WtkTool
addProperties, enumeratePropertyNames, getClasspath, getProperty, getTask, getWtkHome, propertyNames, setClasspath, setProperty, setTask, setWtkHome
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEVICE_PROPERTY

public static final String DEVICE_PROPERTY
Name of device property.

Since:
1.1
See Also:
Constant Field Values
Constructor Detail

Emulator

public Emulator(File wtkHome)
Instantiates emulator with given WTK home directory.

Parameters:
wtkHome - WTK home directory.
Since:
1.1

Emulator

public Emulator()
Instantiates emulator.

Since:
1.1
Method Detail

getDevice

public String getDevice()
Returns the device used when running emulator.

Returns:
used device.
Since:
1.1

setDevice

public void setDevice(String device)
Sets the device used when running emulator.

Parameters:
device - device to use.
Since:
1.1

execute

public abstract Process execute(String midletClass,
                                File jad,
                                File jar)
Abstract method intended to start emulator that every emulator must implement.

Parameters:
midletClass - classname of midlet to start. Can be null.
jad - JAD descriptor of application to run. Can be null.
jar - Jar archive of application to run. Can be null.
Returns:
Process associated with running emulator.
Since:
1.1