| testRefactor |
Scenario: Refactor Test
The classes TestRefactor and ITestRefactor are designed to exercise the refactored stream io classes.
These test programs create an instance of RandomAccessFile and write a series of double precision values, int values, char values and strings to a data file.
Write methods in the interface DataOutput whose code appears in the implementation OutputCode are thus tested.
The data file is then closed and re-opened as an instance of DataInputStream. All of the data is read, using methods specified in the interface DataInput, whose code appears in the implementation InputCode, with help from a few methods that remain in DataInputStream.
Again, the data is written to a file, this time using an instance of DataOuputStream. Write methods specified in DataOutput and implemented in OuputCode are tested.
Finally, this file is read using an instance of RandomAccessFile, testing methods specified in DataInput and implemented in InputCode.
The difference between the TestRefactor and ITestRefactor is the static type of the receiver object:
1.When the static type of the receiver for the read/write operations is a
class, we execute TestRefactor.
2.When the static type of the receiver for the read/write operations is an
interface (DataInput for the DataInputStream instance, DataOutput for the
DataOutputStream instance), we execute ITestRefactor.
COMPILATION:
     mcijavac -bootclasspath mcirt.jar *.java
Note: If your CLASSPATH is not set to include the directory mciJVM/build/linux/classes, you can use the following command instead:
     mcijavac -bootclasspath mcirt.jar:/jvmPath/mciJVM/build/linux/classes *.java
where jvmPath represents the absolute path that includes the mciJVM directory.
EXECUTION:
     mcijava -Xbootclasspath/p:mcirt.jar TestRefactor
     mcijava -Xbootclasspath/p:mcirt.jar ITestRefactor
Note: If your CLASSPATH is not set to include the directory mciJVM/build/linux/classes, you can use the following command instead:
mcijava -Xbootclasspath/p:mcirt.jar:jvmPath/mciJVM/build/linux/classes
TestRefactor
mcijava -Xbootclasspath/p:mcirt.jar:jvmPath/mciJVM/build/linux/classes
ITestRefactor
To untar the tar.gz files:
     tar -xzvf mciJVM.tar.gz
     tar -xzvf scenarios.tar.gz
The mcirt.jar with the refactored io clases is included in scenarios.tar.gz and it can be found in the scenarios/testRefactor folder.
|