mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-12-22 08:30:35 +00:00
Updating tests with old images and made config more dynamic for #12.
This commit is contained in:
parent
ae72f3877e
commit
afd8388848
@ -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 {
|
||||
|
@ -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.
|
||||
* <p>
|
||||
* 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";
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +0,0 @@
|
||||
DiskDir=C:/Documents and Settings/hp/My Documents/My Apple2/Disks
|
||||
TempDir=C:/Temp
|
BIN
src/test/resources/disks/CavernsOfFreitag.dsk
Normal file
BIN
src/test/resources/disks/CavernsOfFreitag.dsk
Normal file
Binary file not shown.
BIN
src/test/resources/disks/D3110.dsk
Normal file
BIN
src/test/resources/disks/D3110.dsk
Normal file
Binary file not shown.
BIN
src/test/resources/disks/D3151.dsk
Normal file
BIN
src/test/resources/disks/D3151.dsk
Normal file
Binary file not shown.
BIN
src/test/resources/disks/DOS 3.3.po
Normal file
BIN
src/test/resources/disks/DOS 3.3.po
Normal file
Binary file not shown.
BIN
src/test/resources/disks/MASTER.DSK
Normal file
BIN
src/test/resources/disks/MASTER.DSK
Normal file
Binary file not shown.
Binary file not shown.
BIN
src/test/resources/disks/Phantasie1.dsk
Normal file
BIN
src/test/resources/disks/Phantasie1.dsk
Normal file
Binary file not shown.
BIN
src/test/resources/disks/Phantasie2.dsk
Normal file
BIN
src/test/resources/disks/Phantasie2.dsk
Normal file
Binary file not shown.
BIN
src/test/resources/disks/Prodos.dsk
Normal file
BIN
src/test/resources/disks/Prodos.dsk
Normal file
Binary file not shown.
BIN
src/test/resources/disks/RDOSboot.dsk
Normal file
BIN
src/test/resources/disks/RDOSboot.dsk
Normal file
Binary file not shown.
BIN
src/test/resources/disks/SSIsave.dsk
Normal file
BIN
src/test/resources/disks/SSIsave.dsk
Normal file
Binary file not shown.
BIN
src/test/resources/disks/galatt.dsk
Normal file
BIN
src/test/resources/disks/galatt.dsk
Normal file
Binary file not shown.
BIN
src/test/resources/disks/original332sysmas.do
Executable file
BIN
src/test/resources/disks/original332sysmas.do
Executable file
Binary file not shown.
BIN
src/test/resources/disks/phan2d1.dsk
Normal file
BIN
src/test/resources/disks/phan2d1.dsk
Normal file
Binary file not shown.
BIN
src/test/resources/disks/phan2d2.dsk
Normal file
BIN
src/test/resources/disks/phan2d2.dsk
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user