From 663eb26426ac632c64062c35c914536bf3d2644e Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Thu, 7 Jul 2016 15:32:53 -0400 Subject: [PATCH 1/6] Update the UI when emails are added --- Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java index 35af75738b..89e8c5b217 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java @@ -140,6 +140,8 @@ public class EmailExtracted implements AutopsyVisitableItem { } catch (TskCoreException | SQLException ex) { logger.log(Level.WARNING, "Cannot initialize email extraction: ", ex); //NON-NLS } + setChanged(); + notifyObservers(); } private Map parsePath(String path) { From df7394f01cca4902543e3ea8ba43405164397383 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 11 Jul 2016 10:18:31 -0400 Subject: [PATCH 2/6] Revert "Update test code to handle new column in ingest modules table" This reverts commit 972174a9adcb701f1ed948c573d9ed02c9ba162a. --- .../src/org/sleuthkit/autopsy/testing/RegressionTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java index 4f5af72572..99db8bfb85 100755 --- a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java +++ b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java @@ -219,7 +219,7 @@ public class RegressionTest extends TestCase { WizardOperator wo = new WizardOperator("Add Data"); JTableOperator jto = new JTableOperator(wo, 0); int row = jto.findCellRow("Hash Lookup", 1, 0); - jto.clickOnCell(row, 2); + jto.clickOnCell(row, 1); JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings"); jbo1.pushNoBlock(); } @@ -259,7 +259,7 @@ public class RegressionTest extends TestCase { WizardOperator wo = new WizardOperator("Add Data"); JTableOperator jto = new JTableOperator(wo, 0); int row = jto.findCellRow("Keyword Search", 1, 0); - jto.clickOnCell(row, 2); + jto.clickOnCell(row, 1); JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings"); jbo1.pushNoBlock(); } From 2c0ffab008f8ae9bbdbbc074fffdeaa4fc1dc2f3 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 11 Jul 2016 10:24:54 -0400 Subject: [PATCH 3/6] Added logging to RegressionTest.testConfigureIngest1 and testConfigureIngest2 --- .../src/org/sleuthkit/autopsy/testing/RegressionTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java index 99db8bfb85..32f747adaa 100755 --- a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java +++ b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java @@ -215,13 +215,15 @@ public class RegressionTest extends TestCase { } public void testConfigureIngest1() { - logger.info("Ingest 1"); + logger.info("Looking for hash lookup module in ingest job settings panel"); WizardOperator wo = new WizardOperator("Add Data"); JTableOperator jto = new JTableOperator(wo, 0); int row = jto.findCellRow("Hash Lookup", 1, 0); jto.clickOnCell(row, 1); + logger.info("Selected hash lookup module in ingest job settings panel"); JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings"); jbo1.pushNoBlock(); + logger.info("Pushed Global Settings button for hash lookup module in ingest job settings panel"); } public void testConfigureHash() { @@ -255,13 +257,15 @@ public class RegressionTest extends TestCase { } 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"); JTableOperator jto = new JTableOperator(wo, 0); int row = jto.findCellRow("Keyword Search", 1, 0); jto.clickOnCell(row, 1); + logger.info("Selected keyword search module in ingest job settings panel"); JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings"); jbo1.pushNoBlock(); + logger.info("Pushed Global Settings button for keyword search module in ingest job settings panel"); } public void testConfigureSearch() { From b296e751e40590dbb4152b440af8bee55d5174c1 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 11 Jul 2016 11:00:22 -0400 Subject: [PATCH 4/6] Fix icon warning display for ingest job settings panel --- .../ingest/IngestJobSettingsPanel.java | 83 +++++++++---------- 1 file changed, 40 insertions(+), 43 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index 0a368a635e..410ca3a0c7 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -1,15 +1,15 @@ /* * Autopsy Forensic Browser - * - * Copyright 2011-2014 Basis Technology Corp. + * + * Copyright 2011-2016 Basis Technology Corp. * Contact: carrier sleuthkit org - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -56,12 +56,15 @@ import org.sleuthkit.datamodel.TskCoreException; */ 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 List dataSources; private final List modules; + private List ingestJobs; private IngestModuleModel selectedModule; private IngestModulesTableModel tableModel = new IngestModulesTableModel(); - private List ingestJobs; - private List dataSources; private static final Logger logger = Logger.getLogger(IngestJobSettingsPanel.class.getName()); /** @@ -156,25 +159,22 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { // Add a selection listener to the table model that will display the // ingest job options panel of the currently selected module model and // enable or disable the resources configuration panel invocation button. - modulesTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent e) { - ListSelectionModel listSelectionModel = (ListSelectionModel) e.getSource(); - if (!listSelectionModel.isSelectionEmpty()) { - int index = listSelectionModel.getMinSelectionIndex(); - selectedModule = modules.get(index); - ingestSettingsPanel.removeAll(); - if (null != selectedModule.getModuleSettingsPanel()) { - ingestSettingsPanel.add(selectedModule.getModuleSettingsPanel()); - } else { - ingestSettingsPanel.add(new JLabel(Bundle.IngestJobSettingsPanel_noPerRunSettings())); - } - ingestSettingsPanel.revalidate(); - ingestSettingsPanel.repaint(); - globalSettingsButton.setEnabled(null != selectedModule.getGlobalSettingsPanel()); - descriptionLabel.setText(selectedModule.getDescription()); - descriptionLabel.setToolTipText(selectedModule.getDescription()); + modulesTable.getSelectionModel().addListSelectionListener((ListSelectionEvent e) -> { + ListSelectionModel listSelectionModel = (ListSelectionModel) e.getSource(); + if (!listSelectionModel.isSelectionEmpty()) { + int index = listSelectionModel.getMinSelectionIndex(); + selectedModule = modules.get(index); + ingestSettingsPanel.removeAll(); + if (null != selectedModule.getModuleSettingsPanel()) { + ingestSettingsPanel.add(selectedModule.getModuleSettingsPanel()); + } else { + ingestSettingsPanel.add(new JLabel(Bundle.IngestJobSettingsPanel_noPerRunSettings())); } + ingestSettingsPanel.revalidate(); + ingestSettingsPanel.repaint(); + globalSettingsButton.setEnabled(null != selectedModule.getGlobalSettingsPanel()); + descriptionLabel.setText(selectedModule.getDescription()); + descriptionLabel.setToolTipText(selectedModule.getDescription()); } }); modulesTable.setRowSelectionInterval(0, 0); @@ -354,14 +354,11 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { private void globalSettingsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_globalSettingsButtonActionPerformed final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(true); - dialog.addApplyButtonListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - if (selectedModule.hasGlobalSettingsPanel()) { - selectedModule.saveResourcesConfig(); - } - dialog.close(); + dialog.addApplyButtonListener((ActionEvent e) -> { + if (selectedModule.hasGlobalSettingsPanel()) { + selectedModule.saveResourcesConfig(); } + dialog.close(); }); dialog.addWindowListener(new WindowAdapter() { @@ -491,9 +488,6 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { */ 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 public int getRowCount() { return modules.size(); @@ -507,12 +501,13 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { @Override public Object getValueAt(int rowIndex, int columnIndex) { IngestModuleModel module = modules.get(rowIndex); - if (columnIndex == 0) { - return module.isEnabled(); - } else if (columnIndex == 1) { - return getIcon(module); - } else { - return module.getName(); + switch (columnIndex) { + case 0: + return module.isEnabled(); + case 1: + return getIcon(module); + default: + 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."}) private class IngestModulesTableRenderer extends DefaultTableCellRenderer { + private static final long serialVersionUID = 1L; + List tooltips = new ArrayList<>(); public IngestModulesTableRenderer() { @@ -613,9 +610,9 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel { } else if (1 == column) { setIcon((Icon) value); setText(""); - if (tableModel.warningIcon.equals(value)) { + if (warningIcon.equals(value)) { setToolTipText(Bundle.IngestJobSettingsPanel_IngestModulesTableRenderer_warning_message()); - } else if (tableModel.infoIcon.equals(value)) { + } else if (infoIcon.equals(value)) { setToolTipText(Bundle.IngestJobSettingsPanel_IngestModulesTableRenderer_info_message()); } } From bbfa4689e8e9e72443e216fa914a1c4b9dd967bd Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 11 Jul 2016 13:23:56 -0400 Subject: [PATCH 5/6] Add timeout to regression test to allow for setup of ingest job settings panel --- .../sleuthkit/autopsy/testing/RegressionTest.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java index 32f747adaa..96f8f4cc10 100755 --- a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java +++ b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java @@ -1,15 +1,15 @@ /* * Autopsy Forensic Browser - * + * * Copyright 2011-2014 Basis Technology Corp. * Contact: carrier sleuthkit org - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -215,6 +215,12 @@ public class RegressionTest extends TestCase { } public void testConfigureIngest1() { + /* + * 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"); JTableOperator jto = new JTableOperator(wo, 0); From 63a1717e7b1624e6d591a44ec3b0ccb18246f9d4 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Mon, 11 Jul 2016 14:27:17 -0400 Subject: [PATCH 6/6] Update regression test code for ingest job settings panel changes --- .../src/org/sleuthkit/autopsy/testing/RegressionTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java index 96f8f4cc10..26447f112a 100755 --- a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java +++ b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java @@ -224,7 +224,7 @@ public class RegressionTest extends TestCase { logger.info("Looking for hash lookup module in ingest job settings panel"); WizardOperator wo = new WizardOperator("Add Data"); 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, 1); logger.info("Selected hash lookup module in ingest job settings panel"); JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings"); @@ -266,7 +266,7 @@ public class RegressionTest extends TestCase { logger.info("Looking for keyword search module in ingest job settings panel"); WizardOperator wo = new WizardOperator("Add Data"); 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, 1); logger.info("Selected keyword search module in ingest job settings panel"); JButtonOperator jbo1 = new JButtonOperator(wo, "Global Settings");