This commit is contained in:
boccioli_m
2018-03-20 13:49:40 +01:00
parent b095787c1e
commit 7288512701
6 changed files with 38 additions and 145 deletions

BIN
plugins/Music.lnk Normal file

Binary file not shown.

View File

@@ -462,7 +462,7 @@
<Font name="Tahoma" size="15" style="0"/>
</Property>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor" postCode="jTable1.getTableHeader().setReorderingAllowed(false);">
<Connection code="new javax.swing.table.DefaultTableModel(&#xa; new Object [][] {&#xa;&#xa; },&#xa; new String [] {&#xa; &quot;Enable&quot;, &quot;Start Mode&quot;, &quot;Time&quot;, &quot;Device Name&quot;, &quot;Device Path&quot;, &quot;Device Description&quot;, &quot;Test Suite&quot;, &quot;Test Name&quot;, &quot;Test Peth&quot;, &quot;Test Parameters&quot;, &quot;Test Description&quot;, &quot;Test Help&quot;, &quot;Last Test Result&quot;, &quot;Status&quot;, &quot;&quot;&#xa; }&#xa;) {&#xa; Class[] types = new Class [] {&#xa; java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, javax.swing.Icon.class&#xa; };&#xa; boolean[] canEdit = new boolean [] {&#xa; true, true, false, false, false, false, false, false, false, false, false, false, false, false, false&#xa; };&#xa;&#xa; public Class getColumnClass(int columnIndex) {&#xa; return types [columnIndex];&#xa; }&#xa;&#xa; public boolean isCellEditable(int rowIndex, int columnIndex) {&#xa; return canEdit [columnIndex];&#xa; }&#xa;}" type="code"/>
<Connection code="new javax.swing.table.DefaultTableModel(&#xa; new Object [][] {&#xa;&#xa; },&#xa; new String [] {&#xa; &quot;Enable&quot;, &quot;Start Mode&quot;, &quot;Time&quot;, &quot;Device Name&quot;, &quot;Device Description&quot;, &quot;Test Suite&quot;, &quot;Test Name&quot;, &quot;Test Peth&quot;, &quot;Test Parameters&quot;, &quot;Test Description&quot;, &quot;Test Help&quot;, &quot;Last Test Result&quot;, &quot;Status&quot;, &quot;&quot;&#xa; }&#xa;) {&#xa; Class[] types = new Class [] {&#xa; java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, javax.swing.Icon.class&#xa; };&#xa; boolean[] canEdit = new boolean [] {&#xa; true, true, false, false, false, false, false, false, false, false, false, false, false, false&#xa; };&#xa;&#xa; public Class getColumnClass(int columnIndex) {&#xa; return types [columnIndex];&#xa; }&#xa;&#xa; public boolean isCellEditable(int rowIndex, int columnIndex) {&#xa; return canEdit [columnIndex];&#xa; }&#xa;}" type="code"/>
</Property>
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
<TableColumnModel selectionModel="0"/>

View File

