diff --git a/src/test/java/com/webcodepro/applecommander/storage/DiskHelperTest.java b/src/test/java/com/webcodepro/applecommander/storage/DiskHelperTest.java index 523afe3..41b5e7a 100644 --- a/src/test/java/com/webcodepro/applecommander/storage/DiskHelperTest.java +++ b/src/test/java/com/webcodepro/applecommander/storage/DiskHelperTest.java @@ -78,10 +78,6 @@ public class DiskHelperTest extends TestCase { + "/Marble Madness (1985)(Electronic Arts).2mg"); //$NON-NLS-1$ } - public void testLoadHd1() throws IOException, DiskException { - showDirectory("C:/My Apple2/ApplePC/hd1.hdv"); //$NON-NLS-1$ - } - public void testRdosBoot() throws IOException, DiskException { showDirectory(config.getDiskDir() + "/RDOSboot.dsk"); //$NON-NLS-1$ } @@ -119,12 +115,12 @@ public class DiskHelperTest extends TestCase { public void testUniDosD3110() throws IOException, DiskException { showDirectory(config.getDiskDir() - + "/UniDOS/D3110.dsk"); //$NON-NLS-1$ + + "/D3110.dsk"); //$NON-NLS-1$ } public void testUniDosD3151() throws IOException, DiskException { showDirectory(config.getDiskDir() - + "/UniDOS/D3151.dsk"); //$NON-NLS-1$ + + "/D3151.dsk"); //$NON-NLS-1$ } protected FormattedDisk[] showDirectory(String imageName) throws IOException, DiskException { diff --git a/src/test/java/com/webcodepro/applecommander/testconfig/TestConfig.java b/src/test/java/com/webcodepro/applecommander/testconfig/TestConfig.java index 289a7dd..bd0fed6 100644 --- a/src/test/java/com/webcodepro/applecommander/testconfig/TestConfig.java +++ b/src/test/java/com/webcodepro/applecommander/testconfig/TestConfig.java @@ -19,21 +19,17 @@ */ package com.webcodepro.applecommander.testconfig; -import java.io.InputStream; -import java.util.Properties; - /** * A simple class to contains test configuration information. * Update the file TestConfig.properties to match the system. + *

