Merge branch 'develop' of https://github.com/sleuthkit/autopsy into kws

This commit is contained in:
Eugene Livis 2016-07-12 10:16:09 -04:00
commit b2bd247fa1
3 changed files with 62 additions and 53 deletions

View File

@ -140,6 +140,8 @@ public class EmailExtracted implements AutopsyVisitableItem {
} catch (TskCoreException | SQLException ex) { } catch (TskCoreException | SQLException ex) {
logger.log(Level.WARNING, "Cannot initialize email extraction: ", ex); //NON-NLS logger.log(Level.WARNING, "Cannot initialize email extraction: ", ex); //NON-NLS
} }
setChanged();
notifyObservers();
} }
private Map<String, String> parsePath(String path) { private Map<String, String> parsePath(String path) {

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2014 Basis Technology Corp. * Copyright 2011-2016 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -56,12 +56,15 @@ import org.sleuthkit.datamodel.TskCoreException;
*/ */
public final class IngestJobSettingsPanel extends javax.swing.JPanel { public final class IngestJobSettingsPanel extends javax.swing.JPanel {
private static final long serialVersionUID = 1L;
private static ImageIcon warningIcon = new ImageIcon(IngestJobSettingsPanel.class.getResource("/org/sleuthkit/autopsy/images/warning_triangle.png"));
private static ImageIcon infoIcon = new ImageIcon(IngestJobSettingsPanel.class.getResource("/org/sleuthkit/autopsy/images/information-frame.png"));
private final IngestJobSettings settings; private final IngestJobSettings settings;
private final List<Content> dataSources;
private final List<IngestModuleModel> modules; private final List<IngestModuleModel> modules;
private List<IngestJobInfo> ingestJobs;
private IngestModuleModel selectedModule; private IngestModuleModel selectedModule;
private IngestModulesTableModel tableModel = new IngestModulesTableModel(); private IngestModulesTableModel tableModel = new IngestModulesTableModel();
private List<IngestJobInfo> ingestJobs;
private List<Content> dataSources;
private static final Logger logger = Logger.getLogger(IngestJobSettingsPanel.class.getName()); private static final Logger logger = Logger.getLogger(IngestJobSettingsPanel.class.getName());
/** /**
@ -156,9 +159,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
// Add a selection listener to the table model that will display the // Add a selection listener to the table model that will display the
// ingest job options panel of the currently selected module model and // ingest job options panel of the currently selected module model and
// enable or disable the resources configuration panel invocation button. // enable or disable the resources configuration panel invocation button.
modulesTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { modulesTable.getSelectionModel().addListSelectionListener((ListSelectionEvent e) -> {
@Override
public void valueChanged(ListSelectionEvent e) {
ListSelectionModel listSelectionModel = (ListSelectionModel) e.getSource(); ListSelectionModel listSelectionModel = (ListSelectionModel) e.getSource();
if (!listSelectionModel.isSelectionEmpty()) { if (!listSelectionModel.isSelectionEmpty()) {
int index = listSelectionModel.getMinSelectionIndex(); int index = listSelectionModel.getMinSelectionIndex();
@ -175,7 +176,6 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
descriptionLabel.setText(selectedModule.getDescription()); descriptionLabel.setText(selectedModule.getDescription());
descriptionLabel.setToolTipText(selectedModule.getDescription()); descriptionLabel.setToolTipText(selectedModule.getDescription());
} }
}
}); });
modulesTable.setRowSelectionInterval(0, 0); modulesTable.setRowSelectionInterval(0, 0);
processUnallocCheckbox.setSelected(this.settings.getProcessUnallocatedSpace()); processUnallocCheckbox.setSelected(this.settings.getProcessUnallocatedSpace());
@ -354,14 +354,11 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
private void globalSettingsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_globalSettingsButtonActionPerformed private void globalSettingsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_globalSettingsButtonActionPerformed
final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(true); final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(true);
dialog.addApplyButtonListener(new ActionListener() { dialog.addApplyButtonListener((ActionEvent e) -> {
@Override
public void actionPerformed(ActionEvent e) {
if (selectedModule.hasGlobalSettingsPanel()) { if (selectedModule.hasGlobalSettingsPanel()) {
selectedModule.saveResourcesConfig(); selectedModule.saveResourcesConfig();
} }
dialog.close(); dialog.close();
}
}); });
dialog.addWindowListener(new WindowAdapter() { dialog.addWindowListener(new WindowAdapter() {
@ -491,9 +488,6 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
*/ */
private class IngestModulesTableModel extends AbstractTableModel { private class IngestModulesTableModel extends AbstractTableModel {
ImageIcon warningIcon = new ImageIcon("Core\\src\\org\\sleuthkit\\autopsy\\images\\warning_triangle.png");
ImageIcon infoIcon = new ImageIcon("Core\\src\\org\\sleuthkit\\autopsy\\images\\information-frame.png");
@Override @Override
public int getRowCount() { public int getRowCount() {
return modules.size(); return modules.size();
@ -507,11 +501,12 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
@Override @Override
public Object getValueAt(int rowIndex, int columnIndex) { public Object getValueAt(int rowIndex, int columnIndex) {
IngestModuleModel module = modules.get(rowIndex); IngestModuleModel module = modules.get(rowIndex);
if (columnIndex == 0) { switch (columnIndex) {
case 0:
return module.isEnabled(); return module.isEnabled();
} else if (columnIndex == 1) { case 1:
return getIcon(module); return getIcon(module);
} else { default:
return module.getName(); return module.getName();
} }
} }
@ -596,6 +591,8 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
"IngestJobSettingsPanel.IngestModulesTableRenderer.info.message=A previous version of this ingest module has been run before on this data source."}) "IngestJobSettingsPanel.IngestModulesTableRenderer.info.message=A previous version of this ingest module has been run before on this data source."})
private class IngestModulesTableRenderer extends DefaultTableCellRenderer { private class IngestModulesTableRenderer extends DefaultTableCellRenderer {
private static final long serialVersionUID = 1L;
List<String> tooltips = new ArrayList<>(); List<String> tooltips = new ArrayList<>();
public IngestModulesTableRenderer() { public IngestModulesTableRenderer() {
@ -613,9 +610,9 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
} else if (1 == column) { } else if (1 == column) {
setIcon((Icon) value); setIcon((Icon) value);
setText(""); setText("");
if (tableModel.warningIcon.equals(value)) { if (warningIcon.equals(value)) {
setToolTipText(Bundle.IngestJobSettingsPanel_IngestModulesTableRenderer_warning_message()); setToolTipText(Bundle.IngestJobSettingsPanel_IngestModulesTableRenderer_warning_message());
} else if (tableModel.infoIcon.equals(value)) { } else if (infoIcon.equals(value)) {
setToolTipText(Bundle.IngestJobSettingsPanel_IngestModulesTableRenderer_info_message()); setToolTipText(Bundle.IngestJobSettingsPanel_IngestModulesTableRenderer_info_message());
} }
} }

View File

@ -215,13 +215,21 @@ public class RegressionTest extends TestCase {
} }
public void testConfigureIngest1() { public void testConfigureIngest1() {
logger.info("Ingest 1"); /*
* This timeout is to allow the setup for the ingest job settings panel
* to complete.
*/
new Timeout("pausing", 10000).sleep();
logger.info("Looking for hash lookup module in ingest job settings panel");
WizardOperator wo = new WizardOperator("Add Data"); WizardOperator wo = new WizardOperator("Add Data");
JTableOperator jto = new JTableOperator(wo, 0); JTableOperator jto = new JTableOperator(wo, 0);
int row = jto.findCellRow("Hash Lookup", 1, 0); int row = jto.findCellRow("Hash Lookup", 2, 0);
jto.clickOnCell(row, 2); jto.clickOnCell(row, 1);
logger.info("Selected hash lookup module in ingest job settings panel");
JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings"); JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings");
jbo1.pushNoBlock(); jbo1.pushNoBlock();
logger.info("Pushed Global Settings button for hash lookup module in ingest job settings panel");
} }
public void testConfigureHash() { public void testConfigureHash() {
@ -255,13 +263,15 @@ public class RegressionTest extends TestCase {
} }
public void testConfigureIngest2() { public void testConfigureIngest2() {
logger.info("Ingest 2"); logger.info("Looking for keyword search module in ingest job settings panel");
WizardOperator wo = new WizardOperator("Add Data"); WizardOperator wo = new WizardOperator("Add Data");
JTableOperator jto = new JTableOperator(wo, 0); JTableOperator jto = new JTableOperator(wo, 0);
int row = jto.findCellRow("Keyword Search", 1, 0); int row = jto.findCellRow("Keyword Search", 2, 0);
jto.clickOnCell(row, 2); jto.clickOnCell(row, 1);
logger.info("Selected keyword search module in ingest job settings panel");
JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings"); JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings");
jbo1.pushNoBlock(); jbo1.pushNoBlock();
logger.info("Pushed Global Settings button for keyword search module in ingest job settings panel");
} }
public void testConfigureSearch() { public void testConfigureSearch() {