Closedown

This commit is contained in:
boccioli_m
2015-06-09 15:13:20 +02:00
parent d1046a4601
commit ea80a7ccc1

View File

@@ -343,13 +343,13 @@ public class TestingList extends Panel {
updateStatus();
}
public void addToTable(String deviceName, String deviceDescription, String testName){
public void addToTable(String deviceName, String deviceDescription, String testSuite, String testName){
String sDate = "";
if(testName.equals("") || deviceName.equals("")) return;
ImageIcon icon = new ImageIcon(getClass().getResource("/icons/button_pause-16px.png"));
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
model.addRow(new Object[] {false, sDate, deviceName, deviceDescription, testName, "", "", "Pending", icon});
model.addRow(new Object[] {false, sDate, deviceName, deviceDescription, testSuite, testName, "", "Pending", icon});
jTable1.setModel(model);
updateStatus();
@@ -360,22 +360,11 @@ public class TestingList extends Panel {
Date date = new Date();
return dateFormat.format(date);
}
//initial try, not needed any more
public void loadTest() throws FileNotFoundException, IOException{
Properties prop = new Properties();
String fileName = new java.io.File( "." ).getCanonicalPath()+ "\\home\\script\\tests\\devices\\LS\\.config";
this.jTextField1.setText(fileName);
InputStream is = new FileInputStream(fileName);
prop.load(is);
addToTable(prop.getProperty("name"), prop.getProperty("description"), prop.getProperty("tests"));
this.jTextField1.setText(prop.getProperty("name"));
}
public void loadTests() throws FileNotFoundException, IOException{
Properties prop = new Properties();
Properties propDevice = new Properties();
Properties propTest = new Properties();
String fileName = new java.io.File( "." ).getCanonicalPath()+ TESTS_DEVICES_DEFAULT_DIR;
this.jTextField1.setText(fileName + "\n");
File folder = new File(fileName);
@@ -383,41 +372,46 @@ public class TestingList extends Panel {
String sTestName;
//search of devices and their tests
File[] listOfFiles = folder.listFiles();
for (File listOfFile : listOfFiles) {
if (listOfFile.isFile()) {
this.jTextField1.append("\nFile " + listOfFile.getName());
} else if (listOfFile.isDirectory()) {
this.jTextField1.append("\nDirectory " + listOfFile.getName());
File configFile = new File(listOfFile.getPath() + FilenameUtils.separatorsToSystem("/.config"));
if(configFile.exists() && !configFile.isDirectory()){
InputStream is = new FileInputStream(configFile);
for (File listOfFile : listOfFiles) {
if (listOfFile.isFile()) {
this.jTextField1.append("\nFile " + listOfFile.getName());
} else if (listOfFile.isDirectory()) {
this.jTextField1.append("\nDirectory " + listOfFile.getName());
File configFile = new File(listOfFile.getPath() + FilenameUtils.separatorsToSystem("/.config"));
if(configFile.exists() && !configFile.isDirectory()){
InputStream is = new FileInputStream(configFile);
prop.load(is);
//config of device was loaded. now load the config of each test belonging to the device
sTestName = new java.io.File( "." ).getCanonicalPath()+ TESTS_TESTS_DEFAULT_DIR + prop.getProperty("tests");
this.jTextField1.append("\nTest " + sTestName);
testsFolder = new File(sTestName);
if(testsFolder.exists() && testsFolder.isDirectory()){
File[] listOfTests = testsFolder.listFiles();
for (File listOfTest : listOfTests) {
if (listOfTest.isDirectory()) {
this.jTextField1.append("\nTest " + listOfTest.getPath());
}
}
propDevice.load(is);
//config of device was loaded. now load the config of each test belonging to the device
sTestName = new java.io.File( "." ).getCanonicalPath()+ TESTS_TESTS_DEFAULT_DIR + propDevice.getProperty("tests");
this.jTextField1.append("\nTest suite: " + sTestName);
testsFolder = new File(sTestName);
if(testsFolder.exists() && testsFolder.isDirectory()){
File[] listOfTests = testsFolder.listFiles();
for (File listOfTest : listOfTests) {
if (listOfTest.isDirectory()) {
this.jTextField1.append("\nTest: " + listOfTest.getPath());
InputStream ist = new FileInputStream(listOfTest.getPath());
propTest.load(is);
addToTable(propDevice.getProperty("name"),
propDevice.getProperty("description"),
propDevice.getProperty("tests"),
propTest.getProperty("name"));
this.jTextField1.append("\nProperties: ");
this.jTextField1.append(propDevice.getProperty("name"));
this.jTextField1.append(propDevice.getProperty("description"));
this.jTextField1.append(propDevice.getProperty("tests"));
this.jTextField1.append(propTest.getProperty("name"));
}
}
addToTable(prop.getProperty("name"), prop.getProperty("description"), prop.getProperty("tests"));
this.jTextField1.append("\nProperties: ");
this.jTextField1.append(prop.getProperty("name"));
this.jTextField1.append(prop.getProperty("description"));
this.jTextField1.append(prop.getProperty("tests"));
}
}
}
}
}
public void logMessage(String message){
}
public void selectFile(){
final JFileChooser fc = new JFileChooser();