+ * Note: Used to rely on a properties file; altered it to work + * more dynamically to allow tests to be run... * * @author Rob */ public class TestConfig { - private static final String FILENAME = "TestConfig.properties"; //$NON-NLS-1$ - private static final String DISK_DIRECTORY = "DiskDir"; //$NON-NLS-1$ - private static final String TEMP_DIRECTORY = "TempDir"; //$NON-NLS-1$ private static TestConfig instance; - private Properties properties = new Properties(); /** * Hide constructor from other classes. */ @@ -46,32 +42,19 @@ public class TestConfig { public static TestConfig getInstance() { if (instance == null) { instance = new TestConfig(); - instance.load(); } return instance; } - /** - * Initialize the test config from disk. - */ - private void load() { - try { - InputStream inputStream = getClass().getResourceAsStream(FILENAME); - properties.load(inputStream); - inputStream.close(); - } catch (Exception ignored) { - // Ignored - } - } /** * Answer with the temp directory. */ public String getTempDir() { - return properties.getProperty(TEMP_DIRECTORY); + return System.getProperty("java.io.tmpdir"); } /** * Answer with the directory where disk images are stored. */ public String getDiskDir() { - return properties.getProperty(DISK_DIRECTORY); + return "./src/test/resources/disks"; } } diff --git a/src/test/resources/com/webcodepro/applecommander/testconfig/TestConfig.properties b/src/test/resources/com/webcodepro/applecommander/testconfig/TestConfig.properties deleted file mode 100644 index 1b6816c..0000000 --- a/src/test/resources/com/webcodepro/applecommander/testconfig/TestConfig.properties +++ /dev/null @@ -1,2 +0,0 @@ -DiskDir=C:/Documents and Settings/hp/My Documents/My Apple2/Disks -TempDir=C:/Temp diff --git a/src/test/resources/disks/CavernsOfFreitag.dsk b/src/test/resources/disks/CavernsOfFreitag.dsk new file mode 100644 index 0000000..85e4230 Binary files /dev/null and b/src/test/resources/disks/CavernsOfFreitag.dsk differ diff --git a/src/test/resources/disks/D3110.dsk b/src/test/resources/disks/D3110.dsk new file mode 100644 index 0000000..9157098 Binary files /dev/null and b/src/test/resources/disks/D3110.dsk differ diff --git a/src/test/resources/disks/D3151.dsk b/src/test/resources/disks/D3151.dsk new file mode 100644 index 0000000..d75bf0e Binary files /dev/null and b/src/test/resources/disks/D3151.dsk differ diff --git a/src/test/resources/disks/DOS 3.3.po b/src/test/resources/disks/DOS 3.3.po new file mode 100644 index 0000000..94c912b Binary files /dev/null and b/src/test/resources/disks/DOS 3.3.po differ diff --git a/src/test/resources/disks/MASTER.DSK b/src/test/resources/disks/MASTER.DSK new file mode 100644 index 0000000..22b8037 Binary files /dev/null and b/src/test/resources/disks/MASTER.DSK differ diff --git a/src/test/resources/disks/Marble Madness (1985)(Electronic Arts).2mg b/src/test/resources/disks/Marble Madness (1985)(Electronic Arts).2mg new file mode 100644 index 0000000..337abb5 Binary files /dev/null and b/src/test/resources/disks/Marble Madness (1985)(Electronic Arts).2mg differ diff --git a/src/test/resources/disks/Phantasie1.dsk b/src/test/resources/disks/Phantasie1.dsk new file mode 100644 index 0000000..160b5c1 Binary files /dev/null and b/src/test/resources/disks/Phantasie1.dsk differ diff --git a/src/test/resources/disks/Phantasie2.dsk b/src/test/resources/disks/Phantasie2.dsk new file mode 100644 index 0000000..82e0ee7 Binary files /dev/null and b/src/test/resources/disks/Phantasie2.dsk differ diff --git a/src/test/resources/disks/Prodos.dsk b/src/test/resources/disks/Prodos.dsk new file mode 100644 index 0000000..ce1bbce Binary files /dev/null and b/src/test/resources/disks/Prodos.dsk differ diff --git a/src/test/resources/disks/RDOSboot.dsk b/src/test/resources/disks/RDOSboot.dsk new file mode 100644 index 0000000..7504a66 Binary files /dev/null and b/src/test/resources/disks/RDOSboot.dsk differ diff --git a/src/test/resources/disks/SSIsave.dsk b/src/test/resources/disks/SSIsave.dsk new file mode 100644 index 0000000..19437a6 Binary files /dev/null and b/src/test/resources/disks/SSIsave.dsk differ diff --git a/src/test/resources/disks/galatt.dsk b/src/test/resources/disks/galatt.dsk new file mode 100644 index 0000000..a196146 Binary files /dev/null and b/src/test/resources/disks/galatt.dsk differ diff --git a/src/test/resources/disks/original332sysmas.do b/src/test/resources/disks/original332sysmas.do new file mode 100755 index 0000000..d260128 Binary files /dev/null and b/src/test/resources/disks/original332sysmas.do differ diff --git a/src/test/resources/disks/phan2d1.dsk b/src/test/resources/disks/phan2d1.dsk new file mode 100644 index 0000000..68f23df Binary files /dev/null and b/src/test/resources/disks/phan2d1.dsk differ diff --git a/src/test/resources/disks/phan2d2.dsk b/src/test/resources/disks/phan2d2.dsk new file mode 100644 index 0000000..6b98530 Binary files /dev/null and b/src/test/resources/disks/phan2d2.dsk differ