@@ -88,17 +88,16 @@ public class TestingList extends Panel {
STARTSEQUENCE(1),
TIME(2),
DEVICENAME(3),
DEVICEPATH(4),
DEVICEDESCR(5),
TESTSUITE(6),
TESTNAME(7),
TESTPATH(8),
TESTPARAMS(9),
TESTDESCR(10),
TESTHELP(11),
RESULT(12),
STATUS(13),
ICON(14);
DEVICEDESCR(4),
TESTSUITE(5),
TESTNAME(6),
TESTPATH(7),
TESTPARAMS(8),
TESTDESCR(9),
TESTHELP(10),
RESULT(11),
STATUS(12),
ICON(13);
private int value;
private COL(int value) {
@@ -298,36 +297,6 @@ public class TestingList extends Panel {
* initialise panel
*/
private void initialise(){
System.out.println("msg:");
int PORT1 = 0x8899; // this port
String mode = "2,IQCOM,$BMA1,1,DIA";
int i = 0;
byte[] msg = new byte[128];
msg[0] = 50; //bytecount
msg[2] = 105; // transfer function
msg[4] = (byte) PORT1;
msg[5] = (byte) (PORT1 >>> 8);
msg[6] = 1; // message id
msg[16] = 1; //io-func reset=2 read mode=0 write mode=1
byte[] buffer = mode.getBytes();
while (i < buffer.length) {
msg[28 + i] = buffer[i];
i++;
}
for (i=0 ; i < msg.length; i++) {
System.out.print(String.format("%02X ", msg[i]));
}
System.out.println("");
initComponents();
initLogger();
buildTable();
@@ -410,7 +379,7 @@ public class TestingList extends Panel {
try {
if (!configFile.isFile()) configFile.createNewFile();
FileReader reader = new FileReader(configFile);
System.out.println("save property: "+ key + " = " + val);
//System.out.println("save property: "+ key + " = " + val);
properties.setProperty(key, val);
Properties props = properties;
@@ -1004,14 +973,14 @@ public class TestingList extends Panel {
},
new String [] {
"Enable", "Start Mode", "Time", "Device Name", "Device Path", "Device Description", "Test Suite", "Test Name", "Test Peth", "Test Parameters", "Test Description", "Test Help", "Last Test Result", "Status", ""
"Enable", "Start Mode", "Time", "Device Name", "Device Description", "Test Suite", "Test Name", "Test Peth", "Test Parameters", "Test Description", "Test Help", "Last Test Result", "Status", ""
}
) {
Class[] types = new Class [] {
java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, javax.swing.Icon.class
java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, javax.swing.Icon.class
};
boolean[] canEdit = new boolean [] {
true, true, false, false, false, false, false, false, false, false, false, false, false, false, false
true, true, false, false, false, false, false, false, false, false, false, false, false, false
};
public Class getColumnClass(int columnIndex) {
@@ -1619,12 +1588,11 @@ public class TestingList extends Panel {
String sTestPath = String.valueOf(jTable1.getValueAt(row, COL.TESTPATH.ordinal())).replace("\\", File.separator);
String sTestCaseName = jTable1.getValueAt(row, COL.TESTSUITE.ordinal()).toString();
String sTestDescription = getTestDescription(sTestPath);
String sDevicePath = jTable1.getValueAt(row, COL.DEVICEPATH.ordinal()).toString();
String sDeviceDescription = jTable1.getValueAt(row, COL.DEVICEDESCR.ordinal()).toString();
String sLastResult = jTable1.getValueAt(row, COL.RESULT.ordinal()).toString();
String sResultTime = jTable1.getValueAt(row, COL.TIME.ordinal()).toString();
String sTestHelp = String.valueOf(jTable1.getValueAt(row, COL.TESTHELP.ordinal()));
HashMap mParameters = getParameters(sTestPath, sDevicePath);
HashMap mParameters = getTestParameters(sTestPath);
//create map for passing details to Details Panel
HashMap details = new HashMap();
details.put("deviceName", sDeviceName);
@@ -1979,14 +1947,13 @@ public class TestingList extends Panel {
*/
private HashMap buildMapFromTableRow(int row) {
String sDeviceName = jTable1.getValueAt(row, COL.DEVICENAME.ordinal()).toString();
String sDevicePath = jTable1.getValueAt(row, COL.DEVICEPATH.ordinal()).toString().replace("\\", File.separator);
String sTestName = jTable1.getValueAt(row, COL.TESTNAME.ordinal()).toString();
String sTestCaseName = jTable1.getValueAt(row, COL.TESTSUITE.ordinal()).toString();
String sTestPath = jTable1.getValueAt(row, COL.TESTPATH.ordinal()).toString().replace("\\", File.separator);
// HashMap mParameters = buildParametersMap(String.valueOf(jTable1.getValueAt(row, COL.TESTPARAMS.ordinal())));
//get the parameters directly frm he config file
// System.out.println("sTestPath: " + sTestPath);
HashMap mParameters = getParameters(sTestPath, sDevicePath);
HashMap mParameters = getTestParameters(sTestPath);
HashMap testArgs = new HashMap();
//args.put("ret", "");
testArgs.put(testArgNames.PARAMETERS.toString(), mParameters);
@@ -2214,13 +2181,13 @@ public class TestingList extends Panel {
DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
renderer.setToolTipText("Click for options");
jTable1.getColumnModel().getColumn(COL.STARTSEQUENCE.ordinal()).setCellRenderer(renderer);
jTable1.getColumnModel().getColumn(COL.STARTSEQUENCE.ordinal()).setPreferredWidth(30);
jTable1.getColumnModel().getColumn(COL.ICON.ordinal()).setMaxWidth(27);
jTable1.getColumnModel().getColumn(COL.CHECK.ordinal()).setMaxWidth(27);
jTable1.getColumnModel().getColumn(COL.DEVICENAME.ordinal()).setPreferredWidth(30);
jTable1.getColumnModel().getColumn(COL.STATUS.ordinal()).setPreferredWidth(20);
hideColumn(COL.DEVICEDESCR);
hideColumn(COL.DEVICEPATH);
hideColumn(COL.TESTPATH);
hideColumn(COL.TESTDESCR);
hideColumn(COL.TESTPARAMS);
@@ -2267,9 +2234,8 @@ public class TestingList extends Panel {
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
//String testPath = FilenameUtils.separatorsToSystem(TESTS_TESTS_DEFAULT_DIR + testSuite + "/" + testName + "/" + testName + ".py");
String testPath = Paths.get(TESTS_TESTS_DEFAULT_DIR.toString(), testSuite, testName, testName + ".py").toString();
String devicePath = Paths.get(TESTS_DEVICES_DEFAULT_DIR.toString(), deviceName, deviceName + ".config").toString();
System.out.println("Path = " + testPath);
Object rowData[] = new Object[]{false, "", sDate, deviceName, devicePath, deviceDescription, testSuite, testName, testPath, testParams, testDescription, testHelp, "", "Pending", icon};
Object rowData[] = new Object[]{false, "", sDate, deviceName, deviceDescription, testSuite, testName, testPath, testParams, testDescription, testHelp, "", "Pending", icon};
//vedify that this test is not already in the table
int totalRows = model.getRowCount();
boolean bTestAlreadyInTable = false;
@@ -2504,43 +2470,6 @@ public class TestingList extends Panel {
return buildParametersMap(testParams);
}
/**
* get the parameters from the test and device config file.
* the test config params are default params. if the same param name
* is also in the device config, it will override the test param.
*
* @param sTestPath directory where the test files are (directory with the
* test name)
* @param sdevicePath device config file path
* @return HashMap of the test parameters. See buildParametersMap() for
* details.
*/
private HashMap getParameters(String sTestPath, String sDevicePath) {
HashMap deviceParams = buildParametersMap(getConfigItem("parameters", sDevicePath));
HashMap testParams = buildParametersMap(getConfigItem("parameters", sTestPath));
HashMap params = new HashMap();
if(deviceParams.isEmpty()){
return testParams;
}
Iterator itD = deviceParams.entrySet().iterator();
System.out.println("deviceParams: " + deviceParams.size());
while (itD.hasNext()) {
Map.Entry pairD = (Map.Entry)itD.next();
System.out.println(pairD.getKey() + " = " + pairD.getValue());
params.putIfAbsent(pairD.getKey(), pairD.getValue());
}
Iterator it = testParams.entrySet().iterator();
System.out.println("testParams: " + testParams.size());
while (it.hasNext()) {
Map.Entry pair = (Map.Entry)it.next();
System.out.println(pair.getKey() + " = " + pair.getValue());
// add parameter only if not already on device parameters
params.putIfAbsent(pair.getKey(), pair.getValue());
}
return params;
}
/**
* Get the description of the test.
*

View File

@@ -57,11 +57,7 @@
</Group>
</Group>
</Group>
<Group type="102" attributes="0">
<Component id="jButtonOk1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jButtonOk" min="-2" pref="131" max="-2" attributes="0"/>
</Group>
<Component id="jButtonOk" min="-2" pref="96" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jScrollPaneHtml" pref="272" max="32767" attributes="0"/>
@@ -124,10 +120,7 @@
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jButtonOk" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jButtonOk1" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jButtonOk" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jScrollPaneHtml" pref="559" max="32767" attributes="0"/>
</Group>
@@ -397,8 +390,8 @@
</Container>
<Component class="javax.swing.JButton" name="jButtonOk">
<Properties>
<Property name="text" type="java.lang.String" value="Save as default"/>
<Property name="toolTipText" type="java.lang.String" value="Save parameters values as default (fo this test)"/>
<Property name="text" type="java.lang.String" value="Save"/>
<Property name="toolTipText" type="java.lang.String" value="Save parameters values"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonOkActionPerformed"/>
@@ -448,14 +441,5 @@
<Property name="text" type="java.lang.String" value="(Value valid for all devices)"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButtonOk1">
<Properties>
<Property name="text" type="java.lang.String" value="Save for this device"/>
<Property name="toolTipText" type="java.lang.String" value="Save parameters values for this specific device"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonOk1ActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

View File

@@ -54,7 +54,6 @@ public class TestingListDetails extends javax.swing.JPanel {
public static String TESTS_CONFIG_FILENAME = ".config";
public static Path TESTS_TESTS_DEFAULT_DIR = Paths.get(".", "home", "script", "tests", "tests");
public static Path TESTS_DEVICES_DEFAULT_DIR = Paths.get(".", "home", "script", "tests", "devices");
/**
* This method is called from within the constructor to initialize the form.
@@ -90,7 +89,6 @@ public class TestingListDetails extends javax.swing.JPanel {
jButtonMoreTest = new javax.swing.JButton();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jButtonOk1 = new javax.swing.JButton();
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel1.setText("Device name");
@@ -198,8 +196,8 @@ public class TestingListDetails extends javax.swing.JPanel {
jEditorPaneHelp.setPreferredSize(new java.awt.Dimension(6, 400));
jScrollPaneHtml.setViewportView(jEditorPaneHelp);
jButtonOk.setText("Save as default");
jButtonOk.setToolTipText("Save parameters values as default (fo this test)");
jButtonOk.setText("Save");
jButtonOk.setToolTipText("Save parameters values");
jButtonOk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonOkActionPerformed(evt);
@@ -231,14 +229,6 @@ public class TestingListDetails extends javax.swing.JPanel {
jLabel10.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel10.setText("(Value valid for all devices)");
jButtonOk1.setText("Save for this device");
jButtonOk1.setToolTipText("Save parameters values for this specific device");
jButtonOk1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonOk1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@@ -276,10 +266,7 @@ public class TestingListDetails extends javax.swing.JPanel {
.addComponent(txtTestName, javax.swing.GroupLayout.PREFERRED_SIZE, 441, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButtonMoreTest))))
.addGroup(layout.createSequentialGroup()
.addComponent(jButtonOk1)
.addGap(18, 18, 18)
.addComponent(jButtonOk, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jButtonOk, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jScrollPaneHtml, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)
.addContainerGap())
@@ -329,9 +316,7 @@ public class TestingListDetails extends javax.swing.JPanel {
.addComponent(jLabel10)
.addGap(0, 0, Short.MAX_VALUE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButtonOk)
.addComponent(jButtonOk1)))
.addComponent(jButtonOk))
.addComponent(jScrollPaneHtml, javax.swing.GroupLayout.DEFAULT_SIZE, 559, Short.MAX_VALUE))
.addContainerGap())
);
@@ -498,7 +483,8 @@ public class TestingListDetails extends javax.swing.JPanel {
}
private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
Path testPath = Paths.get(TESTS_TESTS_DEFAULT_DIR.toString(), this.txtTestSuite.getText(), this.txtTestName.getText());
// TODO add your handling code here:
Path testPath = Paths.get(TESTS_TESTS_DEFAULT_DIR.toString(), this.txtTestSuite.getText(), this.txtTestName.getText());
updateTestConfig(testPath, this.txtTestName.getText(), this.txtTestSuite.getText(),getParametersFromTable());
}//GEN-LAST:event_jButtonOkActionPerformed
@@ -507,29 +493,29 @@ public class TestingListDetails extends javax.swing.JPanel {
this.jButtonMoreResult.setText("Less");
this.jScrollPaneRes.setVisible(true);
this.jLabel9.setVisible(true);
this.txtDeviceName.setVisible(true);
this.jLabel1.setVisible(true);
this.jLabel2.setVisible(true);
this.txtDeviceDescription.setVisible(true);
}else{
this.jScrollPaneRes.setVisible(false);
this.jLabel9.setVisible(false);
this.txtDeviceName.setVisible(false);
this.jLabel1.setVisible(false);
this.jLabel2.setVisible(false);
this.txtDeviceDescription.setVisible(false);
this.jButtonMoreResult.setText("More");
}
}//GEN-LAST:event_jButtonMoreResultActionPerformed
private void jButtonMoreTestActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonMoreTestActionPerformed
if(this.jButtonMoreTest.getText()=="More"){
this.txtDeviceName.setVisible(true);
this.jLabel1.setVisible(true);
this.jLabel2.setVisible(true);
this.txtDeviceDescription.setVisible(true);
this.jButtonMoreTest.setText("Less");
this.jScrollPaneTestDesc.setVisible(true);
this.jLabel4.setVisible(true);
this.txtTestSuite.setVisible(true);
this.jLabel8.setVisible(true);
}else{
this.txtDeviceName.setVisible(false);
this.jLabel1.setVisible(false);
this.jLabel2.setVisible(false);
this.txtDeviceDescription.setVisible(false);
this.jScrollPaneTestDesc.setVisible(false);
this.jLabel4.setVisible(false);
this.txtTestSuite.setVisible(false);
@@ -538,17 +524,11 @@ public class TestingListDetails extends javax.swing.JPanel {
}
}//GEN-LAST:event_jButtonMoreTestActionPerformed
private void jButtonOk1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOk1ActionPerformed
Path devicePath = Paths.get(TESTS_DEVICES_DEFAULT_DIR.toString(), this.txtDeviceName.getText());
updateTestConfig(devicePath, this.txtTestName.getText(), this.txtTestSuite.getText(),getParametersFromTable());
}//GEN-LAST:event_jButtonOk1ActionPerformed
// <editor-fold defaultstate="collapsed" desc="Variables declaration">
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButtonMoreResult;
private javax.swing.JButton jButtonMoreTest;
private javax.swing.JButton jButtonOk;
private javax.swing.JButton jButtonOk1;
private javax.swing.JEditorPane jEditorPaneHelp;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;

View File

@@ -1,5 +1,5 @@
#TestingList for pshell: configuration properties
#Tue Mar 20 13:42:32 CET 2018
#Tue Mar 20 13:49:25 CET 2018
customPanel=
showEnabledTestsOnly=
listFilter=rps-test