From: <fd...@us...> - 2009-02-28 12:52:54
|
Revision: 5069 http://jnode.svn.sourceforge.net/jnode/?rev=5069&view=rev Author: fduminy Date: 2009-02-28 12:45:32 +0000 (Sat, 28 Feb 2009) Log Message: ----------- added javadoc Modified Paths: -------------- trunk/distr/src/apps/org/jnode/apps/telnetd/JNodeCommandShell.java trunk/distr/src/apps/org/jnode/apps/telnetd/JNodeShell.java trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteConsoleManager.java trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteKeyboardHandler.java trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteTextScreen.java trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteTextScreenManager.java trunk/distr/src/apps/org/jnode/apps/telnetd/TelnetServerCommand.java trunk/distr/src/apps/org/jnode/apps/telnetd/TelnetUtils.java trunk/distr/src/apps/org/jnode/games/rubik/Rubik.java trunk/distr/src/test/org/jnode/apps/jpartition/utils/device/DeviceUtils.java trunk/distr/src/test/org/jnode/apps/vmware/disk/test/BaseTest.java trunk/distr/src/test/org/jnode/apps/vmware/disk/test/TestCreation.java trunk/distr/src/test/org/jnode/apps/vmware/disk/test/Utils.java trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/BaseReadWriteTest.java trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/TestHeader.java trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/TestVMWareDisk.java Modified: trunk/distr/src/apps/org/jnode/apps/telnetd/JNodeCommandShell.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/telnetd/JNodeCommandShell.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/apps/org/jnode/apps/telnetd/JNodeCommandShell.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -39,12 +39,18 @@ // this.shell = shell; // } + /** + * Construct a JNode command shell for the telnet daemon. + */ public JNodeCommandShell(TextConsole cons, JNodeShell shell) throws ShellException { super(cons); this.shell = shell; System.err.println("JNodeCommandShell"); } + /** + * Exit the JNode command shell for the telnet daemon. + */ @Override public void exit() { shell.close(); Modified: trunk/distr/src/apps/org/jnode/apps/telnetd/JNodeShell.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/telnetd/JNodeShell.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/apps/org/jnode/apps/telnetd/JNodeShell.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -57,7 +57,7 @@ // private Editfield m_EF; /** - * Method that runs a shell + * Method that runs a shell. * * @param con Connection that runs the shell. */ @@ -244,7 +244,10 @@ } } - // this implements the ConnectionListener! + /** + * this implements the ConnectionListener! + * @param ce + */ public void connectionTimedOut(ConnectionEvent ce) { try { terminalIO.write("CONNECTION_TIMEDOUT"); @@ -257,6 +260,9 @@ } }// connectionTimedOut + /** + * @param ce + */ public void connectionIdle(ConnectionEvent ce) { try { terminalIO.write("CONNECTION_IDLE"); @@ -267,6 +273,9 @@ }// connectionIdle + /** + * @param ce + */ public void connectionLogoutRequest(ConnectionEvent ce) { try { terminalIO.write("CONNECTION_LOGOUTREQUEST"); @@ -277,6 +286,9 @@ } }// connectionLogout + /** + * @param ce + */ public void connectionSentBreak(ConnectionEvent ce) { try { terminalIO.write("CONNECTION_BREAK"); @@ -287,6 +299,10 @@ } }// connectionSentBreak + /** + * Create a Shell instance for JNode telnet daemon. + * @return + */ public static Shell createShell() { return new JNodeShell(); }// createShell Modified: trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteConsoleManager.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteConsoleManager.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteConsoleManager.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -39,11 +39,21 @@ private final RemoteTextScreenManager textScreenManager; private TerminalIO terminalIO; + /** + * Construct a manager for remote consoles. + * + * @throws ConsoleException + */ public RemoteConsoleManager() throws ConsoleException { super(); this.textScreenManager = new RemoteTextScreenManager(); } + /** + * Define the actual terminal. + * + * @param terminalIO + */ public void setTerminalIO(TerminalIO terminalIO) { this.terminalIO = terminalIO; } Modified: trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteKeyboardHandler.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteKeyboardHandler.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteKeyboardHandler.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -36,6 +36,11 @@ public class RemoteKeyboardHandler extends KeyboardHandler { private final RemoteKeyBoardEventReader kbReader; + /** + * Construct a remote keyboard handler for the given terminal. + * + * @param terminalIO + */ public RemoteKeyboardHandler(BasicTerminalIO terminalIO) { System.err.println("RemoteKeyboardHandler"); @@ -43,6 +48,9 @@ kbReader.start(); } + /** + * {@inheritDoc} + */ @Override public void close() throws IOException { kbReader.close(); Modified: trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteTextScreen.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteTextScreen.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteTextScreen.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -38,6 +38,11 @@ private final char[] buffer; private int cursorOffset; + /** + * Construct a remote text screen for the given terminal. + * + * @param terminalIO + */ public RemoteTextScreen(TerminalIO terminalIO) { super(terminalIO.getColumns(), terminalIO.getRows()); this.terminalIO = terminalIO; @@ -67,24 +72,39 @@ sync(0, buffer.length); } + /** + * {@inheritDoc} + */ public void copyContent(int srcOffset, int destOffset, int length) { System.arraycopy(buffer, srcOffset * 2, buffer, destOffset * 2, length * 2); sync(destOffset * 2, length * 2); } + /** + * {@inheritDoc} + */ public void copyTo(TextScreen dst, int offset, int length) { // TODO Auto-generated method stub } + /** + * {@inheritDoc} + */ public char getChar(int offset) { return buffer[offset]; } + /** + * {@inheritDoc} + */ public int getColor(int offset) { return 0; } + /** + * {@inheritDoc} + */ public void set(int offset, char ch, int count, int color) { buffer[offset] = getCharacter(ch); sync(offset, 1); @@ -95,6 +115,9 @@ return (c == 0) ? ' ' : c; } + /** + * {@inheritDoc} + */ public void set(int offset, char[] ch, int chOfs, int length, int color) { char[] cha = new char[ch.length]; for (int i = 0; i < cha.length; i++) { @@ -104,10 +127,16 @@ sync(offset, length); } + /** + * {@inheritDoc} + */ public void set(int offset, char[] ch, int chOfs, int length, int[] colors, int colorsOfs) { set(offset, ch, chOfs, length, 0); } + /** + * {@inheritDoc} + */ public int setCursor(int x, int y) { try { terminalIO.setCursor(y, x); @@ -119,11 +148,17 @@ return cursorOffset; } + /** + * {@inheritDoc} + */ public int setCursorVisible(boolean visible) { // ignore : cursor will allways be visible return cursorOffset; } + /** + * {@inheritDoc} + */ public void sync(int offset, int length) { try { final int y = offset / getWidth(); Modified: trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteTextScreenManager.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteTextScreenManager.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/apps/org/jnode/apps/telnetd/RemoteTextScreenManager.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -28,6 +28,7 @@ import org.jnode.driver.textscreen.TextScreenManager; /** + * Implementation of the {@link TextScreenManager} interface for the telnet daemon. * * @author Fabien DUMINY (fduminy at jnode.org) * @@ -37,6 +38,10 @@ new HashMap<TerminalIO, RemoteTextScreen>(); private TerminalIO terminalIO; + /** + * Define the actual terminal used to sent textscreen data. + * @param terminalIO + */ public void setTerminalIO(TerminalIO terminalIO) { this.terminalIO = terminalIO; } Modified: trunk/distr/src/apps/org/jnode/apps/telnetd/TelnetServerCommand.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/telnetd/TelnetServerCommand.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/apps/org/jnode/apps/telnetd/TelnetServerCommand.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -26,11 +26,17 @@ import net.wimpi.telnetd.TelnetD; /** + * This is the command used to start the telnet daemon. * * @author Fabien DUMINY (fduminy at jnode.org) * */ public class TelnetServerCommand { + /** + * Main method. + * @param args not used + * @throws Exception + */ public static void main(String[] args) throws Exception { try { // 1. prepare daemon Modified: trunk/distr/src/apps/org/jnode/apps/telnetd/TelnetUtils.java =================================================================== --- trunk/distr/src/apps/org/jnode/apps/telnetd/TelnetUtils.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/apps/org/jnode/apps/telnetd/TelnetUtils.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -24,8 +24,23 @@ import net.wimpi.telnetd.io.TerminalIO; +/** + * Utility methods for the telnet daemon. + * + * @author Fabien DUMINY (fd...@jn...) + * + */ public class TelnetUtils { + /** + * Write a buffer to the given terminal. + * + * @param terminalIO the terminal to which buffer data should be sent. + * @param b the buffer + * @param off offset of the first byte to get from the buffer + * @param len number of bytes to get from the buffer + * @throws IOException + */ public static void write(TerminalIO terminalIO, byte[] b, int off, int len) throws IOException { int offset = off; for (int i = 0; i < len; i++) { @@ -36,6 +51,13 @@ } } + /** + * Write a buffer to the given terminal. + * + * @param terminalIO the terminal to which buffer data should be sent. + * @param b the buffer + * @throws IOException + */ public static void write(TerminalIO terminalIO, byte[] b) throws IOException { terminalIO.getTelnetIO().write(b); if (terminalIO.isAutoflushing()) { Modified: trunk/distr/src/apps/org/jnode/games/rubik/Rubik.java =================================================================== --- trunk/distr/src/apps/org/jnode/games/rubik/Rubik.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/apps/org/jnode/games/rubik/Rubik.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -19,10 +19,6 @@ */ package org.jnode.games.rubik; -// Rubik's Cube 3D simulator -// Karl H\u00f6rnell, March 11 1996 -// Last modified October 6 -// Adapted to JNode by Levente S\u00e1ntha import java.awt.AWTEvent; import java.awt.BorderLayout; @@ -39,6 +35,13 @@ import javax.swing.JFrame; import javax.swing.SwingUtilities; +/** + * Rubik's Cube 3D simulator. + * Adapted to JNode by Levente S\u00e1ntha. + * + * @author Karl H\u00f6rnell, March 11 1996 (Last modified October 6) + * + */ public final class Rubik extends JComponent { int i, j, k, n, o, p, q, lastX, lastY, dx, dy; int rectX[], rectY[]; @@ -71,6 +74,9 @@ Graphics offGraphics; Image offImage; + /** + * Initialization of the component. + */ public void init() { enableEvents(AWTEvent.KEY_EVENT_MASK); setFocusable(true); @@ -140,7 +146,10 @@ repaint(); } - // Convert hexadecimal RGB parameter to color + /** + * Convert hexadecimal RGB parameter to color + * @return + */ public Color findBGColor() { int hex[]; String s, h = "0123456789abcdef"; @@ -160,18 +169,40 @@ // Various vector manipulation functions + /** + * + */ public double scalProd(double v1[], int ix1, double v2[], int ix2) { return v1[ix1] * v2[ix2] + v1[ix1 + 1] * v2[ix2 + 1] + v1[ix1 + 2] * v2[ix2 + 2]; } + /** + * + * @param v + * @param ix + * @return + */ public double vNorm(double v[], int ix) { return m.sqrt(v[ix] * v[ix] + v[ix + 1] * v[ix + 1] + v[ix + 2] * v[ix + 2]); } + /** + * + * @param v1 + * @param ix1 + * @param v2 + * @param ix2 + * @return + */ public double cosAng(double v1[], int ix1, double v2[], int ix2) { return scalProd(v1, ix1, v2, ix2) / (vNorm(v1, ix1) * vNorm(v2, ix2)); } + /** + * + * @param v + * @param ix + */ public void normalize(double v[], int ix) { double t = vNorm(v, ix); v[ix] = v[ix] / t; @@ -179,30 +210,66 @@ v[ix + 2] = v[ix + 2] / t; } + /** + * + * @param v + * @param ix + * @param a + */ public void scalMult(double v[], int ix, double a) { v[ix] = v[ix] * a; v[ix + 1] = v[ix + 1] * a; v[ix + 2] = v[ix + 2] * a; } + /** + * + * @param v1 + * @param ix1 + * @param v2 + * @param ix2 + */ public void addVec(double v1[], int ix1, double v2[], int ix2) { v2[ix2] += v1[ix1]; v2[ix2 + 1] += v1[ix1 + 1]; v2[ix2 + 2] += v1[ix1 + 2]; } + /** + * + * @param v1 + * @param ix1 + * @param v2 + * @param ix2 + */ public void subVec(double v1[], int ix1, double v2[], int ix2) { v2[ix2] -= v1[ix1]; v2[ix2 + 1] -= v1[ix1 + 1]; v2[ix2 + 2] -= v1[ix1 + 2]; } + /** + * + * @param v1 + * @param ix1 + * @param v2 + * @param ix2 + */ public void copyVec(double v1[], int ix1, double v2[], int ix2) { v2[ix2] = v1[ix1]; v2[ix2 + 1] = v1[ix1 + 1]; v2[ix2 + 2] = v1[ix1 + 2]; } + /** + * + * @param v1 + * @param ix1 + * @param v2 + * @param ix2 + * @param v3 + * @param ix3 + */ public void vecProd(double v1[], int ix1, double v2[], int ix2, double v3[], int ix3) { v3[ix3] = v1[ix1 + 1] * v2[ix2 + 2] - v1[ix1 + 2] * v2[ix2 + 1]; @@ -210,7 +277,9 @@ v3[ix3 + 2] = v1[ix1] * v2[ix2 + 1] - v1[ix1 + 1] * v2[ix2]; } - // Produce large and small sub-cube for twisting + /** + * Produce large and small sub-cube for twisting + */ public void cutUpCube() { boolean check; // Copy main coordinate data @@ -285,6 +354,11 @@ } } + /** + * + * @param key + * @return + */ public boolean keyPressed(int key) { // Restore if (key == 114) { @@ -304,6 +378,12 @@ return false; } + /** + * + * @param x + * @param y + * @return + */ public boolean mouseDragged(int x, int y) { boolean check; double x1, x2, y1, y2, alpha, beta; @@ -377,6 +457,12 @@ return false; } + /** + * + * @param x + * @param y + * @return + */ public boolean mousePressed(int x, int y) { lastX = x; lastY = y; @@ -384,6 +470,12 @@ return false; } + /** + * + * @param x + * @param y + * @return + */ public boolean mouseReleased(int x, int y) { int quads; double qu; @@ -410,7 +502,11 @@ return false; } - // Shift colored fields + /** + * Shift colored fields + * @param sideNum + * @param quads + */ public void colorTwist(int sideNum, int quads) { int i, j, k, l = 0; k = quads * 2; // quads = number of 90-degree multiples @@ -472,6 +568,9 @@ } } + /** + * + */ public void paintComponent(Graphics g) { dragReg = 0; if (offGraphics == null) { @@ -542,11 +641,22 @@ g.drawImage(offImage, 0, 0, this); } + /** + * + */ public void update(Graphics g) { paint(g); } - // Draw cube or sub-cube + /** + * Draw cube or sub-cube. + * @param beye + * @param beX + * @param beY + * @param bcorners + * @param bblocks + * @param mode + */ public void fixBlock(double beye[], double beX[], double beY[], double bcorners[], int bblocks[], int mode) { copyVec(beye, 0, light, 0); @@ -666,6 +776,10 @@ } } + /** + * + * @param argv + */ public static void main(String[] argv) { JFrame f = new JFrame("Rubik's Cube"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Modified: trunk/distr/src/test/org/jnode/apps/jpartition/utils/device/DeviceUtils.java =================================================================== --- trunk/distr/src/test/org/jnode/apps/jpartition/utils/device/DeviceUtils.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/test/org/jnode/apps/jpartition/utils/device/DeviceUtils.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -40,11 +40,15 @@ import org.jnode.fs.service.FileSystemService; import org.jnode.fs.service.def.FileSystemPlugin; import org.jnode.emu.naming.BasicNameSpace; +import org.jnode.emu.plugin.model.DummyConfigurationElement; +import org.jnode.emu.plugin.model.DummyExtension; +import org.jnode.emu.plugin.model.DummyExtensionPoint; import org.jnode.emu.plugin.model.DummyPluginDescriptor; import org.jnode.naming.InitialNaming; import org.jnode.naming.NameSpace; import org.jnode.plugin.PluginDescriptor; import org.jnode.test.fs.driver.stubs.StubDeviceManager; +import org.jnode.test.fs.filesystem.config.FSType; import org.jnode.util.OsUtils; public class DeviceUtils { @@ -57,15 +61,32 @@ if (!OsUtils.isJNode() && !coreInitialized) { try { - // ShellEmu.main(new String[0]); - NameSpace namespace = new BasicNameSpace(); - InitialNaming.setNameSpace(namespace); - - InitialNaming.bind(DeviceManager.NAME, StubDeviceManager.INSTANCE); - - PluginDescriptor desc = new DummyPluginDescriptor(true); +// // ShellEmu.main(new String[0]); +// NameSpace namespace = new BasicNameSpace(); +// InitialNaming.setNameSpace(namespace); +// +// InitialNaming.bind(DeviceManager.NAME, StubDeviceManager.INSTANCE); +// +// PluginDescriptor desc = new DummyPluginDescriptor(true); +// FileSystemService fss = new FileSystemPlugin(desc); +// namespace.bind(FileSystemService.class, fss); + + // Build a plugin descriptor that is sufficient for the FileSystemPlugin to + // configure file system types for testing. + DummyPluginDescriptor desc = new DummyPluginDescriptor(true); + DummyExtensionPoint ep = new DummyExtensionPoint("types", "org.jnode.fs.types", "types"); + desc.addExtensionPoint(ep); + for (FSType fsType : FSType.values()) { + DummyExtension extension = new DummyExtension(); + DummyConfigurationElement element = new DummyConfigurationElement(); + element.addAttribute("class", fsType.getFsTypeClass().getName()); + extension.addElement(element); + ep.addExtension(extension); + } + FileSystemService fss = new FileSystemPlugin(desc); - namespace.bind(FileSystemService.class, fss); + InitialNaming.bind(FileSystemService.class, fss); + } catch (NameAlreadyBoundException e) { throw new RuntimeException(e); } catch (NamingException e) { Modified: trunk/distr/src/test/org/jnode/apps/vmware/disk/test/BaseTest.java =================================================================== --- trunk/distr/src/test/org/jnode/apps/vmware/disk/test/BaseTest.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/test/org/jnode/apps/vmware/disk/test/BaseTest.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -27,7 +27,7 @@ import org.junit.Before; /** - * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare) + * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare). * * @author Fabien DUMINY (fduminy at jnode dot org) * @@ -38,11 +38,20 @@ protected final boolean copyDisk; protected File diskFile; + /** + * + * @param diskFile + * @param copyDisk + */ public BaseTest(File diskFile, boolean copyDisk) { this.originalDiskFile = diskFile; this.copyDisk = copyDisk; } + /** + * + * @throws IOException + */ @Before public void setUp() throws IOException { this.diskFile = @@ -50,12 +59,19 @@ : originalDiskFile; } + /** + * + * @throws IOException + */ @After public void tearDown() throws IOException { Utils.clearTempDir(true); Utils.DO_CLEAR = true; } + /** + * + */ @Override public String toString() { return diskFile.getName(); Modified: trunk/distr/src/test/org/jnode/apps/vmware/disk/test/TestCreation.java =================================================================== --- trunk/distr/src/test/org/jnode/apps/vmware/disk/test/TestCreation.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/test/org/jnode/apps/vmware/disk/test/TestCreation.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -25,7 +25,7 @@ import org.junit.Test; /** - * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare) + * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare). * * @author Fabien DUMINY (fduminy at jnode dot org) * @@ -33,10 +33,18 @@ public class TestCreation extends BaseTest { private static final Logger LOG = Logger.getLogger(TestCreation.class); + /** + * + * @throws IOException + */ public TestCreation() throws IOException { super(Utils.createTempFile("create"), false); } + /** + * + * @throws Exception + */ @Test public void createSparseDisk() throws Exception { Modified: trunk/distr/src/test/org/jnode/apps/vmware/disk/test/Utils.java =================================================================== --- trunk/distr/src/test/org/jnode/apps/vmware/disk/test/Utils.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/test/org/jnode/apps/vmware/disk/test/Utils.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -25,7 +25,7 @@ import org.apache.log4j.Logger; /** - * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare) + * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare). * * @author Fabien DUMINY (fduminy at jnode dot org) * @@ -42,8 +42,16 @@ private static long SEQ_NUMBER = 0L; + /** + * Should we clear the temporary directory ? + */ public static boolean DO_CLEAR = true; + /** + * Create a temporary directory that will be used to store VMware disks. + * @return the temporary directory + * @throws IOException + */ public static File createTempDir() throws IOException { if (!TEMP_DIR_FILE.exists()) { if (!TEMP_DIR_FILE.mkdir()) { @@ -56,11 +64,23 @@ return TEMP_DIR_FILE; } + /** + * Create a temporary file in the temporary created (if needed) by {@link #createTempDir()}. + * @param prefix for the temporary file + * @return + * @throws IOException + */ public static File createTempFile(String prefix) throws IOException { File tmpDir = createTempDir(); return new File(tmpDir, String.valueOf(prefix) + SEQ_NUMBER++); } + /** + * Clean the temporary directory. + * + * @param deleteDir true to also delete the temporary directory. + * @throws IOException + */ public static void clearTempDir(boolean deleteDir) throws IOException { if (!DO_CLEAR) return; Modified: trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/BaseReadWriteTest.java =================================================================== --- trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/BaseReadWriteTest.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/BaseReadWriteTest.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -42,7 +42,7 @@ import org.junit.runners.Parameterized.Parameters; /** - * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare) + * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare). * * @author Fabien DUMINY (fduminy at jnode dot org) * @@ -81,6 +81,11 @@ System.out.println("\ndirectory for package " + DISKS_PACKAGE + " : " + DISKS_PATH); } + /** + * Get the set of data to use for the read & write tests. + * + * @return + */ @Parameters public static List<File[]> data() { File directory = new File(DISKS_PATH); @@ -103,10 +108,19 @@ return list; } + /** + * Construct a test class for a VMware disk stored in a file. + * @param diskFile file used to store the VMware disk + * @throws IOException + */ public BaseReadWriteTest(File diskFile) throws IOException { super(diskFile, true); } + /** + * Do a read test. + * @throws Exception + */ @Test @Ignore public void read() throws Exception { @@ -118,6 +132,10 @@ Assert.assertEquals(toString() + ": buffer should be filled", 0, data.remaining()); } + /** + * Do a write test. + * @throws Exception + */ @Test @Ignore public void write() throws Exception { @@ -129,6 +147,10 @@ Assert.assertEquals(toString() + ": buffer should be fully copied", 0, data.remaining()); } + /** + * Do a write & read test. + * @throws Exception + */ @Test public void writeAndRead() throws Exception { Utils.DO_CLEAR = false; Modified: trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/TestHeader.java =================================================================== --- trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/TestHeader.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/TestHeader.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -30,7 +30,7 @@ import org.junit.Test; /** - * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare) + * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare). * * @author Fabien DUMINY (fduminy at jnode dot org) * @@ -38,22 +38,36 @@ public class TestHeader extends BaseReadWriteTest { private static final Logger LOG = Logger.getLogger(TestHeader.class); + /** + * Construct a test class for a VMware disk headers stored in a file. + * @param diskFile file to use for the VMware disk. + * @throws IOException + */ public TestHeader(File diskFile) throws IOException { super(diskFile); } + /** + * Do a read test on VMware disk headers. + */ @Test public void read() throws Exception { VMWareDisk disk = new VMWareDisk(diskFile); disk.flush(); } + /** + * Do a write test on VMware disk headers. + */ @Test public void write() throws Exception { VMWareDisk disk = new VMWareDisk(diskFile); disk.flush(); } + /** + * Do a write and read test on VMware disk headers. + */ @Test public void writeAndRead() throws Exception { Utils.DO_CLEAR = false; Modified: trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/TestVMWareDisk.java =================================================================== --- trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/TestVMWareDisk.java 2009-02-28 11:52:19 UTC (rev 5068) +++ trunk/distr/src/test/org/jnode/apps/vmware/disk/test/readwrite/TestVMWareDisk.java 2009-02-28 12:45:32 UTC (rev 5069) @@ -35,7 +35,7 @@ import org.junit.Ignore; /** - * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare) + * Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare). * * @author Fabien DUMINY (fduminy at jnode dot org) * @@ -43,10 +43,18 @@ public class TestVMWareDisk extends BaseReadWriteTest { private static final Logger LOG = Logger.getLogger(TestVMWareDisk.class); + /** + * Construct a test class for a VMware disk stored in a file. + * @param diskFile file used to store the VMware disk + * @throws IOException + */ public TestVMWareDisk(File diskFile) throws IOException { super(diskFile); } + /** + * Do read test. + */ @Test public void read() throws Exception { VMWareDisk disk = new VMWareDisk(diskFile); @@ -57,6 +65,9 @@ Assert.assertEquals(toString() + ": buffer should be filled", 0, data.remaining()); } + /** + * Do a write test. + */ @Test @Ignore public void write() throws Exception { @@ -68,6 +79,9 @@ Assert.assertEquals(toString() + ": buffer should be fully copied", 0, data.remaining()); } + /** + * Do writes, just followed by reads on the same file. + */ @Test @Ignore public void writeAndRead() throws Exception { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |