From 426fc0a881996174656022ea320c43836b38554c Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Wed, 17 Jan 2018 09:59:06 -0500 Subject: [PATCH 01/62] Updated error messages and surrounding logic for KWS. --- .../autopsy/keywordsearch/AccountsText.java | 18 ++-- .../autopsy/keywordsearch/Bundle.properties | 6 -- .../keywordsearch/Bundle_ja.properties | 4 +- .../keywordsearch/ExtractedContentPanel.java | 4 +- .../keywordsearch/ExtractedContentViewer.java | 6 ++ .../keywordsearch/HighlightedText.java | 15 ++-- .../autopsy/keywordsearch/RawText.java | 88 ++++++++----------- 7 files changed, 58 insertions(+), 83 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java index e5f17cef12..812a16bbbf 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -35,6 +35,7 @@ import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrRequest.METHOD; import org.apache.solr.client.solrj.response.QueryResponse; import org.openide.util.NbBundle; +import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Version; import org.sleuthkit.datamodel.BlackboardArtifact; @@ -52,7 +53,7 @@ import org.sleuthkit.datamodel.TskCoreException; */ class AccountsText implements IndexedText { - private static final Logger logger = Logger.getLogger(AccountsText.class.getName()); + private static final Logger LOGGER = Logger.getLogger(AccountsText.class.getName()); private static final boolean DEBUG = (Version.getBuildType() == Version.Type.DEVELOPMENT); private static final String CCN_REGEX = "(%?)(B?)([0-9][ \\-]*?){12,19}(\\^?)"; @@ -284,15 +285,6 @@ class AccountsText implements IndexedText { } @Override - @NbBundle.Messages({"AccountsText.getMarkup.noMatchMsg=" - + "
There were no keyword hits on this page. 
" - + "The keyword could have been in the file name." - + "
Advance to another page if present, or to view the original text, choose File Text" - + "
in the drop down menu to the right...
", - "AccountsText.getMarkup.queryFailedMsg=" - + "
Failed to retrieve keyword hit results."
-        + " 
Confirm that Autopsy can connect to the Solr server. " - + "
"}) public String getText() { try { loadPageInfo(); //inits once @@ -320,8 +312,8 @@ class AccountsText implements IndexedText { // extracted content (minus highlight tags) is HTML-escaped return "
" + highlightedText + "
"; //NON-NLS } catch (Exception ex) { - logger.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + this.solrObjectId + ", chunkID " + this.currentPage, ex); //NON-NLS - return Bundle.AccountsText_getMarkup_queryFailedMsg(); + LOGGER.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + this.solrObjectId + ", chunkID " + this.currentPage, ex); //NON-NLS + return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getText.error.msg"); } } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties index 8be786efda..2730c08b5c 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties @@ -54,11 +54,6 @@ AbstractKeywordSearchPerformer.search.noFilesInIdxMsg=No files are in inde AbstractKeywordSearchPerformer.search.noFilesIdxdMsg=No files were indexed.
Re-ingest the image with the Keyword Search Module enabled. ExtractedContentViewer.toolTip=Displays extracted text from files and keyword-search results. Requires Keyword Search ingest to be run on a file to activate this viewer. ExtractedContentViewer.getTitle=Indexed Text -ExtractedContentViewer.getSolrContent.knownFileMsg=

{0} is a known file (based on MD5 hash) and does not have text in the index.

-ExtractedContentViewer.getSolrContent.noTxtYetMsg=

{0} does not have text in the index.
It may have no text, not been analyzed yet, or keyword search was not enabled during ingest.

-ExtractedContentViewer.getSolrContent.txtBodyItal={0} -HighlightedMatchesSource.getMarkup.noMatchMsg=Failed to retrieve indexed text for keyword hit. Advance to another page if present, or to view the original text, choose File Text in the drop down menu to the right. Alternatively, you may choose to extract file content and search for the hit using an external application (e.g. a text editor). -HighlightedMatchesSource.getMarkup.queryFailedMsg=
Failed to retrieve keyword hit results. 
Confirm that Autopsy can connect to the Solr server.
HighlightedMatchesSource.toString=Search Results Installer.reportPortError=Indexing server port {0} is not available. Check if your security software does not block {1} and consider changing {2} in {3} property file in the application user folder. Then try rebooting your system if another process was causing the conflict. Installer.reportStopPortError=Indexing server stop port {0} is not available. Consider changing {1} in {2} property file in the application user folder. @@ -272,7 +267,6 @@ KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.text=No periodic searche SolrConnectionCheck.HostnameOrPort=Invalid hostname and/or port number. SolrConnectionCheck.Hostname=Invalid hostname. SolrConnectionCheck.MissingHostname=Missing hostname. -RawText.getText.error.msg=Error getting text GlobalListsManagementPanel.newListButton.text=New List GlobalListsManagementPanel.importButton.text=Import List GlobalListsManagementPanel.keywordListsLabel.text=Keyword Lists: diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle_ja.properties b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle_ja.properties index bdcc19f6f6..dbaae76b16 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle_ja.properties +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle_ja.properties @@ -46,7 +46,6 @@ AbstractKeywordSearchPerformer.search.noFilesIdxdMsg=\u30a4\u30f3\u30c7\u3 ExtractedContentPanel.setMarkup.panelTxt=\u30c6\u30ad\u30b9\u30c8\u30ed\u30fc\u30c9\u4e2d...\u3057\u3070\u3089\u304f\u304a\u5f85\u3061\u304f\u3060\u3055\u3044\u3002 ExtractedContentViewer.toolTip=\u30d5\u30a1\u30a4\u30eb\u3084\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u7d50\u679c\u304b\u3089\u62bd\u51fa\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u3092\u8868\u793a\u3002\u3053\u306e\u30d3\u30e5\u30fc\u30a2\u3092\u6709\u52b9\u5316\u3059\u308b\u306b\u306f\u3001\u30d5\u30a1\u30a4\u30eb\u306b\u5bfe\u3057\u3066\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u3092\u5b9f\u884c\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 ExtractedContentViewer.getTitle=\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5316\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8 -ExtractedContentViewer.getSolrContent.knownFileMsg=

{0}\u306f\u65e2\u77e5\u30d5\u30a1\u30a4\u30eb\u3067\u3059\uff08MDS\u30cf\u30c3\u30b7\u30e5\u306b\u57fa\u3065\u304f\u3068\uff09\u3002\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093\u3002

ExtractedContentViewer.getSolrContent.noTxtYetMsg=

{0}\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u3042\u308a\u307e\u305b\u3093\u3002
\u30c6\u30ad\u30b9\u30c8\u304c\u7121\u3044\u304b\u3001\u307e\u3060\u89e3\u6790\u3055\u308c\u3066\u3044\u306a\u3044\u304b\u3001\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u304c\u30a4\u30f3\u30b8\u30a7\u30b9\u30c8\u4e2d\u306b\u6709\u52b9\u5316\u3055\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002

HighlightedMatchesSource.toString=\u691c\u7d22\u7d50\u679c Installer.reportPortError=\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30b5\u30fc\u30d0\u30fc\u30dd\u30fc\u30c8 {0} \u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002\u4f7f\u7528\u3057\u3066\u3044\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c {1} \u3092\u30d6\u30ed\u30c3\u30af\u3057\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30e6\u30fc\u30b6\u30fc\u30d5\u30a9\u30eb\u30c0\u30fc\u5185\u306e{3}\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u306e{2}\u3092\u5909\u66f4\u3059\u308b\u691c\u8a0e\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3082\u3057\u4ed6\u306e\u51e6\u7406\u304c\u554f\u984c\u306e\u539f\u56e0\u3067\u3042\u308c\u3070\u3001\u30b7\u30b9\u30c6\u30e0\u3092\u518d\u8d77\u52d5\u3057\u3066\u4e0b\u3055\u3044\u3002 @@ -261,7 +260,6 @@ KeywordSearchModuleFactory.getIngestJobSettingsPanel.exception.msg=\u8a2d\u5b9a\ SearchRunner.Searcher.done.err.msg=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3092\u5b9f\u884c\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.text=\u5b9a\u671f\u7684\u691c\u7d22\u7121\u3057 KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.toolTipText=\u5168\u4f53\u7684\u306b\u4e00\u756a\u901f\u3044\u3067\u3059\u304c\u3001\u51e6\u7406\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u7d50\u679c\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093 -HighlightedMatchesSource.getMarkup.queryFailedMsg=
\u30ad\u30fc\u30ef\u30fc\u30c9\u306b\u30d2\u30c3\u30c8\u3057\u305f\u7d50\u679c\u3092\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002
Autopsy\u304cSolr\u30b5\u30fc\u30d0\u30fc\u306b\u63a5\u7d9a\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002
\ KeywordSearch.openCore.notification.msg=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f KeywordSearch.closeCore.notification.msg=\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u9589\u3058\u308b\u969b\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f KeywordSearchListsManagementPanel.fileExtensionFilterLb2=\u30ad\u30fc\u30ef\u30fc\u30c9\u30ea\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u30a8\u30f3\u30b1\u30fc\u30b9\u3059\u308b(txt) @@ -272,7 +270,7 @@ SolrConnectionCheck.HostnameOrPort=hostname\u3084\u30dd\u30fc\u30c8\u756a\u53f7\ SolrConnectionCheck.Hostname=hostname\u304c\u7121\u52b9\u3067\u3059\u3002 SolrConnectionCheck.Port=\u30dd\u30fc\u30c8\u756a\u53f7\u304c\u7121\u52b9\u3067\u3059\u3002 SolrConnectionCheck.MissingHostname=hostname\u304c\u6b20\u3051\u3066\u307e\u3059\u3002 -RawText.getText.error.msg=\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f +ExtractedContentViewer.getText.error.msg=\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f GlobalListsManagementPanel.exportButton.text=\u30ea\u30b9\u30c8\u3092\u30a8\u30af\u30b9\u30dd\u30fc\u30c8 GlobalListsManagementPanel.deleteListButton.text=\u30ea\u30b9\u30c8\u3092\u524a\u9664 GlobalListsManagementPanel.copyListButton.text=\u30ea\u30b9\u30c8\u3092\u30b3\u30d4\u30fc diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java index 01647f2a46..fd8966e254 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java @@ -648,7 +648,7 @@ class ExtractedContentPanel extends javax.swing.JPanel { } @NbBundle.Messages({ - "ExtractedContentPanel.SetMarkup.error=There was an error getting the text for the selected source."}) + "ExtractedContentPanel.SetMarkup.error.msg=Error getting text."}) @Override protected void done() { super.done(); @@ -665,7 +665,7 @@ class ExtractedContentPanel extends javax.swing.JPanel { } catch (InterruptedException | ExecutionException ex) { logger.log(Level.SEVERE, "Error getting marked up text", ex); //NON-NLS - setPanelText(Bundle.ExtractedContentPanel_SetMarkup_error(), true); + setPanelText(NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentPanel.getText.error.msg"), true); } // catch and ignore if we were cancelled catch (java.util.concurrent.CancellationException ex) { } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java index dbed68e660..27c5ae6b72 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java @@ -29,6 +29,7 @@ import java.util.logging.Level; import org.openide.nodes.Node; import org.openide.util.Lookup; import org.openide.util.NbBundle; +import org.openide.util.NbBundle.Messages; import org.openide.util.lookup.ServiceProvider; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer; @@ -47,6 +48,11 @@ import org.sleuthkit.datamodel.TskCoreException; * A content viewer that displays the indexed text associated with a file or an * artifact, possibly marked up with HTML to highlight keyword hits. */ +@Messages({ + "ExtractedContentViewer.getText.error.msg=Error getting text.", + "ExtractedContentViewer.getSolrContent.noTxtYetMsg=

There is currently no text in the index for this {0}. It may have no text, it may not have been analyzed yet, there may have been an error extracting text, or keyword search was not enabled during ingest.

", + "ExtractedContentViewer.getSolrContent.txtBodyItal={0}" +}) @ServiceProvider(service = DataContentViewer.class, position = 4) public class ExtractedContentViewer implements DataContentViewer { diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java index 70d2e69194..06f79de439 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.keywordsearch; import com.google.common.collect.Iterators; import com.google.common.collect.Range; -import com.google.common.collect.RangeSet; import com.google.common.collect.TreeRangeSet; import java.util.Arrays; import java.util.Collection; @@ -55,7 +54,7 @@ import org.sleuthkit.datamodel.TskCoreException; */ class HighlightedText implements IndexedText { - private static final Logger logger = Logger.getLogger(HighlightedText.class.getName()); + private static final Logger LOGGER = Logger.getLogger(HighlightedText.class.getName()); private static final boolean DEBUG = (Version.getBuildType() == Version.Type.DEVELOPMENT); @@ -140,7 +139,6 @@ class HighlightedText implements IndexedText { * This method figures out which pages / chunks have hits. Invoking it a * second time has no effect. */ - @Messages({"HighlightedText.query.exception.msg=Could not perform the query to get chunk info and get highlights:"}) synchronized private void loadPageInfo() throws TskCoreException, KeywordSearchModuleException, NoOpenCoreException { if (isPageInfoLoaded) { return; @@ -158,7 +156,6 @@ class HighlightedText implements IndexedText { this.numberPages = 1; this.currentPage = 1; numberOfHitsPerPage.put(1, 0); - pages.add(1); currentHitPerPage.put(1, 0); isPageInfoLoaded = true; } @@ -401,7 +398,7 @@ class HighlightedText implements IndexedText { // either be a single chunk containing hits or we narrow our // query down to the current page/chunk. if (response.getResults().size() > 1) { - logger.log(Level.WARNING, "Unexpected number of results for Solr highlighting query: {0}", q); //NON-NLS + LOGGER.log(Level.WARNING, "Unexpected number of results for Solr highlighting query: {0}", q); //NON-NLS } String highlightedContent; Map>> responseHighlight = response.getHighlighting(); @@ -427,8 +424,8 @@ class HighlightedText implements IndexedText { return "
" + highlightedContent + "
"; //NON-NLS } catch (TskCoreException | KeywordSearchModuleException | NoOpenCoreException ex) { - logger.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + objectId + ", chunkID " + chunkID + ", highlight query: " + highlightField, ex); //NON-NLS - return NbBundle.getMessage(this.getClass(), "HighlightedMatchesSource.getMarkup.queryFailedMsg"); + LOGGER.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + objectId + ", chunkID " + chunkID + ", highlight query: " + highlightField, ex); //NON-NLS + return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getText.error.msg"); } } @@ -471,7 +468,7 @@ class HighlightedText implements IndexedText { */ static String attemptManualHighlighting(SolrDocumentList solrDocumentList, String highlightField, Collection keywords) { if (solrDocumentList.isEmpty()) { - return NbBundle.getMessage(HighlightedText.class, "HighlightedMatchesSource.getMarkup.noMatchMsg"); + return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "document"); // DLG: } // It doesn't make sense for there to be more than a single document in diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java index 043738ae30..25a32401ef 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,16 +18,14 @@ */ package org.sleuthkit.autopsy.keywordsearch; -import java.util.LinkedHashMap; import java.util.logging.Level; import org.apache.solr.client.solrj.SolrServerException; import org.openide.util.NbBundle; +import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.Content; -import org.sleuthkit.datamodel.TskData; /** * A "source" for the extracted content viewer that displays "raw" (not @@ -44,7 +42,7 @@ class RawText implements IndexedText { //keep last content cached private String cachedString; private int cachedChunk; - private static final Logger logger = Logger.getLogger(RawText.class.getName()); + private static final Logger LOGGER = Logger.getLogger(RawText.class.getName()); /** * Construct a new RawText object for the given content and object id. This @@ -153,10 +151,10 @@ class RawText implements IndexedText { } else if (this.blackboardArtifact != null) { return getArtifactText(); } - } catch (SolrServerException ex) { - logger.log(Level.SEVERE, "Couldn't get extracted content", ex); //NON-NLS + } catch (SolrServerException | NoOpenCoreException ex) { + LOGGER.log(Level.SEVERE, "Couldn't get extracted text", ex); //NON-NLS } - return NbBundle.getMessage(this.getClass(), "RawText.getText.error.msg"); + return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewerRawText.getText.error.msg"); } @NbBundle.Messages({ @@ -208,10 +206,10 @@ class RawText implements IndexedText { hasChunks = true; } } catch (KeywordSearchModuleException ex) { - logger.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS } catch (NoOpenCoreException ex) { - logger.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS + LOGGER.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS } } @@ -225,30 +223,20 @@ class RawText implements IndexedText { * chunks. This means we need to address the content * pages specially. * - * @return the extracted content + * @return the extracted text * - * @throws SolrServerException if something goes wrong + * @throws NoOpenCoreException If no Solr core is available. + * @throws SolrServerException If there's a Solr communication or parsing issue. */ - private String getContentText(int currentPage, boolean hasChunks) throws SolrServerException { + private String getContentText(int currentPage, boolean hasChunks) throws NoOpenCoreException, SolrServerException { final Server solrServer = KeywordSearch.getServer(); if (hasChunks == false) { //if no chunks, it is safe to assume there is no text content //because we are storing extracted text in chunks only //and the non-chunk stores meta-data only - String name = content.getName(); - String msg = null; - if (content instanceof AbstractFile) { - //we know it's AbstractFile, but do quick check to make sure if we index other objects in future - boolean isKnown = TskData.FileKnown.KNOWN.equals(((AbstractFile) content).getKnown()); - if (isKnown && KeywordSearchSettings.getSkipKnown()) { - msg = NbBundle.getMessage(this.getClass(), "ExtractedContentViewer.getSolrContent.knownFileMsg", name); - } - } - if (msg == null) { - msg = NbBundle.getMessage(this.getClass(), "ExtractedContentViewer.getSolrContent.noTxtYetMsg", name); - } - String htmlMsg = NbBundle.getMessage(this.getClass(), "ExtractedContentViewer.getSolrContent.txtBodyItal", msg); + String msg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "file"); + String htmlMsg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.txtBodyItal", msg); return htmlMsg; } @@ -262,33 +250,33 @@ class RawText implements IndexedText { } //not cached - try { - String indexedText = solrServer.getSolrContent(this.objectId, chunkId); - if (indexedText == null) indexedText = ""; - cachedString = EscapeUtil.escapeHtml(indexedText).trim(); - StringBuilder sb = new StringBuilder(cachedString.length() + 20); - sb.append("
").append(cachedString).append("
"); //NON-NLS - cachedString = sb.toString(); - cachedChunk = chunkId; - } catch (NoOpenCoreException ex) { - logger.log(Level.SEVERE, "No open core", ex); //NON-NLS - return ""; - } + String indexedText = solrServer.getSolrContent(this.objectId, chunkId); + if (indexedText == null) indexedText = ""; + cachedString = EscapeUtil.escapeHtml(indexedText).trim(); + StringBuilder sb = new StringBuilder(cachedString.length() + 20); + sb.append("
").append(cachedString).append("
"); //NON-NLS + cachedString = sb.toString(); + cachedChunk = chunkId; + return cachedString; } - private String getArtifactText() throws SolrServerException{ - try { - String indexedText = KeywordSearch.getServer().getSolrContent(this.objectId, 1); - if (indexedText == null) indexedText = ""; - indexedText = EscapeUtil.escapeHtml(indexedText).trim(); - StringBuilder sb = new StringBuilder(indexedText.length() + 20); - sb.append("
").append(indexedText).append("
"); //NON-NLS - return sb.toString(); - } catch (NoOpenCoreException ex) { - logger.log(Level.SEVERE, "No open core", ex); //NON-NLS - return ""; - } + /** + * Get extracted artifact for a node from Solr + * + * @return the extracted text + * + * @throws NoOpenCoreException If no Solr core is available. + * @throws SolrServerException If there's a Solr communication or parsing issue. + */ + private String getArtifactText() throws NoOpenCoreException, SolrServerException{ + String indexedText = KeywordSearch.getServer().getSolrContent(this.objectId, 1); + if (indexedText == null) indexedText = ""; + indexedText = EscapeUtil.escapeHtml(indexedText).trim(); + StringBuilder sb = new StringBuilder(indexedText.length() + 20); + sb.append("
").append(indexedText).append("
"); //NON-NLS + + return sb.toString(); } } From 3c59ea12e99914357793470f920eef930dbb5f5b Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Wed, 17 Jan 2018 10:17:08 -0500 Subject: [PATCH 02/62] Cleanup --- .../autopsy/keywordsearch/AccountsText.java | 1 - .../keywordsearch/ExtractedContentViewer.java | 16 ++++++++-------- .../autopsy/keywordsearch/HighlightedText.java | 3 +-- .../sleuthkit/autopsy/keywordsearch/RawText.java | 1 - 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java index 812a16bbbf..995a267758 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java @@ -35,7 +35,6 @@ import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrRequest.METHOD; import org.apache.solr.client.solrj.response.QueryResponse; import org.openide.util.NbBundle; -import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Version; import org.sleuthkit.datamodel.BlackboardArtifact; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java index 27c5ae6b72..c8383f2e4c 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -56,7 +56,7 @@ import org.sleuthkit.datamodel.TskCoreException; @ServiceProvider(service = DataContentViewer.class, position = 4) public class ExtractedContentViewer implements DataContentViewer { - private static final Logger logger = Logger.getLogger(ExtractedContentViewer.class.getName()); + private static final Logger LOGGER = Logger.getLogger(ExtractedContentViewer.class.getName()); private static final long INVALID_DOCUMENT_ID = 0L; private static final BlackboardAttribute.Type TSK_ASSOCIATED_ARTIFACT_TYPE = new BlackboardAttribute.Type(TSK_ASSOCIATED_ARTIFACT); @@ -124,7 +124,7 @@ public class ExtractedContentViewer implements DataContentViewer { // if the artifact is an account artifact, get an account text . highlightedHitText = getAccountsText(content, nodeLookup); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Failed to create AccountsText for " + content, ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to create AccountsText for " + content, ex); //NON-NLS } } else if (artifact != null @@ -133,7 +133,7 @@ public class ExtractedContentViewer implements DataContentViewer { //if there is kwh artifact use that to construct the HighlightedText highlightedHitText = new HighlightedText(artifact); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Failed to create HighlightedText for " + artifact, ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to create HighlightedText for " + artifact, ex); //NON-NLS } } @@ -157,7 +157,7 @@ public class ExtractedContentViewer implements DataContentViewer { try { rawArtifactText = getRawArtifactText(nodeLookup); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error creating RawText for " + content, ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error creating RawText for " + content, ex); //NON-NLS } if (rawArtifactText != null) { @@ -294,7 +294,7 @@ public class ExtractedContentViewer implements DataContentViewer { return true; } } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting TSK_ACCOUNT_TYPE attribute from artifact " + art.getArtifactID(), ex); + LOGGER.log(Level.SEVERE, "Error getting TSK_ACCOUNT_TYPE attribute from artifact " + art.getArtifactID(), ex); } } else if (artifactTypeID == TSK_KEYWORD_HIT.getTypeID()) { return true; @@ -358,7 +358,7 @@ public class ExtractedContentViewer implements DataContentViewer { try { return solrServer.queryIsIndexed(objectId); } catch (NoOpenCoreException | KeywordSearchModuleException ex) { - logger.log(Level.SEVERE, "Error querying Solr server", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error querying Solr server", ex); //NON-NLS return false; } } @@ -392,7 +392,7 @@ public class ExtractedContentViewer implements DataContentViewer { return blackboardAttribute.getValueLong(); } } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting associated artifact attributes", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Error getting associated artifact attributes", ex); //NON-NLS } } } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java index 06f79de439..61dfcfcdc8 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java @@ -40,7 +40,6 @@ import org.apache.solr.client.solrj.SolrRequest.METHOD; import org.apache.solr.client.solrj.response.QueryResponse; import org.apache.solr.common.SolrDocumentList; import org.openide.util.NbBundle; -import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Version; import org.sleuthkit.autopsy.keywordsearch.KeywordQueryFilter.FilterType; @@ -468,7 +467,7 @@ class HighlightedText implements IndexedText { */ static String attemptManualHighlighting(SolrDocumentList solrDocumentList, String highlightField, Collection keywords) { if (solrDocumentList.isEmpty()) { - return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "document"); // DLG: + return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "document"); } // It doesn't make sense for there to be more than a single document in diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java index 25a32401ef..1f721f004c 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java @@ -21,7 +21,6 @@ package org.sleuthkit.autopsy.keywordsearch; import java.util.logging.Level; import org.apache.solr.client.solrj.SolrServerException; import org.openide.util.NbBundle; -import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.BlackboardArtifact; From 4cdf2b919efaed651f2c9f69917f71271cd60a4d Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Wed, 17 Jan 2018 10:21:53 -0500 Subject: [PATCH 03/62] Fixed log level. --- .../src/org/sleuthkit/autopsy/keywordsearch/RawText.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java index 1f721f004c..5d885feef3 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java @@ -204,11 +204,8 @@ class RawText implements IndexedText { } else { hasChunks = true; } - } catch (KeywordSearchModuleException ex) { - LOGGER.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS - - } catch (NoOpenCoreException ex) { - LOGGER.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS + } catch (KeywordSearchModuleException | NoOpenCoreException ex) { + LOGGER.log(Level.SEVERE, "Could not get number of chunks: ", ex); //NON-NLS } } From e6d269396dc46c572d928950846768d4c717075e Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Fri, 19 Jan 2018 01:07:51 -0500 Subject: [PATCH 04/62] Different message for known files. --- .../keywordsearch/ExtractedContentViewer.java | 1 + .../autopsy/keywordsearch/RawText.java | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java index c8383f2e4c..8f8ae75b8d 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java @@ -50,6 +50,7 @@ import org.sleuthkit.datamodel.TskCoreException; */ @Messages({ "ExtractedContentViewer.getText.error.msg=Error getting text.", + "ExtractedContentViewer.getSolrContent.knownFileMsg=

{0} is a known file (based on MD5 hash) and does not have text in the index.

", "ExtractedContentViewer.getSolrContent.noTxtYetMsg=

There is currently no text in the index for this {0}. It may have no text, it may not have been analyzed yet, there may have been an error extracting text, or keyword search was not enabled during ingest.

", "ExtractedContentViewer.getSolrContent.txtBodyItal={0}" }) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java index 5d885feef3..dc281ce100 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java @@ -23,8 +23,10 @@ import org.apache.solr.client.solrj.SolrServerException; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.Content; +import org.sleuthkit.datamodel.TskData; /** * A "source" for the extracted content viewer that displays "raw" (not @@ -231,7 +233,18 @@ class RawText implements IndexedText { //if no chunks, it is safe to assume there is no text content //because we are storing extracted text in chunks only //and the non-chunk stores meta-data only - String msg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "file"); + String msg = null; + + if (content instanceof AbstractFile) { + //we know it's AbstractFile, but do quick check to make sure if we index other objects in future + boolean isKnown = TskData.FileKnown.KNOWN.equals(((AbstractFile)content).getKnown()); + if (isKnown && KeywordSearchSettings.getSkipKnown()) { + msg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.knownFileMsg", content.getName()); + } + } + if(msg == null) { + msg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "file"); + } String htmlMsg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.txtBodyItal", msg); return htmlMsg; } @@ -247,7 +260,10 @@ class RawText implements IndexedText { //not cached String indexedText = solrServer.getSolrContent(this.objectId, chunkId); - if (indexedText == null) indexedText = ""; + if (indexedText == null || indexedText.isEmpty()) { + return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "file"); + } + cachedString = EscapeUtil.escapeHtml(indexedText).trim(); StringBuilder sb = new StringBuilder(cachedString.length() + 20); sb.append("
").append(cachedString).append("
"); //NON-NLS @@ -267,7 +283,10 @@ class RawText implements IndexedText { */ private String getArtifactText() throws NoOpenCoreException, SolrServerException{ String indexedText = KeywordSearch.getServer().getSolrContent(this.objectId, 1); - if (indexedText == null) indexedText = ""; + if (indexedText == null || indexedText.isEmpty()) { + return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "artifact"); + } + indexedText = EscapeUtil.escapeHtml(indexedText).trim(); StringBuilder sb = new StringBuilder(indexedText.length() + 20); sb.append("
").append(indexedText).append("
"); //NON-NLS From c4bb6dba614753e83cc87c20ca3f67729a0d0ec3 Mon Sep 17 00:00:00 2001 From: Raman Date: Fri, 19 Jan 2018 13:01:08 -0500 Subject: [PATCH 05/62] 3415: Show SQLite table contents - First cut. --- .../autopsy/contentviewers/Bundle.properties | 8 +- .../contentviewers/SQLiteTableRowFactory.java | 89 ++++++ .../contentviewers/SQLiteTableView.form | 34 ++ .../contentviewers/SQLiteTableView.java | 143 +++++++++ .../autopsy/contentviewers/SQLiteViewer.form | 189 +++++++---- .../autopsy/contentviewers/SQLiteViewer.java | 299 +++++++++++++----- 6 files changed, 619 insertions(+), 143 deletions(-) create mode 100644 Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java create mode 100644 Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form create mode 100644 Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties index 8267587395..68e938a107 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/Bundle.properties @@ -35,5 +35,11 @@ MessageContentViewer.attachmentsPanel.TabConstraints.tabTitle=Attachments MessageContentViewer.viewInNewWindowButton.text=View in New Window JPEGViewerDummy.jLabel1.text=You are looking at a JPEG file: JPEGViewerDummy.jTextField1.text=jTextField1 -SQLiteViewer.jLabel1.text=Table +SQLiteViewer.nextPageButton.text= +SQLiteViewer.prevPageButton.text= +SQLiteViewer.numPagesLabel.text=N +SQLiteViewer.jLabel3.text=of +SQLiteViewer.currPageLabel.text=x +SQLiteViewer.jLabel2.text=Page SQLiteViewer.numEntriesField.text=num Entries +SQLiteViewer.jLabel1.text=Table diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java new file mode 100644 index 0000000000..98b21149ce --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java @@ -0,0 +1,89 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2018 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.contentviewers; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.ChildFactory; +import org.openide.nodes.Children; +import org.openide.nodes.Node; +import org.openide.nodes.Sheet; +import org.sleuthkit.autopsy.datamodel.NodeProperty; + +public class SQLiteTableRowFactory extends ChildFactory { + + private final ArrayList> rows; + + public SQLiteTableRowFactory(ArrayList> rows) { + this.rows = rows; + } + + @Override + protected boolean createKeys(List keys) { + if (rows != null) { + for (int i = 0; i < rows.size(); i++) { + keys.add(i); + } + } + return true; + } + + @Override + protected Node createNodeForKey(Integer key) { + if (Objects.isNull(rows) || rows.isEmpty() || key >= rows.size()) { + return null; + } + + return new SQLiteTableRowNode(rows.get(key)); + } + +} + +class SQLiteTableRowNode extends AbstractNode { + + private final Map row; + + public SQLiteTableRowNode(Map row) { + super(Children.LEAF); + this.row = row; + } + + @Override + protected Sheet createSheet() { + + Sheet s = super.createSheet(); + Sheet.Set properties = s.get(Sheet.PROPERTIES); + if (properties == null) { + properties = Sheet.createPropertiesSet(); + s.put(properties); + } + + for (Map.Entry col : row.entrySet()) { + String colName = col.getKey(); + String colVal = col.getValue().toString(); + + properties.put(new NodeProperty<>(colName, colName, colName, colVal)); // NON-NLS + } + + return s; + } +} diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form new file mode 100644 index 0000000000..a34fd71d16 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form @@ -0,0 +1,34 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java new file mode 100644 index 0000000000..b2fdc912d5 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java @@ -0,0 +1,143 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2018 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.contentviewers; + +import java.util.ArrayList; +import java.util.Map; +import java.util.Objects; +import javax.swing.ListSelectionModel; +import javax.swing.table.TableColumnModel; +import org.netbeans.swing.etable.ETableColumn; +import org.netbeans.swing.etable.ETableColumnModel; +import org.netbeans.swing.outline.Outline; +import org.openide.explorer.ExplorerManager; +import org.openide.nodes.AbstractNode; +import org.openide.nodes.Children; + + +public class SQLiteTableView extends javax.swing.JPanel implements ExplorerManager.Provider { + + private final Outline outline; + private final org.openide.explorer.view.OutlineView outlineView; + private ExplorerManager explorerManager; + + private final ArrayList> tableRows; + + /** + * Creates new form SQLiteTableView + * @param rows + */ + public SQLiteTableView(ArrayList> rows) { + + this.tableRows = rows; + + outlineView = new org.openide.explorer.view.OutlineView(); + + initComponents(); + + outline = outlineView.getOutline(); + outlineView.setPropertyColumns(); // column headers will be set later + outline.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + + customize(); + } + + private void customize() { + + tableScrollPane.setViewportView(outlineView); + this.setVisible(true); + outline.setRowSelectionAllowed(false); + outline.setRootVisible(false); + + explorerManager = new ExplorerManager(); + explorerManager.setRootContext(new AbstractNode(Children.create(new SQLiteTableRowFactory(tableRows), true))); + + setupColumns(); + } + + /** + * Sets up the columns in the display table + */ + private void setupColumns() { + if (Objects.isNull(tableRows) || tableRows.isEmpty()) + return; + + Map row = tableRows.get(0); + + // Get the columns setup with respect to names and sortability + String[] propStrings = new String[row.size() * 2]; + + int i = 0; + for (Map.Entry col: row.entrySet()) { + String colName = col.getKey(); + propStrings[2 * i] = colName; + propStrings[2 * i + 1] = colName; + i++; + } + + + outlineView.setPropertyColumns(propStrings); + + // RAMAN TBD: Set width based on actual data in the top N rows?? + // TBD: Cant seem to geta horizontal scroll bar + for (int col = 0; col< outline.getModel().getColumnCount(); col++) { + outline.getColumnModel().getColumn(col).setMinWidth(50); + } + + // Hide the 'Nodes' column + TableColumnModel columnModel = outline.getColumnModel(); + ETableColumn column = (ETableColumn) columnModel.getColumn(0); + ((ETableColumnModel) columnModel).setColumnHidden(column, true); + + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + tableScrollPane = new javax.swing.JScrollPane(); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(tableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(tableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) + ); + }// //GEN-END:initComponents + + + + @Override + public ExplorerManager getExplorerManager() { + return explorerManager; + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JScrollPane tableScrollPane; + // End of variables declaration//GEN-END:variables +} diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.form b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.form index 3cdee8658c..121a96c823 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.form +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.form @@ -1,6 +1,6 @@ -
+ @@ -16,22 +16,27 @@ - - + + - - - + + + + + + + + @@ -39,11 +44,23 @@ - + - + - + + + + + + + + + + + + + @@ -55,8 +72,14 @@ + + + + + + - + @@ -97,57 +120,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java index fff2f5d781..a60037fad1 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java @@ -1,21 +1,4 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2018 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. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + package org.sleuthkit.autopsy.contentviewers; import java.awt.Component; @@ -27,12 +10,17 @@ import java.util.logging.Level; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; +import java.sql.ResultSetMetaData; import java.sql.Statement; import java.sql.SQLException; +import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.Map; +import java.util.Objects; import java.util.TreeMap; import java.util.concurrent.ExecutionException; import javax.swing.JComboBox; +import javax.swing.JPanel; import javax.swing.SwingWorker; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; @@ -44,20 +32,21 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { public static final String[] SUPPORTED_MIMETYPES = new String[]{"application/x-sqlite3"}; private static final Logger LOGGER = Logger.getLogger(FileViewer.class.getName()); private Connection connection = null; - + private String tmpDBPathName = null; private File tmpDBFile = null; - // TBD: Change the value to be a Array of ColDefs Map dbTablesMap = new TreeMap<>(); + private static final int ROWS_PER_PAGE = 100; + private int numRows; // num of rows in the selected table + private int currPage = 0; // curr page of rows being displayed + /** * Creates new form SQLiteViewer */ public SQLiteViewer() { initComponents(); - - customizeComponents(); } /** @@ -73,9 +62,15 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { tablesDropdownList = new javax.swing.JComboBox<>(); jLabel1 = new javax.swing.JLabel(); numEntriesField = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + currPageLabel = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + numPagesLabel = new javax.swing.JLabel(); + prevPageButton = new javax.swing.JButton(); + nextPageButton = new javax.swing.JButton(); jTableDataPanel = new javax.swing.JPanel(); - jScrollPane1 = new javax.swing.JScrollPane(); - jTable1 = new javax.swing.JTable(); + + jHdrPanel.setPreferredSize(new java.awt.Dimension(536, 40)); tablesDropdownList.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); tablesDropdownList.addActionListener(new java.awt.event.ActionListener() { @@ -89,9 +84,38 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { numEntriesField.setEditable(false); numEntriesField.setText(org.openide.util.NbBundle.getMessage(SQLiteViewer.class, "SQLiteViewer.numEntriesField.text")); // NOI18N numEntriesField.setBorder(null); - numEntriesField.addActionListener(new java.awt.event.ActionListener() { + + org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(SQLiteViewer.class, "SQLiteViewer.jLabel2.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(currPageLabel, org.openide.util.NbBundle.getMessage(SQLiteViewer.class, "SQLiteViewer.currPageLabel.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(jLabel3, org.openide.util.NbBundle.getMessage(SQLiteViewer.class, "SQLiteViewer.jLabel3.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(numPagesLabel, org.openide.util.NbBundle.getMessage(SQLiteViewer.class, "SQLiteViewer.numPagesLabel.text")); // NOI18N + + prevPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(prevPageButton, org.openide.util.NbBundle.getMessage(SQLiteViewer.class, "SQLiteViewer.prevPageButton.text")); // NOI18N + prevPageButton.setBorderPainted(false); + prevPageButton.setContentAreaFilled(false); + prevPageButton.setDisabledSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png"))); // NOI18N + prevPageButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); + prevPageButton.setPreferredSize(new java.awt.Dimension(23, 23)); + prevPageButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - numEntriesFieldActionPerformed(evt); + prevPageButtonActionPerformed(evt); + } + }); + + nextPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(nextPageButton, org.openide.util.NbBundle.getMessage(SQLiteViewer.class, "SQLiteViewer.nextPageButton.text")); // NOI18N + nextPageButton.setBorderPainted(false); + nextPageButton.setContentAreaFilled(false); + nextPageButton.setDisabledSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png"))); // NOI18N + nextPageButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); + nextPageButton.setPreferredSize(new java.awt.Dimension(23, 23)); + nextPageButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + nextPageButtonActionPerformed(evt); } }); @@ -102,11 +126,23 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { .addGroup(jHdrPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tablesDropdownList, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(23, 23, 23) + .addGap(18, 18, 18) .addComponent(numEntriesField, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(130, Short.MAX_VALUE)) + .addGap(15, 15, 15) + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(currPageLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(numPagesLabel) + .addGap(18, 18, 18) + .addComponent(prevPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0) + .addComponent(nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(133, Short.MAX_VALUE)) ); jHdrPanelLayout.setVerticalGroup( jHdrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -115,40 +151,18 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { .addGroup(jHdrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tablesDropdownList, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1) - .addComponent(numEntriesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(16, Short.MAX_VALUE)) - ); - - jTable1.setModel(new javax.swing.table.DefaultTableModel( - new Object [][] { - {null, null, null, null}, - {null, null, null, null}, - {null, null, null, null}, - {null, null, null, null} - }, - new String [] { - "Title 1", "Title 2", "Title 3", "Title 4" - } - )); - jScrollPane1.setViewportView(jTable1); - - javax.swing.GroupLayout jTableDataPanelLayout = new javax.swing.GroupLayout(jTableDataPanel); - jTableDataPanel.setLayout(jTableDataPanelLayout); - jTableDataPanelLayout.setHorizontalGroup( - jTableDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jTableDataPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) - .addGap(15, 15, 15)) - ); - jTableDataPanelLayout.setVerticalGroup( - jTableDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jTableDataPanelLayout.createSequentialGroup() - .addContainerGap() - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE) + .addComponent(numEntriesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2) + .addComponent(currPageLabel) + .addComponent(jLabel3) + .addComponent(numPagesLabel) + .addComponent(nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(prevPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap()) ); + jTableDataPanel.setLayout(new javax.swing.OverlayLayout(jTableDataPanel)); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( @@ -159,15 +173,39 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() - .addComponent(jHdrPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jTableDataPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(jHdrPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, 0) + .addComponent(jTableDataPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE)) ); }// //GEN-END:initComponents - private void numEntriesFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_numEntriesFieldActionPerformed - // TODO add your handling code here: - }//GEN-LAST:event_numEntriesFieldActionPerformed + private void nextPageButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextPageButtonActionPerformed + + currPage++; + if (currPage * ROWS_PER_PAGE > numRows) { + nextPageButton.setEnabled(false); + } + currPageLabel.setText(Integer.toString(currPage)); + prevPageButton.setEnabled(true); + + // read and display a page of rows + String tableName = (String) this.tablesDropdownList.getSelectedItem(); + readTable(tableName, (currPage - 1) * ROWS_PER_PAGE + 1, ROWS_PER_PAGE); + }//GEN-LAST:event_nextPageButtonActionPerformed + + private void prevPageButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_prevPageButtonActionPerformed + + currPage--; + if (currPage == 1) { + prevPageButton.setEnabled(false); + } + currPageLabel.setText(Integer.toString(currPage)); + nextPageButton.setEnabled(true); + + // read and display a page of rows + String tableName = (String) this.tablesDropdownList.getSelectedItem(); + readTable(tableName, (currPage - 1) * ROWS_PER_PAGE + 1, ROWS_PER_PAGE); + }//GEN-LAST:event_prevPageButtonActionPerformed private void tablesDropdownListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tablesDropdownListActionPerformed JComboBox cb = (JComboBox) evt.getSource(); @@ -176,17 +214,21 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { return; } - readTable(tableName); + selectTable(tableName); }//GEN-LAST:event_tablesDropdownListActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel currPageLabel; private javax.swing.JPanel jHdrPanel; private javax.swing.JLabel jLabel1; - private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JTable jTable1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; private javax.swing.JPanel jTableDataPanel; + private javax.swing.JButton nextPageButton; private javax.swing.JTextField numEntriesField; + private javax.swing.JLabel numPagesLabel; + private javax.swing.JButton prevPageButton; private javax.swing.JComboBox tablesDropdownList; // End of variables declaration//GEN-END:variables @@ -209,11 +251,11 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { public void resetComponent() { dbTablesMap.clear(); - + tablesDropdownList.setEnabled(true); tablesDropdownList.removeAllItems(); numEntriesField.setText(""); - + // close DB connection to file if (null != connection) { try { @@ -231,11 +273,6 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { } } - private void customizeComponents() { - - // add a actionListener to jTablesComboBox - } - /** * Process the given SQLite DB file * @@ -327,30 +364,26 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { // RAMAN TBD: parse and save the table schema } - } catch (Exception ex) { + } catch (SQLException ex) { LOGGER.log(Level.WARNING, "Error while trying to get columns from sqlite db." + connection, ex); //NON-NLS } } - } catch (Exception e) { + } catch (SQLException e) { LOGGER.log(Level.SEVERE, "Error getting table names from the DB", e); //NON-NLS } return true; } - private void readTable(String tableName) { - // TBD: need to handle cancelling if one is already in progress - - new SwingWorker() { + private void selectTable(String tableName) { + new SwingWorker() { @Override protected Integer doInBackground() throws Exception { try { Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery( - "SELECT COUNT(*) as count FROM " + tableName); //NON-NLS + "SELECT count (*) as count FROM " + tableName); //NON-NLS - // TBD: read the rows here and popluate the ExplorerManager. - return resultSet.getInt("count"); } catch (SQLException ex) { LOGGER.log(Level.SEVERE, "Failed to get data for table.", ex); //NON-NLS @@ -363,8 +396,70 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { protected void done() { super.done(); try { - int numRows = get(); + + numRows = get(); numEntriesField.setText(numRows + " entries"); + + currPage = 1; + currPageLabel.setText(Integer.toString(currPage)); + numPagesLabel.setText(Integer.toString((numRows/ROWS_PER_PAGE)+1)); + + prevPageButton.setEnabled(false); + + jTableDataPanel.removeAll(); + jTableDataPanel.repaint(); + + if (numRows > 0) { + nextPageButton.setEnabled(((numRows > ROWS_PER_PAGE))); + readTable(tableName, (currPage-1)*ROWS_PER_PAGE + 1, ROWS_PER_PAGE); + } + else { + nextPageButton.setEnabled(false); + } + + + } catch (InterruptedException | ExecutionException ex) { + LOGGER.log(Level.SEVERE, "Unexpected exception while reading table.", ex); //NON-NLS + } + } + }.execute(); + } + private void readTable(String tableName, int startRow, int numRowsToRead) { + + // TBD: need to handle cancelling if one is already in progress + + new SwingWorker>, Void>() { + @Override + protected ArrayList> doInBackground() throws Exception { + try { + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery( + "SELECT * FROM " + tableName + + " LIMIT " + Integer.toString(numRowsToRead) + + " OFFSET " + Integer.toString(startRow - 1) + ); //NON-NLS + + return resultSetToArrayList(resultSet); + } catch (SQLException ex) { + LOGGER.log(Level.SEVERE, "Failed to get data for table.", ex); //NON-NLS + } + //NON-NLS + return null; + } + + @Override + protected void done() { + super.done(); + try { + ArrayList> rows = get(); + if (Objects.nonNull(rows)) { + JPanel selectedTableView = new SQLiteTableView(rows); + + jTableDataPanel.removeAll(); + jTableDataPanel.setLayout(new javax.swing.OverlayLayout(jTableDataPanel)); + jTableDataPanel.add(selectedTableView); + jTableDataPanel.repaint(); + } } catch (InterruptedException | ExecutionException ex) { LOGGER.log(Level.SEVERE, "Unexpected exception while reading table.", ex); //NON-NLS } @@ -373,6 +468,29 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { } + private ArrayList> resultSetToArrayList(ResultSet rs) throws SQLException { + ResultSetMetaData md = rs.getMetaData(); + int columns = md.getColumnCount(); + ArrayList> arraylist = new ArrayList<>(); + while (rs.next()) { + Map row = new LinkedHashMap<>(columns); + for (int i = 1; i <= columns; ++i) { + if (rs.getObject(i) == null) { + row.put(md.getColumnName(i), ""); + } else { + if (md.getColumnTypeName(i).compareToIgnoreCase("blob") == 0) { + row.put(md.getColumnName(i), "BLOB Data not shown..."); + } else { + row.put(md.getColumnName(i), rs.getObject(i)); + } + } + } + arraylist.add(row); + } + + return arraylist; + } + enum SQLStorageClass { NULL, INTEGER, @@ -390,6 +508,13 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { this.colName = colName; this.storageClass = sc; } - + + public String getColName() { + return colName; + } + + public SQLStorageClass getColStorageClass() { + return storageClass; + } } } From b8d9efb181ffb99b59eed5e0007afd6b88ae5ef2 Mon Sep 17 00:00:00 2001 From: Raman Date: Mon, 22 Jan 2018 10:19:06 -0500 Subject: [PATCH 06/62] Fixing scrollbar on the SQLiteTableView. - Removes the doubles vertical scroll bar. - A horizontal scroll bar appears but it is disabled and not functional --- .../contentviewers/SQLiteTableView.form | 25 +++++------------ .../contentviewers/SQLiteTableView.java | 28 ++++++++----------- 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form index a34fd71d16..75cb61a443 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form @@ -1,6 +1,11 @@
+ + + + + @@ -11,24 +16,8 @@ + - - - - - - - - - - - - - - - - - - + diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java index b2fdc912d5..dc5d6c97af 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java @@ -18,6 +18,7 @@ */ package org.sleuthkit.autopsy.contentviewers; +import java.awt.BorderLayout; import java.util.ArrayList; import java.util.Map; import java.util.Objects; @@ -48,9 +49,12 @@ public class SQLiteTableView extends javax.swing.JPanel implements ExplorerManag this.tableRows = rows; outlineView = new org.openide.explorer.view.OutlineView(); - + outlineView.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); + initComponents(); + add(outlineView,BorderLayout.CENTER); + outline = outlineView.getOutline(); outlineView.setPropertyColumns(); // column headers will be set later outline.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); @@ -60,11 +64,12 @@ public class SQLiteTableView extends javax.swing.JPanel implements ExplorerManag private void customize() { - tableScrollPane.setViewportView(outlineView); + //tableScrollPane.setViewportView(outlineView); + this.setVisible(true); outline.setRowSelectionAllowed(false); outline.setRootVisible(false); - + explorerManager = new ExplorerManager(); explorerManager.setRootContext(new AbstractNode(Children.create(new SQLiteTableRowFactory(tableRows), true))); @@ -95,7 +100,7 @@ public class SQLiteTableView extends javax.swing.JPanel implements ExplorerManag outlineView.setPropertyColumns(propStrings); // RAMAN TBD: Set width based on actual data in the top N rows?? - // TBD: Cant seem to geta horizontal scroll bar + // TBD: Can't seem to geta horizontal scroll bar for (int col = 0; col< outline.getModel().getColumnCount(); col++) { outline.getColumnModel().getColumn(col).setMinWidth(50); } @@ -116,18 +121,8 @@ public class SQLiteTableView extends javax.swing.JPanel implements ExplorerManag // //GEN-BEGIN:initComponents private void initComponents() { - tableScrollPane = new javax.swing.JScrollPane(); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(tableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(tableScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) - ); + setPreferredSize(new java.awt.Dimension(600, 400)); + setLayout(new java.awt.BorderLayout()); }// //GEN-END:initComponents @@ -138,6 +133,5 @@ public class SQLiteTableView extends javax.swing.JPanel implements ExplorerManag } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JScrollPane tableScrollPane; // End of variables declaration//GEN-END:variables } From 71c510c4916d0267a6515bacb2c7c0e410a2afb1 Mon Sep 17 00:00:00 2001 From: Raman Date: Mon, 22 Jan 2018 13:39:02 -0500 Subject: [PATCH 07/62] 3415: Show SQLite table contents. - Cleanup --- .../contentviewers/SQLiteTableView.java | 4 +- .../autopsy/contentviewers/SQLiteViewer.java | 80 ++++++++----------- 2 files changed, 35 insertions(+), 49 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java index dc5d6c97af..c795133f73 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java @@ -99,8 +99,8 @@ public class SQLiteTableView extends javax.swing.JPanel implements ExplorerManag outlineView.setPropertyColumns(propStrings); - // RAMAN TBD: Set width based on actual data in the top N rows?? - // TBD: Can't seem to geta horizontal scroll bar + // TBD: Set width based on actual data in the top N rows?? + // TBD: Can't seem to get the horizontal scrollbar working for (int col = 0; col< outline.getModel().getColumnCount(); col++) { outline.getColumnModel().getColumn(col).setMinWidth(50); } diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java index a60037fad1..5d90562834 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java @@ -1,3 +1,21 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2018 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.sleuthkit.autopsy.contentviewers; @@ -42,6 +60,7 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { private int numRows; // num of rows in the selected table private int currPage = 0; // curr page of rows being displayed + private SwingWorker>, Void> worker; /** * Creates new form SQLiteViewer */ @@ -352,21 +371,6 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { String tableSQL = resultSet.getString("sql"); //NON-NLS dbTablesMap.put(tableName, tableSQL); - String query = "PRAGMA table_info(" + tableName + ")"; //NON-NLS - ResultSet rs2; - try { - Statement statement2 = connection.createStatement(); - rs2 = statement2.executeQuery(query); - while (rs2.next()) { - - // System.out.println("RAMAN: Col Name = " + rs2.getString("name")); - // System.out.println("RAMAN: Col Type = " + rs2.getString("type")); - - // RAMAN TBD: parse and save the table schema - } - } catch (SQLException ex) { - LOGGER.log(Level.WARNING, "Error while trying to get columns from sqlite db." + connection, ex); //NON-NLS - } } } catch (SQLException e) { LOGGER.log(Level.SEVERE, "Error getting table names from the DB", e); //NON-NLS @@ -426,9 +430,12 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { } private void readTable(String tableName, int startRow, int numRowsToRead) { - // TBD: need to handle cancelling if one is already in progress - - new SwingWorker>, Void>() { + if (worker != null && !worker.isDone()) { + worker.cancel(false); + worker = null; + } + + worker = new SwingWorker>, Void>() { @Override protected ArrayList> doInBackground() throws Exception { try { @@ -449,6 +456,11 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { @Override protected void done() { + + if (isCancelled()) { + return; + } + super.done(); try { ArrayList> rows = get(); @@ -464,8 +476,9 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { LOGGER.log(Level.SEVERE, "Unexpected exception while reading table.", ex); //NON-NLS } } - }.execute(); - + }; + + worker.execute(); } private ArrayList> resultSetToArrayList(ResultSet rs) throws SQLException { @@ -490,31 +503,4 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { return arraylist; } - - enum SQLStorageClass { - NULL, - INTEGER, - REAL, - TEXT, - BLOB - }; - - private class SQLColDef { - - private final String colName; - private final SQLStorageClass storageClass; - - SQLColDef(String colName, SQLStorageClass sc) { - this.colName = colName; - this.storageClass = sc; - } - - public String getColName() { - return colName; - } - - public SQLStorageClass getColStorageClass() { - return storageClass; - } - } } From 3af2bb74294fa0d42bdde773a2ce5adee15079e4 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 23 Jan 2018 11:29:06 -0500 Subject: [PATCH 08/62] 3485 Open Case Folder moved to case menu, tools menu reordered --- Core/src/org/sleuthkit/autopsy/actions/Bundle.properties | 8 ++++---- .../sleuthkit/autopsy/actions/OpenOutputFolderAction.java | 8 ++++---- Core/src/org/sleuthkit/autopsy/core/layer.xml | 6 +++--- .../autoingest/AutoIngestDashboardOpenAction.java | 5 +++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/actions/Bundle.properties b/Core/src/org/sleuthkit/autopsy/actions/Bundle.properties index 1cbc4b70b6..84f64f3190 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/actions/Bundle.properties @@ -36,10 +36,10 @@ GetTagNameDialog.tagNameExistsTskCore.msg=The {0} tag name already exists in the OpenLogFolder.error1=Log File Not Found: {0} OpenLogFolder.CouldNotOpenLogFolder=Could not open log folder CTL_OpenLogFolder=Open Log Folder -CTL_OpenOutputFolder=Open Output Folder -OpenOutputFolder.error1=Output Folder Not Found\: {0} -OpenOutputFolder.noCaseOpen=No open case, therefore no current output folder available. -OpenOutputFolder.CouldNotOpenOutputFolder=Could not open output folder +CTL_OpenOutputFolder=Open Case Folder +OpenOutputFolder.error1=Case Output Folder Not Found\: {0} +OpenOutputFolder.noCaseOpen=No open case, therefore no current case output folder available. +OpenOutputFolder.CouldNotOpenOutputFolder=Could not open case output folder ShowIngestProgressSnapshotAction.actionName.text=Get Ingest Progress Snapshot OpenPythonModulesFolderAction.actionName.text=Python Plugins OpenPythonModulesFolderAction.errorMsg.folderNotFound=Python plugins folder not found: {0} diff --git a/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java b/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java index c3477859e6..24370b5a73 100644 --- a/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java +++ b/Core/src/org/sleuthkit/autopsy/actions/OpenOutputFolderAction.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -35,7 +35,7 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; /** - * The action associated with the Tools/Open Output Folder menu item. It opens a + * The action associated with the Tools/Open Case Folder menu item. It opens a * file explorer window for the root output directory for the currently open * case. If the case is a single-user case, this is the case directory. If the * case is a multi-user case, this is a subdirectory of the case directory @@ -44,7 +44,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; * This action should only be invoked in the event dispatch thread (EDT). */ @ActionRegistration(displayName = "#CTL_OpenOutputFolder", iconInMenu = true, lazy = false) -@ActionReference(path = "Menu/Tools", position = 1850, separatorBefore = 1849) +@ActionReference(path = "Menu/Case", position = 302) @ActionID(id = "org.sleuthkit.autopsy.actions.OpenOutputFolderAction", category = "Help") public final class OpenOutputFolderAction extends CallableSystemAction { @@ -61,7 +61,7 @@ public final class OpenOutputFolderAction extends CallableSystemAction { try { Desktop.getDesktop().open(outputDir); } catch (IOException ex) { - logger.log(Level.SEVERE, String.format("Failed to open output folder %s", outputDir), ex); //NON-NLS + logger.log(Level.SEVERE, String.format("Failed to open case output folder %s", outputDir), ex); //NON-NLS NotifyDescriptor descriptor = new NotifyDescriptor.Message( NbBundle.getMessage(this.getClass(), "OpenOutputFolder.CouldNotOpenOutputFolder", outputDir.getAbsolutePath()), NotifyDescriptor.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(descriptor); diff --git a/Core/src/org/sleuthkit/autopsy/core/layer.xml b/Core/src/org/sleuthkit/autopsy/core/layer.xml index 465529fa9f..fa78fe5485 100644 --- a/Core/src/org/sleuthkit/autopsy/core/layer.xml +++ b/Core/src/org/sleuthkit/autopsy/core/layer.xml @@ -198,10 +198,10 @@ - + - + @@ -213,7 +213,7 @@ --> - + diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java index 45563a4f4b..f299fbc5a3 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestDashboardOpenAction.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2017 Basis Technology Corp. + * Copyright 2017-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,13 +28,14 @@ import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.coreutils.Logger; @ActionID(category = "Tools", id = "org.sleuthkit.autopsy.experimental.autoingest.AutoIngestDashboardOpenAction") -@ActionReference(path = "Menu/Tools", position = 104) +@ActionReference(path = "Menu/Tools", position = 201) @ActionRegistration(displayName = "#CTL_AutoIngestDashboardOpenAction", lazy = false) @Messages({"CTL_AutoIngestDashboardOpenAction=Auto Ingest Dashboard"}) public final class AutoIngestDashboardOpenAction extends CallableSystemAction { private static final Logger LOGGER = Logger.getLogger(AutoIngestDashboardOpenAction.class.getName()); private static final String DISPLAY_NAME = Bundle.CTL_AutoIngestDashboardOpenAction(); + private static final long serialVersionUID = 1L; @Override public boolean isEnabled() { From 75f6198190266102e433e589dcc9c2e2a42b6e5c Mon Sep 17 00:00:00 2001 From: Raman Date: Tue, 23 Jan 2018 13:33:03 -0500 Subject: [PATCH 09/62] Fixed a warning. --- Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java index 5d90562834..6442b645d1 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java @@ -227,7 +227,7 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { }//GEN-LAST:event_prevPageButtonActionPerformed private void tablesDropdownListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tablesDropdownListActionPerformed - JComboBox cb = (JComboBox) evt.getSource(); + JComboBox cb = (JComboBox) evt.getSource(); String tableName = (String) cb.getSelectedItem(); if (null == tableName) { return; From fb580e2bffb8ffa1471ac245ab1417df96c20ff7 Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Tue, 23 Jan 2018 14:53:54 -0500 Subject: [PATCH 10/62] Added page documenting the Live Triage function --- docs/doxygen-user/images/live_triage_case.png | Bin 0 -> 26594 bytes .../images/live_triage_dialog.png | Bin 0 -> 17794 bytes docs/doxygen-user/images/live_triage_ds.png | Bin 0 -> 39635 bytes .../images/live_triage_script.png | Bin 0 -> 12839 bytes docs/doxygen-user/live_triage.dox | 33 ++++++++++++++++++ docs/doxygen-user/main.dox | 1 + 6 files changed, 34 insertions(+) create mode 100644 docs/doxygen-user/images/live_triage_case.png create mode 100644 docs/doxygen-user/images/live_triage_dialog.png create mode 100644 docs/doxygen-user/images/live_triage_ds.png create mode 100644 docs/doxygen-user/images/live_triage_script.png create mode 100644 docs/doxygen-user/live_triage.dox diff --git a/docs/doxygen-user/images/live_triage_case.png b/docs/doxygen-user/images/live_triage_case.png new file mode 100644 index 0000000000000000000000000000000000000000..fee49485f5cb23e3a5d06c5304fa7dff4c91f06c GIT binary patch literal 26594 zcmeFZbyOT**Cxs@Bq0eFf?Jb7@Zj!AXdt+|yF;LHX+m%d!5xBYLvZ)t?(S}l(>S-t z`_0Vz-Sy4fnY-?vcdbrQU3IGJ)H!GG{p{!2ogg_GG4xkNuaJk$>Oc5cJh+6C7x_p?Z;`~o zpOjo?_ZQqfNQ@hWjtb%wfn}YOJwEs z2@5IGoIO+n8>i6oXZ7XfL;P&Do)*4izwp~V{G0Fx*uYLS9_y#q{U)cL zh=pqNv7AJ%!4>9zkdRuUOYblC9o=|M5kZ zFK5QkafMtT(jMZbO-kxlDAfIyj8O6Ew?GjA8>#Oov-@w?6vOLn?$&dgD@201GiVAX zb}76rD`~FB1j|%#YBj=2sDQ_!ZDNLdAX)=BONMTt21x>wm*Jkk0o{u`i=&CpYg#OO z0;7^dVVmV?w|^cQudef}yo$fDT{VDWBnAlh7N7<_6R3oS7L~#Jv9BL*w>#>0notcr zv+pAgvgSO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b/docs/doxygen-user/images/live_triage_ds.png new file mode 100644 index 0000000000000000000000000000000000000000..f21a50aa82317547361a10f34ee02e5b34512221 GIT binary patch literal 39635 zcmaI71yqz#*9JP2C?MS}DJ@+BA`Q~rNJ=*&IfBw%(jYC}-AZ>O-Ce=}Lv!Ep`~JJu zzwW>8ti@tZ?K$s>y`R1J^Maj^#@!|13i$WJ zNmkbt1VYDy{~>@<(}{sfR5v+ADbx)FB0OBe%lasM5QrKiCn>J+dEsaoVxXb6vgtwn5FML6S#J~+X?kYCPtfc}e<$;l3N|{Nk%b`^=p#Y}{mbcklHxkn=3=?x zI@+|$75rNqm=*{mg1-+H;^ie^M1hyK9`9D4Jlx$=J`{91o7>nNe0zb%XZI&2Ia$DB z5I>y*-UnMSV|0{*Vs06h>uUd0nL1)hgV$H5uC5Nb-=x~z+M4$Li!us4AP97=zA6M= zrGhm3ID`?)%Rj{8F?{GB7?{85N{S#J#rfBT`*9@wM^tpPum5$NAbHgE^z=(IKJtUq zZ#78p_H4ygCWm?OrXoZ9G*wD+^5@2pC@6ffLD}v&;SmvZu*NG*ZNna7LJ++6%gKhU zzj7+i0G^Drl$6w);Rs}St%JeZB;HuF*mGJ0p!fsqY>qsN4txW-5y^0^3UGBd^6jQ` zdhATk1=|;VBXb}$Zl3D6zDRxuS0^9$^ zl>F%)@ZXg6zw3=%CMDp#;@}XmN)y>F&nm^1kQT?5jv%f&j9h&YpzgfPD!xW5y(R`< z8k3mTvkSZ-?cE|xvC~!4w8*EW+Y7w#`bP#gzMDpm@kd!_b#wErUxE#gi*@hdvZu^) z*`sDBQ5sWZvm>2g>%kd35;Iz9$v4B*@CPJjWsHUtr9LdHA5&d8Ru#{$`kq`Tb!{|* zptQ6!%_MW8H;HD`^A$Vv%;2L^UA+q^PAsiVM2Nu6WoXUrn2eC>OSP=6oy2VVjo$fdbzqOad<+uKct3|yL=}qzl}wm6e<OU+`q$J5slsezd3^K}NPt zw|;+C6)!64`&ev^Mq}#FUVC$~?3D`p^^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T+Ci)^8J~%h< zL3kMake Live Triage Drive to bring up the main dialog. + +\image html live_triage_dialog.png + +Select the drive you want to use - any type of USB storage device will work. For best results use the fastest drive available. Once the process is complete the root folder will contain an Autopsy folder and a RunFromUSB.bat file. + +\section live_triage_usage Running Autopsy from the live triage drive + +Insert the drive into the target machine and browse to it in Windows Explorer. Right click on RunFromUSB.bat and select "Run as administrator". This is necessary to analyze the local drives. + +\image html live_triage_script.png + +Running the script will generate a few more directories on the USB drive. configData stores all the data used by Autopsy - primarily configuration files and temporary files. You can make changes to the Autopsy settings and they will persist between runs. The cases directory is created as a recommended place to save your case data. You will need to browse to it when creating a case in Autopsy. + +Once Autopsy is running, proceed to create a case as normal, making sure to save it on the USB drive. + +\image html live_triage_case.png + +Then choose the Local Disk data source and select the desired drive. + +\image html live_triage_ds.png + +See the \ref ds_local page for more information on local disk data sources. + +*/ \ No newline at end of file diff --git a/docs/doxygen-user/main.dox b/docs/doxygen-user/main.dox index e4a1e2b3a9..a72256c7f6 100644 --- a/docs/doxygen-user/main.dox +++ b/docs/doxygen-user/main.dox @@ -60,6 +60,7 @@ The following topics are available here: - \subpage windows_authentication - \subpage multiuser_sec_page - \subpage multiuser_page +- \subpage live_triage_page - \subpage advanced_page If the topic you need is not listed, refer to the Autopsy Wiki or join the SleuthKit User List at SourceForge. From 6b02ab135864fff8ca223cab11743a95a849aafc Mon Sep 17 00:00:00 2001 From: millmanorama Date: Wed, 24 Jan 2018 11:44:57 +0100 Subject: [PATCH 11/62] refactor SQLiteViewer to fix scroll bar and painting issues. --- .../contentviewers/SQLiteTableRowFactory.java | 7 +- .../contentviewers/SQLiteTableView.form | 5 - .../contentviewers/SQLiteTableView.java | 99 +++++++--------- .../autopsy/contentviewers/SQLiteViewer.form | 47 ++------ .../autopsy/contentviewers/SQLiteViewer.java | 110 +++++++++--------- 5 files changed, 118 insertions(+), 150 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java index 98b21149ce..633f40260c 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableRowFactory.java @@ -18,7 +18,6 @@ */ package org.sleuthkit.autopsy.contentviewers; -import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -31,9 +30,9 @@ import org.sleuthkit.autopsy.datamodel.NodeProperty; public class SQLiteTableRowFactory extends ChildFactory { - private final ArrayList> rows; + private final List> rows; - public SQLiteTableRowFactory(ArrayList> rows) { + public SQLiteTableRowFactory(List> rows) { this.rows = rows; } @@ -62,7 +61,7 @@ class SQLiteTableRowNode extends AbstractNode { private final Map row; - public SQLiteTableRowNode(Map row) { + SQLiteTableRowNode(Map row) { super(Children.LEAF); this.row = row; } diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form index 75cb61a443..2c7924e2a4 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.form @@ -1,11 +1,6 @@
- - - - - diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java index c795133f73..ad1117f0a0 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java @@ -19,10 +19,13 @@ package org.sleuthkit.autopsy.contentviewers; import java.awt.BorderLayout; -import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Objects; +import javax.swing.JPanel; +import javax.swing.JTable; import javax.swing.ListSelectionModel; +import javax.swing.ScrollPaneConstants; import javax.swing.table.TableColumnModel; import org.netbeans.swing.etable.ETableColumn; import org.netbeans.swing.etable.ETableColumnModel; @@ -31,73 +34,64 @@ import org.openide.explorer.ExplorerManager; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; +class SQLiteTableView extends JPanel implements ExplorerManager.Provider { -public class SQLiteTableView extends javax.swing.JPanel implements ExplorerManager.Provider { - - private final Outline outline; private final org.openide.explorer.view.OutlineView outlineView; - private ExplorerManager explorerManager; + private final Outline outline; + private final ExplorerManager explorerManager; - private final ArrayList> tableRows; - /** * Creates new form SQLiteTableView - * @param rows + * */ - public SQLiteTableView(ArrayList> rows) { - - this.tableRows = rows; - - outlineView = new org.openide.explorer.view.OutlineView(); - outlineView.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); - + SQLiteTableView() { + initComponents(); - - add(outlineView,BorderLayout.CENTER); - - outline = outlineView.getOutline(); + outlineView = new org.openide.explorer.view.OutlineView(); + add(outlineView, BorderLayout.CENTER); outlineView.setPropertyColumns(); // column headers will be set later + outlineView.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); + outlineView.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + + outline = outlineView.getOutline(); + outline.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - - customize(); + outline.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); + outline.setRowSelectionAllowed(false); + outline.setRootVisible(false); + + explorerManager = new ExplorerManager(); } - private void customize() { - - //tableScrollPane.setViewportView(outlineView); - - this.setVisible(true); - outline.setRowSelectionAllowed(false); - outline.setRootVisible(false); - - explorerManager = new ExplorerManager(); - explorerManager.setRootContext(new AbstractNode(Children.create(new SQLiteTableRowFactory(tableRows), true))); - - setupColumns(); - } - /** * Sets up the columns in the display table + * + * @param tableRows */ - private void setupColumns() { - if (Objects.isNull(tableRows) || tableRows.isEmpty()) - return; - - Map row = tableRows.get(0); - - // Get the columns setup with respect to names and sortability - String[] propStrings = new String[row.size() * 2]; - - int i = 0; - for (Map.Entry col: row.entrySet()) { + void setupTable(List> tableRows) { + + explorerManager.setRootContext(new AbstractNode(Children.create(new SQLiteTableRowFactory(tableRows), true))); + + if (Objects.isNull(tableRows) || tableRows.isEmpty()) { + outlineView.setPropertyColumns(); +// return; + } else { + + Map row = tableRows.get(0); + + // Get the columns setup with respect to names and sortability + String[] propStrings = new String[row.size() * 2]; + + int i = 0; + for (Map.Entry col : row.entrySet()) { String colName = col.getKey(); propStrings[2 * i] = colName; propStrings[2 * i + 1] = colName; i++; + } + + outlineView.setPropertyColumns(propStrings); } - - - outlineView.setPropertyColumns(propStrings); // TBD: Set width based on actual data in the top N rows?? // TBD: Can't seem to get the horizontal scrollbar working @@ -109,9 +103,9 @@ public class SQLiteTableView extends javax.swing.JPanel implements ExplorerManag TableColumnModel columnModel = outline.getColumnModel(); ETableColumn column = (ETableColumn) columnModel.getColumn(0); ((ETableColumnModel) columnModel).setColumnHidden(column, true); - + } - + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -121,12 +115,9 @@ public class SQLiteTableView extends javax.swing.JPanel implements ExplorerManag // //GEN-BEGIN:initComponents private void initComponents() { - setPreferredSize(new java.awt.Dimension(600, 400)); setLayout(new java.awt.BorderLayout()); }// //GEN-END:initComponents - - @Override public ExplorerManager getExplorerManager() { return explorerManager; diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.form b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.form index 121a96c823..0469da7b73 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.form +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.form @@ -68,16 +68,18 @@ - - - - - - - - + + + + + + + + + + @@ -200,33 +202,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java index 6442b645d1..d5b5afdb68 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java @@ -16,29 +16,29 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.sleuthkit.autopsy.contentviewers; +import java.awt.BorderLayout; import java.awt.Component; import java.io.File; import java.io.IOException; -import java.util.Arrays; -import java.util.List; -import java.util.logging.Level; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.ResultSetMetaData; -import java.sql.Statement; import java.sql.SQLException; +import java.sql.Statement; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.TreeMap; import java.util.concurrent.ExecutionException; +import java.util.logging.Level; import javax.swing.JComboBox; -import javax.swing.JPanel; import javax.swing.SwingWorker; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; @@ -50,22 +50,26 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { public static final String[] SUPPORTED_MIMETYPES = new String[]{"application/x-sqlite3"}; private static final Logger LOGGER = Logger.getLogger(FileViewer.class.getName()); private Connection connection = null; - + private String tmpDBPathName = null; private File tmpDBFile = null; - Map dbTablesMap = new TreeMap<>(); + private final Map dbTablesMap = new TreeMap<>(); private static final int ROWS_PER_PAGE = 100; private int numRows; // num of rows in the selected table private int currPage = 0; // curr page of rows being displayed - - private SwingWorker>, Void> worker; + + SQLiteTableView selectedTableView = new SQLiteTableView(); + + private SwingWorker worker; + /** * Creates new form SQLiteViewer */ public SQLiteViewer() { initComponents(); + jTableDataPanel.add(selectedTableView, BorderLayout.CENTER); } /** @@ -167,20 +171,21 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { jHdrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jHdrPanelLayout.createSequentialGroup() .addContainerGap() - .addGroup(jHdrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(tablesDropdownList, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel1) - .addComponent(numEntriesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel2) - .addComponent(currPageLabel) - .addComponent(jLabel3) - .addComponent(numPagesLabel) + .addGroup(jHdrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(nextPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(prevPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(prevPageButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jHdrPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(tablesDropdownList, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1) + .addComponent(numEntriesField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2) + .addComponent(currPageLabel) + .addComponent(jLabel3) + .addComponent(numPagesLabel))) .addContainerGap()) ); - jTableDataPanel.setLayout(new javax.swing.OverlayLayout(jTableDataPanel)); + jTableDataPanel.setLayout(new java.awt.BorderLayout()); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); @@ -270,11 +275,11 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { public void resetComponent() { dbTablesMap.clear(); - + tablesDropdownList.setEnabled(true); tablesDropdownList.removeAllItems(); numEntriesField.setText(""); - + // close DB connection to file if (null != connection) { try { @@ -312,7 +317,7 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { tmpDBPathName = Case.getCurrentCase().getTempDirectory() + File.separator + sqliteFile.getName() + "-" + sqliteFile.getId(); tmpDBFile = new File(tmpDBPathName); ContentUtils.writeToFile(sqliteFile, tmpDBFile); - + // Open copy using JDBC Class.forName("org.sqlite.JDBC"); //NON-NLS //load JDBC driver connection = DriverManager.getConnection("jdbc:sqlite:" + tmpDBPathName); //NON-NLS @@ -379,7 +384,12 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { } private void selectTable(String tableName) { - new SwingWorker() { + if (worker != null && !worker.isDone()) { + worker.cancel(false); + worker = null; + } + + worker = new SwingWorker() { @Override protected Integer doInBackground() throws Exception { @@ -400,48 +410,47 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { protected void done() { super.done(); try { - + numRows = get(); numEntriesField.setText(numRows + " entries"); - + currPage = 1; currPageLabel.setText(Integer.toString(currPage)); - numPagesLabel.setText(Integer.toString((numRows/ROWS_PER_PAGE)+1)); - + numPagesLabel.setText(Integer.toString((numRows / ROWS_PER_PAGE) + 1)); + prevPageButton.setEnabled(false); - - jTableDataPanel.removeAll(); - jTableDataPanel.repaint(); - + + if (numRows > 0) { nextPageButton.setEnabled(((numRows > ROWS_PER_PAGE))); - readTable(tableName, (currPage-1)*ROWS_PER_PAGE + 1, ROWS_PER_PAGE); - } - else { + readTable(tableName, (currPage - 1) * ROWS_PER_PAGE + 1, ROWS_PER_PAGE); + } else { nextPageButton.setEnabled(false); + selectedTableView.setupTable(Collections.emptyList()); } - - + } catch (InterruptedException | ExecutionException ex) { LOGGER.log(Level.SEVERE, "Unexpected exception while reading table.", ex); //NON-NLS } } - }.execute(); + }; + worker.execute(); } + private void readTable(String tableName, int startRow, int numRowsToRead) { - + if (worker != null && !worker.isDone()) { worker.cancel(false); worker = null; } - + worker = new SwingWorker>, Void>() { @Override protected ArrayList> doInBackground() throws Exception { try { Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery( - "SELECT * FROM " + tableName + "SELECT * FROM " + tableName + " LIMIT " + Integer.toString(numRowsToRead) + " OFFSET " + Integer.toString(startRow - 1) ); //NON-NLS @@ -456,32 +465,29 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { @Override protected void done() { - + if (isCancelled()) { return; } - + super.done(); try { ArrayList> rows = get(); if (Objects.nonNull(rows)) { - JPanel selectedTableView = new SQLiteTableView(rows); - - jTableDataPanel.removeAll(); - jTableDataPanel.setLayout(new javax.swing.OverlayLayout(jTableDataPanel)); - jTableDataPanel.add(selectedTableView); - jTableDataPanel.repaint(); + selectedTableView.setupTable(rows); + }else{ + selectedTableView.setupTable(Collections.emptyList()); } } catch (InterruptedException | ExecutionException ex) { LOGGER.log(Level.SEVERE, "Unexpected exception while reading table.", ex); //NON-NLS } } }; - + worker.execute(); } - private ArrayList> resultSetToArrayList(ResultSet rs) throws SQLException { + private ArrayList> resultSetToArrayList(ResultSet rs) throws SQLException { ResultSetMetaData md = rs.getMetaData(); int columns = md.getColumnCount(); ArrayList> arraylist = new ArrayList<>(); @@ -502,5 +508,5 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { } return arraylist; - } + } } From 0130993b31011a657e77455c9a320e9a8b1815a9 Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Wed, 24 Jan 2018 08:30:19 -0500 Subject: [PATCH 12/62] Minor text fix --- docs/doxygen-user/live_triage.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/doxygen-user/live_triage.dox b/docs/doxygen-user/live_triage.dox index f8272a1b62..d85b54a20a 100644 --- a/docs/doxygen-user/live_triage.dox +++ b/docs/doxygen-user/live_triage.dox @@ -18,7 +18,7 @@ Insert the drive into the target machine and browse to it in Windows Explorer. R \image html live_triage_script.png -Running the script will generate a few more directories on the USB drive. configData stores all the data used by Autopsy - primarily configuration files and temporary files. You can make changes to the Autopsy settings and they will persist between runs. The cases directory is created as a recommended place to save your case data. You will need to browse to it when creating a case in Autopsy. +Running the script will generate a few more directories on the USB drive. The configData directory stores all the data used by Autopsy - primarily configuration files and temporary files. You can make changes to the Autopsy settings and they will persist between runs. The cases directory is created as a recommended place to save your case data. You will need to browse to it when creating a case in Autopsy. Once Autopsy is running, proceed to create a case as normal, making sure to save it on the USB drive. From 9190b8a811b1f56d8d214294aad9476d2cbeff8c Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Wed, 24 Jan 2018 11:35:12 -0500 Subject: [PATCH 13/62] Update multi user case open screenshot --- .../images/multi_user_case_select.png | Bin 44244 -> 15919 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/docs/doxygen-user/images/multi_user_case_select.png b/docs/doxygen-user/images/multi_user_case_select.png index f87baa555a20ec519a2ea90c7521900812f4a25d..c4ca377fc6572917d4e321491a2db8a560f068f0 100644 GIT binary patch literal 15919 zcmeHuXIK}75+|Hj_CHo+aM5#NdAqq z8VE!%3<6yxx^)$3F~kmb0AGYoZ**NjpgZK3e^)@M=?{R$n{M(-GB+2lJh(^lP*)zr z2?9L^$xFY|@S4UTef>t;;P~wUPER}LTUzH&4(-B{A5pM7o59I`Mn6i^TFBE2Hzm)J zd6WC?F^d{0$*3jiofoXPC+TXuzH?b#SA~=kT92`hFF0Iv8LgFjNqPUv%L7q_WD_h6 zZY9`7MrJf1M`!Qh(X^X^LyLG@eLa`;7NffYIQ3Zp*+RFvvck&>{PVK-{1kv3T^>{Vd*88tRfG5X|^eA=<;OKs?%TNEX-v6_lD$}#;_j=ZnC#=DFGc$ z*=rCy-bjCYO%lI-cwm2k&v5Ur`?4-~nq?_r$Gf+lpT+%A=_%azu$Hwp893m#^!6~p zA(Fp}wL@#JsZVR75rO`ATBduFaJ*G;kSK`i`fHR31PUbY5H!YAS!8*xE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H 14/62] Fix correlation data source argument order --- .../autopsy/centralrepository/datamodel/AbstractSqlEamDb.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index 2cac9b4927..87478529f7 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -2172,7 +2172,7 @@ public abstract class AbstractSqlEamDb implements EamDb { } CorrelationAttributeInstance eamArtifactInstance = new CorrelationAttributeInstance( new CorrelationCase(resultSet.getInt("case_id"), resultSet.getString("case_uid"), resultSet.getString("case_name")), - new CorrelationDataSource(-1, resultSet.getInt("case_id"), resultSet.getString("device_id"), resultSet.getString("name")), + new CorrelationDataSource(resultSet.getInt("case_id"), -1, resultSet.getString("device_id"), resultSet.getString("name")), resultSet.getString("file_path"), resultSet.getString("comment"), TskData.FileKnown.valueOf(resultSet.getByte("known_status")) From 299c80669ca4d34009f8f91513a011480c3a790c Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Thu, 25 Jan 2018 13:10:06 -0500 Subject: [PATCH 15/62] Made initial test method for central repo. Made a few method public/made new public methods needed for tests. --- .../datamodel/CorrelationCase.java | 6 +- .../datamodel/CorrelationDataSource.java | 10 + .../datamodel/CentralRepoDatamodelTest.java | 174 ++++++++++++++++++ 3 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationCase.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationCase.java index 79d94837ee..2d441881de 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationCase.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationCase.java @@ -50,6 +50,10 @@ public class CorrelationCase implements Serializable { * @param caseUUID Globally unique identifier * @param displayName */ + public CorrelationCase(String caseUUID, String displayName) { + this(-1, caseUUID, displayName); + } + CorrelationCase(int ID, String caseUUID, String displayName) { this(ID, caseUUID, null, displayName, DATE_FORMAT.format(new Date()), null, null, null, null, null); } @@ -156,7 +160,7 @@ public class CorrelationCase implements Serializable { /** * @return the database ID for the case or -1 if it is unknown (or not in the DB) */ - int getID() { + public int getID() { // @@@ Should probably have some lazy logic here to lead the ID from the DB if it is -1 return databaseId; } diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java index 9bad6dbac7..9aa9fada32 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationDataSource.java @@ -38,6 +38,16 @@ public class CorrelationDataSource implements Serializable { private final String deviceID; //< Unique to its associated case (not necessarily globally unique) private final String name; + /** + * + * @param caseId + * @param deviceId + * @param name + */ + public CorrelationDataSource(int caseId, String deviceId, String name) { + this(caseId, -1, deviceId, name); + } + CorrelationDataSource(int caseId, int dataSourceId, String deviceId, diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java new file mode 100644 index 0000000000..345dff4cd3 --- /dev/null +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -0,0 +1,174 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.sleuthkit.autopsy.centralrepository.datamodel; + +import java.io.IOException; +import java.util.Map; +import java.nio.file.Path; +import java.nio.file.Paths; +import static junit.framework.Assert.assertFalse; +import static junit.framework.Assert.assertTrue; +import junit.framework.Test; +import junit.framework.TestCase; +import org.apache.commons.io.FileUtils; +import org.netbeans.junit.NbModuleSuite; +import org.openide.util.Exceptions; +import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.casemodule.CaseActionException; +import org.sleuthkit.autopsy.casemodule.CaseDetails; +import org.sleuthkit.autopsy.coreutils.ModuleSettings; + +/** + * + */ +public class CentralRepoDatamodelTest extends TestCase{ + + private static final String PROPERTIES_FILE = "CentralRepository"; + private static final String CR_DB_NAME = "testcentralrepo.db"; + private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest"); + + private CorrelationCase case1; + private CorrelationCase case2; + private CorrelationDataSource dataSource1fromCase1; + private CorrelationDataSource dataSource2fromCase1; + private EamOrganization org1; + private EamOrganization org2; + + private Map propertiesMap = null; + + public static Test suite() { + NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(CentralRepoDatamodelTest.class). + clusters(".*"). + enableModules(".*"); + return conf.suite(); + } + + @Override + public void setUp() { + + boolean errorsOccurred; + SqliteEamDbSettings dbSettingsSqlite = new SqliteEamDbSettings(); + + // Delete the test directory, if it exists + if(testDirectory.toFile().exists()){ + try{ + FileUtils.deleteDirectory(testDirectory.toFile()); + } catch (IOException ex){ + Exceptions.printStackTrace(ex); + } + } + assertFalse("Unable to delete existing test directory", testDirectory.toFile().exists()); + + // Create the test directory + testDirectory.toFile().mkdirs(); + assertTrue("Unable to create test directory", testDirectory.toFile().exists()); + + // Save the current central repo settings + propertiesMap = ModuleSettings.getConfigSettings(PROPERTIES_FILE); + + // Set up an Autopsy case for testing + try { + Case.createAsCurrentCase(Case.CaseType.SINGLE_USER_CASE, testDirectory.toString(), new CaseDetails("CentralRepoDatamodelTestCase")); + } catch (CaseActionException ex) { + Exceptions.printStackTrace(ex); + } + assertTrue("Failed to create test case", testDirectory.toFile().exists()); + + errorsOccurred = false; + try{ + dbSettingsSqlite.setDbName(CR_DB_NAME); + dbSettingsSqlite.setDbDirectory(testDirectory.toString()); + if (!dbSettingsSqlite.dbDirectoryExists()) { + dbSettingsSqlite.createDbDirectory(); + } + + assertTrue("Failed to created central repo directory " + dbSettingsSqlite.getDbDirectory(), dbSettingsSqlite.dbDirectoryExists()); + + boolean result = dbSettingsSqlite.initializeDatabaseSchema() + && dbSettingsSqlite.insertDefaultDatabaseContent(); + + assertTrue("Failed to initialize central repo database", result); + + dbSettingsSqlite.saveSettings(); + EamDbUtil.setUseCentralRepo(true); + EamDbPlatformEnum.setSelectedPlatform(EamDbPlatformEnum.SQLITE.name()); + EamDbPlatformEnum.saveSelectedPlatform(); + + EamDb.getInstance().getCases(); + } catch (Exception ex){ + errorsOccurred = true; + Exceptions.printStackTrace(ex); + } + + assertFalse("Failed to create/initialize central repo database", errorsOccurred); + Path crDbFilePath = Paths.get(testDirectory.toString(), CR_DB_NAME); + assertTrue("Failed to create central repo database at " + crDbFilePath, crDbFilePath.toFile().exists()); + + // Set up some default objects to be used by the tests + errorsOccurred = false; + try{ + case1 = new CorrelationCase("case1_uuid", "case1"); + case1 = EamDb.getInstance().newCase(case1); + assertTrue("Failed to create test object case1", case1 != null); + + case2 = new CorrelationCase("case2_uuid", "case2"); + case2 = EamDb.getInstance().newCase(case2); + assertTrue("Failed to create test object case2", case2 != null); + + dataSource1fromCase1 = new CorrelationDataSource(case1.getID(), "dataSource1_deviceID", "dataSource1"); + EamDb.getInstance().newDataSource(dataSource1fromCase1); + dataSource1fromCase1 = EamDb.getInstance().getDataSource(case1, dataSource1fromCase1.getDeviceID()); + assertTrue("Failed to create test object dataSource1fromCase1", dataSource1fromCase1 != null); + + dataSource2fromCase1 = new CorrelationDataSource(case1.getID(), "dataSource2_deviceID", "dataSource2"); + EamDb.getInstance().newDataSource(dataSource2fromCase1); + dataSource2fromCase1 = EamDb.getInstance().getDataSource(case1, dataSource2fromCase1.getDeviceID()); + assertTrue("Failed to create test object dataSource2fromCase1", dataSource2fromCase1 != null); + + org1 = new EamOrganization("org1"); + org1.setOrgID((int)EamDb.getInstance().newOrganization(org1)); + + org2 = new EamOrganization("org2"); + org2.setOrgID((int)EamDb.getInstance().newOrganization(org2)); + + + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + errorsOccurred = true; + } + + assertFalse("Failed to create default database objects", errorsOccurred); + + + } + + @Override + public void tearDown() { + + // Restore the original properties + ModuleSettings.setConfigSettings(PROPERTIES_FILE, propertiesMap); + + // Close and delete the test case and central repo db + try { + EamDb.getInstance().shutdownConnections(); + Case.closeCurrentCase(); + FileUtils.deleteDirectory(testDirectory.toFile()); + + } catch (EamDbException | CaseActionException | IOException ex) { + Exceptions.printStackTrace(ex); + } + assertFalse("Error deleting test directory " + testDirectory.toString(), testDirectory.toFile().exists()); + } + + public void test1(){ + System.out.println("It's test 1"); + } + + // public void test2(){ + + // } + +} From f80b3d94c1478e008922033b4d5da3d299e24776 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\zhaohui" Date: Thu, 25 Jan 2018 13:37:59 -0500 Subject: [PATCH 16/62] 3469_3470: Catch Runtime exception for too large data for Excel cell and fix the HTML formatting issue. --- .../sleuthkit/autopsy/report/ReportExcel.java | 16 +++++++++++++++- .../org/sleuthkit/autopsy/report/ReportHTML.java | 4 +++- .../autopsy/report/TableReportGenerator.java | 3 +-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java index 19526a0a19..f1b8c421b5 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java @@ -34,6 +34,7 @@ class ReportExcel implements TableReportModule { private static final Logger logger = Logger.getLogger(ReportExcel.class.getName()); private static ReportExcel instance; + private static final int EXCEL_CELL_MAXIMUM_SIZE = 36767; private Workbook wb; private Sheet sheet; @@ -236,10 +237,23 @@ class ReportExcel implements TableReportModule { * @param row cells to add */ @Override + @NbBundle.Messages({ + "ReportExcel.exceptionMessage.dataTooLarge=Value is too long to fit into an Excel cell. ", + "ReportExcel.exceptionMessage.errorText=Error showing data into an Excel cell." + }) + public void addRow(List rowData) { Row row = sheet.createRow(rowIndex); for (int i = 0; i < rowData.size(); ++i) { - row.createCell(i).setCellValue(rowData.get(i)); + try { + row.createCell(i).setCellValue(rowData.get(i)); + } catch (Exception e) { + if (e instanceof java.lang.IllegalArgumentException && rowData.get(i).length() > EXCEL_CELL_MAXIMUM_SIZE) { + row.getCell(i).setCellValue(Bundle.ReportExcel_exceptionMessage_dataTooLarge() + e.getMessage()); + } else { + row.getCell(i).setCellValue(Bundle.ReportExcel_exceptionMessage_errorText()); + } + } } ++rowIndex; } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java index 88d9fe44b1..01a179a370 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java @@ -51,6 +51,7 @@ import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.services.Services; import org.sleuthkit.autopsy.casemodule.services.TagsManager; +import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.ContentUtils.ExtractFscContentVisitor; @@ -554,7 +555,8 @@ class ReportHTML implements TableReportModule { StringBuilder builder = new StringBuilder(); builder.append("\t\n"); //NON-NLS for (String cell : row) { - builder.append("\t\t").append(cell).append("\n"); //NON-NLS + String escapeHTMLCell = EscapeUtil.escapeHtml(cell); + builder.append("\t\t").append(escapeHTMLCell).append("\n"); //NON-NLS } builder.append("\t\n"); //NON-NLS rowCount++; diff --git a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java index 93894022b3..58e38a7d23 100644 --- a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java @@ -666,8 +666,7 @@ class TableReportGenerator { tableModule.startTable(columnHeaderNames); } - String previewreplace = EscapeUtil.escapeHtml(preview); - tableModule.addRow(Arrays.asList(new String[]{previewreplace.replaceAll(" Date: Fri, 26 Jan 2018 11:58:29 -0500 Subject: [PATCH 17/62] 3469_3470: cleanup --- .../src/org/sleuthkit/autopsy/report/TableReportGenerator.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java index 58e38a7d23..499f848d54 100644 --- a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013-16 Basis Technology Corp. + * Copyright 2013-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -40,7 +40,6 @@ import java.util.logging.Level; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.services.TagsManager; -import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.ContentUtils; From c7a7898b957516f0a08b8d2945a5aaa41c8b848c Mon Sep 17 00:00:00 2001 From: "U-BASIS\\zhaohui" Date: Fri, 26 Jan 2018 15:14:27 -0500 Subject: [PATCH 18/62] 3469_3470: Use variable to make code more readable. --- Core/src/org/sleuthkit/autopsy/report/ReportExcel.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java index f1b8c421b5..81045dc5b1 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java @@ -245,13 +245,14 @@ class ReportExcel implements TableReportModule { public void addRow(List rowData) { Row row = sheet.createRow(rowIndex); for (int i = 0; i < rowData.size(); ++i) { + Cell excelCell = row.createCell(i); try { - row.createCell(i).setCellValue(rowData.get(i)); + excelCell.setCellValue(rowData.get(i)); } catch (Exception e) { if (e instanceof java.lang.IllegalArgumentException && rowData.get(i).length() > EXCEL_CELL_MAXIMUM_SIZE) { - row.getCell(i).setCellValue(Bundle.ReportExcel_exceptionMessage_dataTooLarge() + e.getMessage()); + excelCell.setCellValue(Bundle.ReportExcel_exceptionMessage_dataTooLarge() + e.getMessage()); } else { - row.getCell(i).setCellValue(Bundle.ReportExcel_exceptionMessage_errorText()); + excelCell.setCellValue(Bundle.ReportExcel_exceptionMessage_errorText()); } } } From 487202790f109713aa81d7514b0d11f88c30595b Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Mon, 29 Jan 2018 08:05:48 -0500 Subject: [PATCH 19/62] Case test method is done --- .../datamodel/AbstractSqlEamDb.java | 16 +- .../datamodel/CentralRepoDatamodelTest.java | 434 +++++++++++++++--- 2 files changed, 388 insertions(+), 62 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index 2cac9b4927..c5b9af62a6 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -271,6 +271,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public void updateCase(CorrelationCase eamCase) throws EamDbException { + if(eamCase == null) { + throw new EamDbException("CorrelationCase argument is null"); + } + Connection conn = connect(); PreparedStatement preparedStatement = null; @@ -929,12 +933,16 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public void bulkInsertCases(List cases) throws EamDbException { - Connection conn = connect(); - + if(cases == null) { + throw new EamDbException("cases argument is null"); + } + if (cases.isEmpty()) { return; } + Connection conn = connect(); + int counter = 0; PreparedStatement bulkPs = null; try { @@ -1012,11 +1020,11 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public void setArtifactInstanceKnownStatus(CorrelationAttribute eamArtifact, TskData.FileKnown knownStatus) throws EamDbException { - Connection conn = connect(); - if (1 != eamArtifact.getInstances().size()) { throw new EamDbException("Error: Artifact must have exactly one (1) Artifact Instance to set as notable."); // NON-NLS } + + Connection conn = connect(); List eamInstances = eamArtifact.getInstances(); CorrelationAttributeInstance eamInstance = eamInstances.get(0); diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 345dff4cd3..489f651e23 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -7,8 +7,11 @@ package org.sleuthkit.autopsy.centralrepository.datamodel; import java.io.IOException; import java.util.Map; +import java.util.List; +import java.util.ArrayList; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.stream.Collectors; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; import junit.framework.Test; @@ -16,6 +19,7 @@ import junit.framework.TestCase; import org.apache.commons.io.FileUtils; import org.netbeans.junit.NbModuleSuite; import org.openide.util.Exceptions; +import org.python.icu.impl.Assert; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.CaseActionException; import org.sleuthkit.autopsy.casemodule.CaseDetails; @@ -24,100 +28,95 @@ import org.sleuthkit.autopsy.coreutils.ModuleSettings; /** * */ -public class CentralRepoDatamodelTest extends TestCase{ - +public class CentralRepoDatamodelTest extends TestCase { + private static final String PROPERTIES_FILE = "CentralRepository"; private static final String CR_DB_NAME = "testcentralrepo.db"; private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest"); - + SqliteEamDbSettings dbSettingsSqlite; + private CorrelationCase case1; private CorrelationCase case2; private CorrelationDataSource dataSource1fromCase1; private CorrelationDataSource dataSource2fromCase1; private EamOrganization org1; private EamOrganization org2; - + private Map propertiesMap = null; - + public static Test suite() { NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(CentralRepoDatamodelTest.class). clusters(".*"). enableModules(".*"); return conf.suite(); } - + @Override public void setUp() { - - boolean errorsOccurred; - SqliteEamDbSettings dbSettingsSqlite = new SqliteEamDbSettings(); - + dbSettingsSqlite = new SqliteEamDbSettings(); + // Delete the test directory, if it exists - if(testDirectory.toFile().exists()){ - try{ + if (testDirectory.toFile().exists()) { + try { FileUtils.deleteDirectory(testDirectory.toFile()); - } catch (IOException ex){ - Exceptions.printStackTrace(ex); + } catch (IOException ex) { + Assert.fail(ex); } } assertFalse("Unable to delete existing test directory", testDirectory.toFile().exists()); - + // Create the test directory testDirectory.toFile().mkdirs(); assertTrue("Unable to create test directory", testDirectory.toFile().exists()); - + // Save the current central repo settings propertiesMap = ModuleSettings.getConfigSettings(PROPERTIES_FILE); - + // Set up an Autopsy case for testing try { Case.createAsCurrentCase(Case.CaseType.SINGLE_USER_CASE, testDirectory.toString(), new CaseDetails("CentralRepoDatamodelTestCase")); } catch (CaseActionException ex) { Exceptions.printStackTrace(ex); - } + Assert.fail(ex); + } assertTrue("Failed to create test case", testDirectory.toFile().exists()); - - errorsOccurred = false; - try{ + + try { dbSettingsSqlite.setDbName(CR_DB_NAME); dbSettingsSqlite.setDbDirectory(testDirectory.toString()); if (!dbSettingsSqlite.dbDirectoryExists()) { dbSettingsSqlite.createDbDirectory(); } - + assertTrue("Failed to created central repo directory " + dbSettingsSqlite.getDbDirectory(), dbSettingsSqlite.dbDirectoryExists()); boolean result = dbSettingsSqlite.initializeDatabaseSchema() - && dbSettingsSqlite.insertDefaultDatabaseContent(); + && dbSettingsSqlite.insertDefaultDatabaseContent(); assertTrue("Failed to initialize central repo database", result); - + dbSettingsSqlite.saveSettings(); EamDbUtil.setUseCentralRepo(true); EamDbPlatformEnum.setSelectedPlatform(EamDbPlatformEnum.SQLITE.name()); EamDbPlatformEnum.saveSelectedPlatform(); - - EamDb.getInstance().getCases(); - } catch (Exception ex){ - errorsOccurred = true; + } catch (Exception ex) { Exceptions.printStackTrace(ex); + Assert.fail(ex); } - - assertFalse("Failed to create/initialize central repo database", errorsOccurred); + Path crDbFilePath = Paths.get(testDirectory.toString(), CR_DB_NAME); assertTrue("Failed to create central repo database at " + crDbFilePath, crDbFilePath.toFile().exists()); - + // Set up some default objects to be used by the tests - errorsOccurred = false; - try{ + try { case1 = new CorrelationCase("case1_uuid", "case1"); case1 = EamDb.getInstance().newCase(case1); assertTrue("Failed to create test object case1", case1 != null); - + case2 = new CorrelationCase("case2_uuid", "case2"); case2 = EamDb.getInstance().newCase(case2); assertTrue("Failed to create test object case2", case2 != null); - + dataSource1fromCase1 = new CorrelationDataSource(case1.getID(), "dataSource1_deviceID", "dataSource1"); EamDb.getInstance().newDataSource(dataSource1fromCase1); dataSource1fromCase1 = EamDb.getInstance().getDataSource(case1, dataSource1fromCase1.getDeviceID()); @@ -126,31 +125,27 @@ public class CentralRepoDatamodelTest extends TestCase{ dataSource2fromCase1 = new CorrelationDataSource(case1.getID(), "dataSource2_deviceID", "dataSource2"); EamDb.getInstance().newDataSource(dataSource2fromCase1); dataSource2fromCase1 = EamDb.getInstance().getDataSource(case1, dataSource2fromCase1.getDeviceID()); - assertTrue("Failed to create test object dataSource2fromCase1", dataSource2fromCase1 != null); - + assertTrue("Failed to create test object dataSource2fromCase1", dataSource2fromCase1 != null); + org1 = new EamOrganization("org1"); - org1.setOrgID((int)EamDb.getInstance().newOrganization(org1)); - + org1.setOrgID((int) EamDb.getInstance().newOrganization(org1)); + org2 = new EamOrganization("org2"); - org2.setOrgID((int)EamDb.getInstance().newOrganization(org2)); - - - } catch (EamDbException ex){ + org2.setOrgID((int) EamDb.getInstance().newOrganization(org2)); + + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); - errorsOccurred = true; + Assert.fail(ex); } - - assertFalse("Failed to create default database objects", errorsOccurred); - } - + @Override public void tearDown() { - + // Restore the original properties ModuleSettings.setConfigSettings(PROPERTIES_FILE, propertiesMap); - + // Close and delete the test case and central repo db try { EamDb.getInstance().shutdownConnections(); @@ -158,17 +153,340 @@ public class CentralRepoDatamodelTest extends TestCase{ FileUtils.deleteDirectory(testDirectory.toFile()); } catch (EamDbException | CaseActionException | IOException ex) { + //} catch (EamDbException | CaseActionException ex) { Exceptions.printStackTrace(ex); + Assert.fail(ex); } assertFalse("Error deleting test directory " + testDirectory.toString(), testDirectory.toFile().exists()); } - - public void test1(){ - System.out.println("It's test 1"); - } - - // public void test2(){ + + /** + * Test method for the methods related to the cases table + * newCase(CorrelationCase eamCase) tests: + * - Test valid data + * - Test null UUID + * - Test null case name + * - Test repeated UUID + * newCase(Case autopsyCase) tests: + * - Test valid data + * - Test null autopsyCase + * updateCase(CorrelationCase eamCase) tests: + * - Test with valid data, checking all fields + * - Test null eamCase + * getCase(Case autopsyCase) tests: + * - Test ?? + * getCaseByUUID(String caseUUID) getCases() + * - Test with UUID that is in the database + * - Test with UUID that is not in the database + * - Test with null UUID + * bulkInsertCases(List cases) + * - Test on a list of cases larger than the bulk insert threshold. + * - Test on a null list + */ + public void testCases() { + final String caseAname = "caseA"; + final String caseAuuid = "caseA_uuid"; + CorrelationCase caseA; + CorrelationCase caseB; + + // Test creating a case with valid name and uuid + try { + caseA = new CorrelationCase(caseAuuid, caseAname); + caseA = EamDb.getInstance().newCase(caseA); + assertTrue("Failed to create case", caseA != null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test null uuid + try { + CorrelationCase tempCase = new CorrelationCase(null, "nullUuidCase"); + tempCase = EamDb.getInstance().newCase(tempCase); + Assert.fail("newCase did not throw expected exception from null uuid"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test null name + try { + CorrelationCase tempCase = new CorrelationCase("nullCaseUuid", null); + tempCase = EamDb.getInstance().newCase(tempCase); + Assert.fail("newCase did not throw expected exception from null name"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test creating a case with an already used UUID + // This should just return the existing case object. Check that the total + // number of cases does not increase. + try { + int nCases = EamDb.getInstance().getCases().size(); + CorrelationCase tempCase = new CorrelationCase(caseAuuid, "newCaseWithSameUUID"); + tempCase = EamDb.getInstance().newCase(tempCase); + assertTrue("newCase returned null for existing UUID", tempCase != null); + assertTrue("newCase created a new case for an already existing UUID", nCases == EamDb.getInstance().getCases().size()); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test creating a case from an Autopsy case + // The case may already be in the database - the result is the same either way + try { + caseB = EamDb.getInstance().newCase(Case.getCurrentCase()); + assertTrue("Failed to create correlation case from Autopsy case", caseB != null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test null Autopsy case + try { + Case nullCase = null; + CorrelationCase tempCase = EamDb.getInstance().newCase(nullCase); + Assert.fail("newCase did not throw expected exception from null case"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test update case + // Will update the fields of an existing case object, save it, and then + // pull a new copy out of the database + try { + assertTrue(caseA != null); + String caseNumber = "12-34-56"; + String creationDate = "01/12/2018"; + String displayName = "Test Case"; + String examinerEmail = "john@sample.com"; + String examinerName = "John Doe"; + String examinerPhone = "123-555-4567"; + String notes = "Notes"; + + caseA.setCaseNumber(caseNumber); + caseA.setCreationDate(creationDate); + caseA.setDisplayName(displayName); + caseA.setExaminerEmail(examinerEmail); + caseA.setExaminerName(examinerName); + caseA.setExaminerPhone(examinerPhone); + caseA.setNotes(notes); + caseA.setOrg(org1); + + EamDb.getInstance().updateCase(caseA); + + // Retrievex a new copy of the case from the database to check that the + // fields were properly updated + CorrelationCase updatedCase = EamDb.getInstance().getCaseByUUID(caseA.getCaseUUID()); + + assertTrue("updateCase failed to update case number", caseNumber.equals(updatedCase.getCaseNumber())); + assertTrue("updateCase failed to update creation date", creationDate.equals(updatedCase.getCreationDate())); + assertTrue("updateCase failed to update display name", displayName.equals(updatedCase.getDisplayName())); + assertTrue("updateCase failed to update examiner email", examinerEmail.equals(updatedCase.getExaminerEmail())); + assertTrue("updateCase failed to update examiner name", examinerName.equals(updatedCase.getExaminerName())); + assertTrue("updateCase failed to update examiner phone number", examinerPhone.equals(updatedCase.getExaminerPhone())); + assertTrue("updateCase failed to update notes", notes.equals(updatedCase.getNotes())); + assertTrue("updateCase failed to update org (org is null)", updatedCase.getOrg() != null); + assertTrue("updateCase failed to update org (org ID is wrong)", org1.getOrgID() == updatedCase.getOrg().getOrgID()); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test update case with null case + try { + EamDb.getInstance().updateCase(null); + Assert.fail("updateCase did not throw expected exception from null case"); + } catch (EamDbException ex) { + // This is the expected behavior + } - // } - + // Test getting a case from an Autopsy case + try { + CorrelationCase tempCase = EamDb.getInstance().getCase(Case.getCurrentCase()); + assertTrue("getCase returned null for current Autopsy case", tempCase != null); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting a case by UUID + try { + CorrelationCase tempCase = EamDb.getInstance().getCaseByUUID(caseAuuid); + assertTrue("Failed to get case by UUID", tempCase != null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting a case with a non-existent UUID + try { + CorrelationCase tempCase = EamDb.getInstance().getCaseByUUID("badUUID"); + assertTrue("getCaseByUUID returned non-null case for non-existent UUID", tempCase == null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting a case with null UUID + try { + CorrelationCase tempCase = EamDb.getInstance().getCaseByUUID(null); + assertTrue("getCaseByUUID returned non-null case for null UUID", tempCase == null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting the list of cases + // The test is to make sure the three cases we know are in the database are in the list + try { + List caseList = EamDb.getInstance().getCases(); + List uuidList + = caseList.stream().map(c -> c.getCaseUUID()).collect(Collectors.toList()); + assertTrue("getCases is missing data for existing cases", uuidList.contains(case1.getCaseUUID()) + && uuidList.contains(case2.getCaseUUID()) && (uuidList.contains(caseA.getCaseUUID())) + && uuidList.contains(caseB.getCaseUUID())); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test bulk case insert + try { + // Create a list of correlation cases. Make enough that the bulk threshold should be hit once. + List cases = new ArrayList<>(); + String bulkTestUuid = "bulkTestUUID_"; + String bulkTestName = "bulkTestName_"; + for (int i = 0; i < dbSettingsSqlite.getBulkThreshold() * 1.5; i++) { + String name = bulkTestUuid + String.valueOf(i); + String uuid = bulkTestName + String.valueOf(i); + cases.add(new CorrelationCase(uuid, name)); + } + + // Get the current case count + int nCases = EamDb.getInstance().getCases().size(); + + // Insert the big list of cases + EamDb.getInstance().bulkInsertCases(cases); + + // Check that the case count is what is expected + assertTrue("bulkInsertCases did not insert the expected number of cases", nCases + cases.size() == EamDb.getInstance().getCases().size()); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test bulk case insert with null list + try { + EamDb.getInstance().bulkInsertCases(null); + Assert.fail("bulkInsertCases did not throw expected exception from null list"); + } catch (EamDbException ex) { + // This is the expected behavior + } + } + + /** + * Test method for the three methods related to the db_info table + * newDbInfo(String name, String value) tests: - Test valid data - Test null + * name - Test null value getDbInfo(String name) - Test getting value for + * existing name - Test getting value for non-existing name - Test getting + * value for null name updateDbInfo(String name, String value) - Test + * updating existing name to valid new value - Test updating existing name + * to null value - Test updating null name - Test updating non-existing name + * to new value + */ + public void testDbInfo() { + final String name1 = "testName1"; + final String name2 = "testName2"; + final String name3 = "testName3"; + final String value1 = "testValue1"; + final String value2 = "testValue2"; + + // Test setting a valid value in DbInfo + try { + EamDb.getInstance().newDbInfo(name1, value1); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test null name + try { + EamDb.getInstance().newDbInfo(null, value1); + Assert.fail("newDbInfo did not throw expected exception from null name"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test null value + try { + EamDb.getInstance().newDbInfo(name2, null); + Assert.fail("newDbInfo did not throw expected exception from null value"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Try getting the dbInfo entry that should exist + try { + String tempVal = EamDb.getInstance().getDbInfo(name1); + assertTrue("dbInfo value for name1 does not match", value1.equals(tempVal)); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Try getting the dbInfo entry that should not exist + try { + String tempVal = EamDb.getInstance().getDbInfo(name3); + assertTrue("dbInfo value is unexpectedly non-null given non-existent name", tempVal == null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Try getting dbInfo for a null value + try { + String tempVal = EamDb.getInstance().getDbInfo(null); + assertTrue("dbInfo value is unexpectedly non-null given null name", tempVal == null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Try updating an existing value to a valid new value + try { + EamDb.getInstance().updateDbInfo(name1, value2); + assertTrue("dbInfo value failed to update to expected value", value2.equals(EamDb.getInstance().getDbInfo(name1))); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Try updating an existing value to null + try { + EamDb.getInstance().updateDbInfo(name1, null); + Assert.fail("updateDbInfo did not throw expected exception from null value"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Try updating a null name + // This seems like SQLite would throw an exception, but it does not + try { + EamDb.getInstance().updateDbInfo(null, value1); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Try updating the value for a non-existant name + try { + EamDb.getInstance().updateDbInfo(name1, null); + Assert.fail("updateDbInfo did not throw expected exception from non-existent name"); + } catch (EamDbException ex) { + // This is the expected behavior + } + } + } From 2dfa6a25f03f237db606c4647fe8136c764a7d75 Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Mon, 29 Jan 2018 11:50:40 -0500 Subject: [PATCH 20/62] Wrote data sources tests --- .../datamodel/AbstractSqlEamDb.java | 4 + .../datamodel/SqliteEamDb.java | 2 + .../datamodel/CentralRepoDatamodelTest.java | 163 +++++++++++++++--- 3 files changed, 144 insertions(+), 25 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index c5b9af62a6..07937128c1 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -448,6 +448,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public CorrelationDataSource getDataSource(CorrelationCase correlationCase, String dataSourceDeviceId) throws EamDbException { + if(correlationCase == null) { + throw new EamDbException("CorrelationCase argument is null"); + } + Connection conn = connect(); CorrelationDataSource eamDataSourceResult = null; diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/SqliteEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/SqliteEamDb.java index 13c4fb00a7..d9d1ea2fa3 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/SqliteEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/SqliteEamDb.java @@ -22,6 +22,7 @@ import java.io.File; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; +import java.util.Arrays; import java.util.List; import java.util.Set; import java.util.concurrent.locks.ReentrantReadWriteLock; @@ -165,6 +166,7 @@ public class SqliteEamDb extends AbstractSqlEamDb { connectionPool.setMaxIdle(-1); connectionPool.setMaxWaitMillis(1000); connectionPool.setValidationQuery(dbSettings.getValidationQuery()); + connectionPool.setConnectionInitSqls(Arrays.asList("PRAGMA foreign_keys = ON")); } /** diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 489f651e23..5d0237376f 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -153,35 +153,148 @@ public class CentralRepoDatamodelTest extends TestCase { FileUtils.deleteDirectory(testDirectory.toFile()); } catch (EamDbException | CaseActionException | IOException ex) { - //} catch (EamDbException | CaseActionException ex) { + //} catch (EamDbException | CaseActionException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } assertFalse("Error deleting test directory " + testDirectory.toString(), testDirectory.toFile().exists()); } + public void testDataSources() { + final String dataSourceAname = "dataSourceA"; + final String dataSourceAid = "dataSourceA_deviceID"; + CorrelationDataSource dataSourceA; + CorrelationDataSource dataSourceB; + + // Test creating a data source with valid case, name, and ID + try { + dataSourceA = new CorrelationDataSource(case2.getID(), dataSourceAid, dataSourceAname); + EamDb.getInstance().newDataSource(dataSourceA); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test creating a data source with the same case, name, and ID + try { + CorrelationDataSource temp = new CorrelationDataSource(case2.getID(), dataSourceAid, dataSourceAname); + EamDb.getInstance().newDataSource(temp); + Assert.fail("newDataSource did not throw exception from duplicate data source"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test creating a data source with the same name and ID but different case + try { + dataSourceB = new CorrelationDataSource(case1.getID(), dataSourceAid, dataSourceAname); + EamDb.getInstance().newDataSource(dataSourceB); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test creating a data source with an invalid case ID + try { + CorrelationDataSource temp = new CorrelationDataSource(5000, "tempID", "tempName"); + EamDb.getInstance().newDataSource(temp); + Assert.fail("newDataSource did not throw exception from invalid case ID"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test creating a data source with null device ID + try { + CorrelationDataSource temp = new CorrelationDataSource(case2.getID(), null, "tempName"); + EamDb.getInstance().newDataSource(temp); + Assert.fail("newDataSource did not throw exception from null device ID"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test creating a data source with null device ID + try { + CorrelationDataSource temp = new CorrelationDataSource(case2.getID(), "tempID", null); + EamDb.getInstance().newDataSource(temp); + Assert.fail("newDataSource did not throw exception from null name"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting a data source with valid case and ID + try { + CorrelationDataSource temp = EamDb.getInstance().getDataSource(case2, dataSourceAid); + assertTrue("Failed to get data source", temp != null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting a data source with non-existent ID + try { + CorrelationDataSource temp = EamDb.getInstance().getDataSource(case2, "badID"); + assertTrue("getDataSource returned non-null value for non-existent data source", temp == null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting a data source with a null case + try { + CorrelationDataSource temp = EamDb.getInstance().getDataSource(null, dataSourceAid); + Assert.fail("getDataSource did not throw exception from null case"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting a data source with null ID + try { + CorrelationDataSource temp = EamDb.getInstance().getDataSource(case2, null); + assertTrue("getDataSource returned non-null value for null data source", temp == null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting the list of data sources + // There should be three data sources, and we'll check for the expected device IDs + try { + List dataSources = EamDb.getInstance().getDataSources(); + List devIdList + = dataSources.stream().map(c -> c.getDeviceID()).collect(Collectors.toList()); + assertTrue("getDataSources returned unexpected number of data sources", dataSources.size() == 4); + assertTrue("getDataSources is missing expected data sources", + devIdList.contains(dataSourceAid) + && devIdList.contains(dataSource1fromCase1.getDeviceID()) + && devIdList.contains(dataSource2fromCase1.getDeviceID())); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test the data source count + try { + assertTrue("getCountUniqueDataSources returned unexpected number of data sources", + EamDb.getInstance().getCountUniqueDataSources() == 4); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + } + /** * Test method for the methods related to the cases table - * newCase(CorrelationCase eamCase) tests: - * - Test valid data - * - Test null UUID - * - Test null case name - * - Test repeated UUID - * newCase(Case autopsyCase) tests: - * - Test valid data - * - Test null autopsyCase - * updateCase(CorrelationCase eamCase) tests: - * - Test with valid data, checking all fields - * - Test null eamCase - * getCase(Case autopsyCase) tests: - * - Test ?? - * getCaseByUUID(String caseUUID) getCases() - * - Test with UUID that is in the database - * - Test with UUID that is not in the database - * - Test with null UUID - * bulkInsertCases(List cases) - * - Test on a list of cases larger than the bulk insert threshold. - * - Test on a null list + * newCase(CorrelationCase eamCase) tests: - Test valid data - Test null + * UUID - Test null case name - Test repeated UUID newCase(Case autopsyCase) + * tests: - Test valid data - Test null autopsyCase + * updateCase(CorrelationCase eamCase) tests: - Test with valid data, + * checking all fields - Test null eamCase getCase(Case autopsyCase) tests: + * - Test with current Autopsy case getCaseByUUID(String caseUUID) + * getCases() - Test with UUID that is in the database - Test with UUID that + * is not in the database - Test with null UUID + * bulkInsertCases(List cases) - Test on a list of cases + * larger than the bulk insert threshold. - Test on a null list */ public void testCases() { final String caseAname = "caseA"; @@ -301,15 +414,15 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting a case from an Autopsy case try { CorrelationCase tempCase = EamDb.getInstance().getCase(Case.getCurrentCase()); assertTrue("getCase returned null for current Autopsy case", tempCase != null); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - } + } // Test getting a case by UUID try { @@ -376,7 +489,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test bulk case insert with null list try { EamDb.getInstance().bulkInsertCases(null); From fc63d677402da5598a4548fa56576468fa9177ae Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Mon, 29 Jan 2018 12:15:39 -0500 Subject: [PATCH 21/62] Moved interesting file artifact creation logic. --- .../modules/filetypeid/FileTypeDetector.java | 53 +++--------- .../filetypeid/FileTypeIdIngestModule.java | 83 ++++++++++++++++--- 2 files changed, 85 insertions(+), 51 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java index c742110f6b..dafae9a42b 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,22 +19,16 @@ package org.sleuthkit.autopsy.modules.filetypeid; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; -import java.util.logging.Level; import java.util.stream.Collectors; import org.apache.tika.Tika; import org.apache.tika.io.TikaInputStream; import org.apache.tika.mime.MimeTypes; -import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.casemodule.services.Blackboard; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.AbstractFile; -import org.sleuthkit.datamodel.BlackboardArtifact; -import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.ReadContentInputStream; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; @@ -48,8 +42,8 @@ import org.sleuthkit.datamodel.TskData; */ public class FileTypeDetector { - private static final Logger logger = Logger.getLogger(FileTypeDetector.class.getName()); - private static final Tika tika = new Tika(); + private static final Logger LOGGER = Logger.getLogger(FileTypeDetector.class.getName()); + private static final Tika TIKA = new Tika(); private static final int SLACK_FILE_THRESHOLD = 4096; private final List userDefinedFileTypes; private final List autopsyDefinedFileTypes; @@ -227,7 +221,7 @@ public class FileTypeDetector { ReadContentInputStream stream = new ReadContentInputStream(file); try (TikaInputStream tikaInputStream = TikaInputStream.get(stream)) { - String tikaType = tika.detect(tikaInputStream, file.getName()); + String tikaType = TIKA.detect(tikaInputStream, file.getName()); /* * Remove the Tika suffix from the MIME type name. @@ -270,52 +264,29 @@ public class FileTypeDetector { } /** - * Determines whether or not the a file matches a user-defined custom file - * type. If the file matches and corresponds to an interesting files type - * rule, this method has the side effect of creating an interesting files - * hit artifact and indexing that artifact for keyword search. + * Determines whether or not a file matches a user-defined custom file type. * * @param file The file to test. * - * @return The file type name string or null, if no match is detected. - * - * @throws TskCoreException + * @return The MIME type as a string if a match is found; otherwise null. */ private String detectUserDefinedType(AbstractFile file) { + String retValue = null; + for (FileType fileType : userDefinedFileTypes) { if (fileType.matches(file)) { - if (fileType.createInterestingFileHit()) { - try { - BlackboardArtifact artifact; - artifact = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT); - Collection attributes = new ArrayList<>(); - BlackboardAttribute setNameAttribute = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME, FileTypeIdModuleFactory.getModuleName(), fileType.getInterestingFilesSetName()); - attributes.add(setNameAttribute); - BlackboardAttribute ruleNameAttribute = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CATEGORY, FileTypeIdModuleFactory.getModuleName(), fileType.getMimeType()); - attributes.add(ruleNameAttribute); - artifact.addAttributes(attributes); - try { - Case.getCurrentCase().getServices().getBlackboard().indexArtifact(artifact); - } catch (Blackboard.BlackboardException ex) { - logger.log(Level.SEVERE, String.format("Unable to index TSK_INTERESTING_FILE_HIT blackboard artifact %d (file obj_id=%d)", artifact.getArtifactID(), file.getId()), ex); //NON-NLS - } - } catch (TskCoreException ex) { - logger.log(Level.SEVERE, String.format("Unable to create TSK_INTERESTING_FILE_HIT artifact for file (obj_id=%d)", file.getId()), ex); //NON-NLS - } - } - return fileType.getMimeType(); + retValue = fileType.getMimeType(); } } - return null; + return retValue; } /** - * Determines whether or not the a file matches a custom file type defined - * by Autopsy. + * Determines whether or not a file matches a custom file type defined by Autopsy. * * @param file The file to test. * - * @return The file type name string or null, if no match is detected. + * @return The MIME type as a string if a match is found; otherwise null. */ private String detectAutopsyDefinedType(AbstractFile file) { for (FileType fileType : autopsyDefinedFileTypes) { diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index 64650ed0c4..4e1843ccf3 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -1,15 +1,15 @@ /* * Autopsy Forensic Browser - * - * Copyright 2013-2015 Basis Technology Corp. + * + * Copyright 2013-2018 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. @@ -18,9 +18,14 @@ */ package org.sleuthkit.autopsy.modules.filetypeid; +import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; +import java.util.List; import java.util.logging.Level; import org.openide.util.NbBundle; +import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.casemodule.services.Blackboard; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.ingest.FileIngestModule; import org.sleuthkit.autopsy.ingest.IngestJobContext; @@ -29,17 +34,20 @@ import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.autopsy.ingest.IngestModule.ProcessResult; import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter; +import org.sleuthkit.datamodel.BlackboardArtifact; +import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.TskCoreException; /** * Detects the type of a file based on signature (magic) values. Posts results * to the blackboard. */ @NbBundle.Messages({ - "CannotRunFileTypeDetection=Unable to run file type detection." + "CannotRunFileTypeDetection=Unable to run file type detection." }) public class FileTypeIdIngestModule implements FileIngestModule { - private static final Logger logger = Logger.getLogger(FileTypeIdIngestModule.class.getName()); + private static final Logger LOGGER = Logger.getLogger(FileTypeIdIngestModule.class.getName()); private long jobId; private static final HashMap totalsForIngestJobs = new HashMap<>(); private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter(); @@ -59,7 +67,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { try { return new FileTypeDetector().isDetectable(mimeType); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - logger.log(Level.SEVERE, "Failed to create file type detector", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to create file type detector", ex); //NON-NLS return false; } } @@ -91,15 +99,70 @@ public class FileTypeIdIngestModule implements FileIngestModule { */ try { long startTime = System.currentTimeMillis(); - file.setMIMEType(fileTypeDetector.detectMIMEType(file)); + String mimeType = fileTypeDetector.detectMIMEType(file); + file.setMIMEType(mimeType); + FileType fileType = detectUserDefinedFileType(file); + if (fileType != null && fileType.createInterestingFileHit()) { + createInterestingFileHit(file, fileType); + } addToTotals(jobId, (System.currentTimeMillis() - startTime)); return ProcessResult.OK; } catch (Exception e) { - logger.log(Level.WARNING, String.format("Error while attempting to determine file type of file %d", file.getId()), e); //NON-NLS + LOGGER.log(Level.WARNING, String.format("Error while attempting to determine file type of file %d", file.getId()), e); //NON-NLS return ProcessResult.ERROR; } } + /** + * Determines whether or not a file matches a user-defined custom file type. + * + * @param file The file to test. + * + * @return The file type if a match is found; otherwise null. + * + * @throws CustomFileTypesException If there is an issue getting an instance + * of CustomFileTypesManager. + */ + private FileType detectUserDefinedFileType(AbstractFile file) throws CustomFileTypesManager.CustomFileTypesException { + FileType retValue = null; + + CustomFileTypesManager customFileTypesManager = CustomFileTypesManager.getInstance(); + List fileTypesList = customFileTypesManager.getUserDefinedFileTypes(); + for (FileType fileType : fileTypesList) { + if (fileType.matches(file)) { + retValue = fileType; + } + } + + return retValue; + } + + /** + * Create an Interesting File hit using the specified file type rule. + * + * @param file The file from which to generate an artifact. + * @param fileType The file type rule for categorizing the hit. + */ + private void createInterestingFileHit(AbstractFile file, FileType fileType) { + try { + BlackboardArtifact artifact; + artifact = file.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT); + Collection attributes = new ArrayList<>(); + BlackboardAttribute setNameAttribute = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME, FileTypeIdModuleFactory.getModuleName(), fileType.getInterestingFilesSetName()); + attributes.add(setNameAttribute); + BlackboardAttribute ruleNameAttribute = new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CATEGORY, FileTypeIdModuleFactory.getModuleName(), fileType.getMimeType()); + attributes.add(ruleNameAttribute); + artifact.addAttributes(attributes); + try { + Case.getCurrentCase().getServices().getBlackboard().indexArtifact(artifact); + } catch (Blackboard.BlackboardException ex) { + LOGGER.log(Level.SEVERE, String.format("Unable to index TSK_INTERESTING_FILE_HIT blackboard artifact %d (file obj_id=%d)", artifact.getArtifactID(), file.getId()), ex); //NON-NLS + } + } catch (TskCoreException ex) { + LOGGER.log(Level.SEVERE, String.format("Unable to create TSK_INTERESTING_FILE_HIT artifact for file (obj_id=%d)", file.getId()), ex); //NON-NLS + } + } + @Override public void shutDown() { /** From 9c9d85a5029fa04cee893a130337dee66f386dc6 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Mon, 29 Jan 2018 12:21:45 -0500 Subject: [PATCH 22/62] Minor tweaks. --- .../modules/filetypeid/FileTypeDetector.java | 1 + .../filetypeid/FileTypeIdIngestModule.java | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java index dafae9a42b..21f16941ab 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java @@ -276,6 +276,7 @@ public class FileTypeDetector { for (FileType fileType : userDefinedFileTypes) { if (fileType.matches(file)) { retValue = fileType.getMimeType(); + break; } } return retValue; diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index 4e1843ccf3..13c68cd53f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -49,8 +49,8 @@ public class FileTypeIdIngestModule implements FileIngestModule { private static final Logger LOGGER = Logger.getLogger(FileTypeIdIngestModule.class.getName()); private long jobId; - private static final HashMap totalsForIngestJobs = new HashMap<>(); - private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter(); + private static final HashMap INGEST_JOB_TOTALS = new HashMap<>(); + private static final IngestModuleReferenceCounter REF_COUNTER = new IngestModuleReferenceCounter(); private FileTypeDetector fileTypeDetector; /** @@ -82,7 +82,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { @Override public void startUp(IngestJobContext context) throws IngestModuleException { jobId = context.getJobId(); - refCounter.incrementAndGet(jobId); + REF_COUNTER.incrementAndGet(jobId); try { fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { @@ -131,6 +131,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { for (FileType fileType : fileTypesList) { if (fileType.matches(file)) { retValue = fileType; + break; } } @@ -169,10 +170,10 @@ public class FileTypeIdIngestModule implements FileIngestModule { * If this is the instance of this module for this ingest job, post a * summary message to the ingest messages box. */ - if (refCounter.decrementAndGet(jobId) == 0) { + if (REF_COUNTER.decrementAndGet(jobId) == 0) { IngestJobTotals jobTotals; synchronized (this) { - jobTotals = totalsForIngestJobs.remove(jobId); + jobTotals = INGEST_JOB_TOTALS.remove(jobId); } if (jobTotals != null) { StringBuilder detailsSb = new StringBuilder(); @@ -201,15 +202,15 @@ public class FileTypeIdIngestModule implements FileIngestModule { * @param matchTimeInc Amount of time to add. */ private static synchronized void addToTotals(long jobId, long matchTimeInc) { - IngestJobTotals ingestJobTotals = totalsForIngestJobs.get(jobId); + IngestJobTotals ingestJobTotals = INGEST_JOB_TOTALS.get(jobId); if (ingestJobTotals == null) { ingestJobTotals = new IngestJobTotals(); - totalsForIngestJobs.put(jobId, ingestJobTotals); + INGEST_JOB_TOTALS.put(jobId, ingestJobTotals); } ingestJobTotals.matchTime += matchTimeInc; ingestJobTotals.numFiles++; - totalsForIngestJobs.put(jobId, ingestJobTotals); + INGEST_JOB_TOTALS.put(jobId, ingestJobTotals); } private static class IngestJobTotals { From 36766e2d51de10128aee2e27e7d9682eda51f0dc Mon Sep 17 00:00:00 2001 From: "U-BASIS\\zhaohui" Date: Mon, 29 Jan 2018 14:16:08 -0500 Subject: [PATCH 23/62] 3366: Edit Details button should only be visible when Details tab selected. --- .../sleuthkit/autopsy/casemodule/CaseInformationPanel.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index b03a17920e..f0f7326222 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -61,6 +61,11 @@ class CaseInformationPanel extends javax.swing.JPanel { @Override public void stateChanged(ChangeEvent e) { tabbedPane.getSelectedComponent().setSize(tabbedPane.getSelectedComponent().getPreferredSize()); + if (tabbedPane.getSelectedComponent() instanceof CasePropertiesPanel) { + editDetailsButton.setVisible(true); + } else { + editDetailsButton.setVisible(false); + } } }); } From 78cb915b386896d4798dece39b12d3cee26ab0a5 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\zhaohui" Date: Mon, 29 Jan 2018 14:17:48 -0500 Subject: [PATCH 24/62] 3366: Update the copyright to current year. --- .../org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index f0f7326222..2a460d5c46 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); From e502fedd9bc2dffc9b42bc523bf702dfb27c01a4 Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Mon, 29 Jan 2018 14:40:48 -0500 Subject: [PATCH 25/62] Partway through reference set tests --- .../datamodel/AbstractSqlEamDb.java | 24 +- .../datamodel/CentralRepoDatamodelTest.java | 268 +++++++++++++++++- 2 files changed, 288 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index 07937128c1..3003b28a4a 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -1617,6 +1617,18 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public int newReferenceSet(EamGlobalSet eamGlobalSet) throws EamDbException { + if(eamGlobalSet == null){ + throw new EamDbException("EamGlobalSet argument is null"); + } + + if(eamGlobalSet.getFileKnownStatus() == null){ + throw new EamDbException("File known status on the EamGlobalSet is null"); + } + + if(eamGlobalSet.getType() == null){ + throw new EamDbException("Type on the EamGlobalSet is null"); + } + Connection conn = connect(); PreparedStatement preparedStatement1 = null; @@ -1678,8 +1690,11 @@ public abstract class AbstractSqlEamDb implements EamDb { preparedStatement1 = conn.prepareStatement(sql1); preparedStatement1.setInt(1, referenceSetID); resultSet = preparedStatement1.executeQuery(); - resultSet.next(); - return getEamGlobalSetFromResultSet(resultSet); + if(resultSet.next()) { + return getEamGlobalSetFromResultSet(resultSet); + } else { + return null; + } } catch (SQLException ex) { throw new EamDbException("Error getting reference set by id.", ex); // NON-NLS @@ -1701,6 +1716,11 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public List getAllReferenceSets(CorrelationAttribute.Type correlationType) throws EamDbException { + + if(correlationType == null){ + throw new EamDbException("Correlation type is null"); + } + List results = new ArrayList<>(); Connection conn = connect(); diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 5d0237376f..f23421fdb9 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -24,6 +24,7 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.CaseActionException; import org.sleuthkit.autopsy.casemodule.CaseDetails; import org.sleuthkit.autopsy.coreutils.ModuleSettings; +import org.sleuthkit.datamodel.TskData; /** * @@ -150,6 +151,13 @@ public class CentralRepoDatamodelTest extends TestCase { try { EamDb.getInstance().shutdownConnections(); Case.closeCurrentCase(); + + // This seems to help in allowing the Autopsy case to be deleted + try{ + Thread.sleep(2000); + } catch (Exception ex){ + + } FileUtils.deleteDirectory(testDirectory.toFile()); } catch (EamDbException | CaseActionException | IOException ex) { @@ -159,7 +167,263 @@ public class CentralRepoDatamodelTest extends TestCase { } assertFalse("Error deleting test directory " + testDirectory.toString(), testDirectory.toFile().exists()); } - + + /** + * Test method for the methods related to reference sets + */ + public void testReferenceSets() { + String set1name = "referenceSet1"; + String set1version = "1.0"; + EamGlobalSet set1; + int set1id; + String set2name = "referenceSet2"; + EamGlobalSet set2; + int set2id; + EamGlobalSet set3; + int set3id; + + // Store the file type object to save time + CorrelationAttribute.Type fileType; + try{ + fileType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID); + assertTrue("In testReferenceSets, getCorrelationTypeById(FILES_TYPE_ID) returned null", fileType != null); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test creating a notable reference set + try { + set1 = new EamGlobalSet(org1.getOrgID(), set1name, set1version, TskData.FileKnown.BAD, false, fileType); + set1id = EamDb.getInstance().newReferenceSet(set1); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test creating a known reference set + try { + set2 = new EamGlobalSet(org2.getOrgID(), set2name, "", TskData.FileKnown.KNOWN, false, fileType); + set2id = EamDb.getInstance().newReferenceSet(set2); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test creating a reference set with the same name and version + try { + EamGlobalSet temp = new EamGlobalSet(org1.getOrgID(), set1name, "1.0", TskData.FileKnown.BAD, false, fileType); + EamDb.getInstance().newReferenceSet(temp); + Assert.fail("newReferenceSet failed to throw exception from duplicate name/version pair"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test creating a reference set with the same name but different version + try { + set3 = new EamGlobalSet(org1.getOrgID(), set1name, "2.0", TskData.FileKnown.BAD, false, fileType); + set3id = EamDb.getInstance().newReferenceSet(set3); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test creating a reference set with invalid org ID + try { + EamGlobalSet temp = new EamGlobalSet(5000, "tempName", "", TskData.FileKnown.BAD, false, fileType); + EamDb.getInstance().newReferenceSet(temp); + Assert.fail("newReferenceSet failed to throw exception from invalid org ID"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test creating a reference set with null name + try { + EamGlobalSet temp = new EamGlobalSet(org2.getOrgID(), null, "", TskData.FileKnown.BAD, false, fileType); + EamDb.getInstance().newReferenceSet(temp); + Assert.fail("newReferenceSet failed to throw exception from null name"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test creating a reference set with null version + try { + EamGlobalSet temp = new EamGlobalSet(org2.getOrgID(), "tempName", null, TskData.FileKnown.BAD, false, fileType); + EamDb.getInstance().newReferenceSet(temp); + Assert.fail("newReferenceSet failed to throw exception from null version"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test creating a reference set with null file known status + try { + EamGlobalSet temp = new EamGlobalSet(org2.getOrgID(), "tempName", "", null, false, fileType); + EamDb.getInstance().newReferenceSet(temp); + Assert.fail("newReferenceSet failed to throw exception from null file known status"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test creating a reference set with null file type + try { + EamGlobalSet temp = new EamGlobalSet(org2.getOrgID(), "tempName", "", TskData.FileKnown.BAD, false, null); + EamDb.getInstance().newReferenceSet(temp); + Assert.fail("newReferenceSet failed to throw exception from null file type"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test validation with a valid reference set + try { + assertTrue("referenceSetIsValid returned false for valid reference set", EamDb.getInstance().referenceSetIsValid(set1id, set1name, set1version)); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test validation with an invalid reference set + try { + assertFalse("referenceSetIsValid returned true for invalid reference set", EamDb.getInstance().referenceSetIsValid(5000, set1name, set1version)); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test validation with a null name + try { + assertFalse("referenceSetIsValid returned true with null name", EamDb.getInstance().referenceSetIsValid(set1id, null, set1version)); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test validation with a null version + try { + assertFalse("referenceSetIsValid returned true with null version", EamDb.getInstance().referenceSetIsValid(set1id, set1name, null)); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test existence with a valid reference set + try { + assertTrue("referenceSetExists returned false for valid reference set", EamDb.getInstance().referenceSetExists(set1name, set1version)); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test existence with an invalid reference set + try { + assertFalse("referenceSetExists returned true for invalid reference set", EamDb.getInstance().referenceSetExists(set1name, "5.5")); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test existence with null name + try { + assertFalse("referenceSetExists returned true for null name", EamDb.getInstance().referenceSetExists(null, "1.0")); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test existence with null version + try { + assertFalse("referenceSetExists returned true for null version", EamDb.getInstance().referenceSetExists(set1name, null)); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting global set with valid ID + try { + EamGlobalSet temp = EamDb.getInstance().getReferenceSetByID(set1id); + assertTrue("getReferenceSetByID returned null for valid ID", temp != null); + assertTrue("getReferenceSetByID returned set with incorrect name and/or version", + set1name.equals(temp.getSetName()) && set1version.equals(temp.getVersion())); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting global set with invalid ID + try { + EamGlobalSet temp = EamDb.getInstance().getReferenceSetByID(1234); + assertTrue("getReferenceSetByID returned non-null result for invalid ID", temp == null); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting all file reference sets + try { + List referenceSets = EamDb.getInstance().getAllReferenceSets(fileType); + assertTrue("getAllReferenceSets(FILES) returned unexpected number", referenceSets.size() == 3); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting all email reference sets + try { + List referenceSets = EamDb.getInstance().getAllReferenceSets(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.EMAIL_TYPE_ID)); + assertTrue("getAllReferenceSets(EMAIL) returned unexpected number", referenceSets.isEmpty()); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test null argument to getAllReferenceSets + try { + EamDb.getInstance().getAllReferenceSets(null); + Assert.fail("getAllReferenceSets failed to throw exception from null type argument"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test deleting an existing reference set + // First: create a new reference set, check that it's in the database, and get the number of reference sets + // Second: delete the reference set, check that it is no longer in the database, and the total number of sets decreased by one + try { + EamGlobalSet setToDelete = new EamGlobalSet(org1.getOrgID(), "deleteThis", "deleteThisVersion", TskData.FileKnown.BAD, false, fileType); + int setToDeleteID = EamDb.getInstance().newReferenceSet(setToDelete); + assertTrue("setToDelete wasn't found in database", EamDb.getInstance().referenceSetIsValid(setToDeleteID, setToDelete.getSetName(), setToDelete.getVersion())); + int currentCount = EamDb.getInstance().getAllReferenceSets(fileType).size(); + + + + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + } + + /** + * Test method for the methods related to the data sources table + * newDataSource(CorrelationDataSource eamDataSource) tests: + * - Test with valid data + * - Test with duplicate data + * - Test with duplicate device ID and name but different case + * - Test with invalid case ID + * - Test with null device ID + * - Test with null name + * getDataSource(CorrelationCase correlationCase, String dataSourceDeviceId) tests: + * - Test with valid data + * - Test with non-existent data + * - Test with null correlationCase + * - Test with null device ID + * List getDataSources()tests: + * - Test that the count and device IDs are as expected + * Long getCountUniqueDataSources() tests: + * - Test that the result is as expected + */ public void testDataSources() { final String dataSourceAname = "dataSourceA"; final String dataSourceAid = "dataSourceA_deviceID"; @@ -213,7 +477,7 @@ public class CentralRepoDatamodelTest extends TestCase { // This is the expected behavior } - // Test creating a data source with null device ID + // Test creating a data source with null name try { CorrelationDataSource temp = new CorrelationDataSource(case2.getID(), "tempID", null); EamDb.getInstance().newDataSource(temp); From 3f208e1a3b7d27a46a88814e3c8b3adb42222709 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Mon, 29 Jan 2018 16:10:33 -0500 Subject: [PATCH 26/62] Handling multiple files for kws list imports. --- .../GlobalListsManagementPanel.java | 127 +++++++++--------- 1 file changed, 65 insertions(+), 62 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GlobalListsManagementPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GlobalListsManagementPanel.java index aebf606380..6aae71be33 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GlobalListsManagementPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GlobalListsManagementPanel.java @@ -365,81 +365,84 @@ class GlobalListsManagementPanel extends javax.swing.JPanel implements OptionsPa chooser.addChoosableFileFilter(autopsyFilter); chooser.addChoosableFileFilter(encaseFilter); chooser.setAcceptAllFileFilterUsed(false); + chooser.setMultiSelectionEnabled(true); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); String listName = null; int returnVal = chooser.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { - File selFile = chooser.getSelectedFile(); - if (selFile == null) { - return; - } + File[] selFiles = chooser.getSelectedFiles(); - //force append extension if not given - String fileAbs = selFile.getAbsolutePath(); - - final KeywordSearchList reader; - - if (KeywordSearchUtil.isXMLList(fileAbs)) { - reader = new XmlKeywordSearchList(fileAbs); - } else { - reader = new EnCaseKeywordSearchList(fileAbs); - } - - if (!reader.load()) { - KeywordSearchUtil.displayDialog( - NbBundle.getMessage(this.getClass(), "KeywordSearch.listImportFeatureTitle"), NbBundle.getMessage(this.getClass(), "KeywordSearch.importListFileDialogMsg", fileAbs), KeywordSearchUtil.DIALOG_MESSAGE_TYPE.ERROR); - return; - } - - List toImport = reader.getListsL(); - List toImportConfirmed = new ArrayList<>(); - - final XmlKeywordSearchList writer = XmlKeywordSearchList.getCurrent(); - - for (KeywordList list : toImport) { - //check name collisions - listName = list.getName(); - if (writer.listExists(listName)) { - String[] options; - if (toImport.size() == 1) { //only give them cancel and yes buttons for single list imports - options = new String[]{NbBundle.getMessage(this.getClass(), "KeywordSearch.yesOwMsg"), - NbBundle.getMessage(this.getClass(), "KeywordSearch.cancelImportMsg")}; - } else { - options = new String[]{NbBundle.getMessage(this.getClass(), "KeywordSearch.yesOwMsg"), - NbBundle.getMessage(this.getClass(), "KeywordSearch.noSkipMsg"), - NbBundle.getMessage(this.getClass(), "KeywordSearch.cancelImportMsg")}; - } - int choice = JOptionPane.showOptionDialog(this, - NbBundle.getMessage(this.getClass(), "KeywordSearch.overwriteListPrompt", listName), - NbBundle.getMessage(this.getClass(), "KeywordSearch.importOwConflict"), - JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, - null, - options, - options[0]); - if (choice == JOptionPane.OK_OPTION) { - toImportConfirmed.add(list); - } else if (choice == JOptionPane.CANCEL_OPTION) { - break; - } + for (File file : selFiles) { + if (file == null) { + continue; + } + + //force append extension if not given + String fileAbs = file.getAbsolutePath(); + final KeywordSearchList reader; + if (KeywordSearchUtil.isXMLList(fileAbs)) { + reader = new XmlKeywordSearchList(fileAbs); } else { - //no conflict - toImportConfirmed.add(list); + reader = new EnCaseKeywordSearchList(fileAbs); } - } + if (!reader.load()) { + KeywordSearchUtil.displayDialog( + NbBundle.getMessage(this.getClass(), "KeywordSearch.listImportFeatureTitle"), NbBundle.getMessage(this.getClass(), "KeywordSearch.importListFileDialogMsg", fileAbs), KeywordSearchUtil.DIALOG_MESSAGE_TYPE.ERROR); + return; + } - if (toImportConfirmed.isEmpty()) { - return; - } + List toImport = reader.getListsL(); + List toImportConfirmed = new ArrayList<>(); - if (!writer.writeLists(toImportConfirmed)) { - KeywordSearchUtil.displayDialog( - NbBundle.getMessage(this.getClass(), "KeywordSearch.listImportFeatureTitle"), NbBundle.getMessage(this.getClass(), "KeywordSearch.kwListFailImportMsg"), KeywordSearchUtil.DIALOG_MESSAGE_TYPE.INFO); + final XmlKeywordSearchList writer = XmlKeywordSearchList.getCurrent(); + + for (KeywordList list : toImport) { + //check name collisions + listName = list.getName(); + if (writer.listExists(listName)) { + String[] options; + if (toImport.size() == 1) { //only give them cancel and yes buttons for single list imports + options = new String[]{NbBundle.getMessage(this.getClass(), "KeywordSearch.yesOwMsg"), + NbBundle.getMessage(this.getClass(), "KeywordSearch.cancelImportMsg")}; + } else { + options = new String[]{NbBundle.getMessage(this.getClass(), "KeywordSearch.yesOwMsg"), + NbBundle.getMessage(this.getClass(), "KeywordSearch.noSkipMsg"), + NbBundle.getMessage(this.getClass(), "KeywordSearch.cancelImportMsg")}; + } + int choice = JOptionPane.showOptionDialog(this, + NbBundle.getMessage(this.getClass(), "KeywordSearch.overwriteListPrompt", listName), + NbBundle.getMessage(this.getClass(), "KeywordSearch.importOwConflict"), + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, + null, + options, + options[0]); + if (choice == JOptionPane.OK_OPTION) { + toImportConfirmed.add(list); + } else if (choice == JOptionPane.CANCEL_OPTION) { + break; + } + + } else { + //no conflict + toImportConfirmed.add(list); + } + + } + + if (toImportConfirmed.isEmpty()) { + return; + } + + if (!writer.writeLists(toImportConfirmed)) { + KeywordSearchUtil.displayDialog( + NbBundle.getMessage(this.getClass(), "KeywordSearch.listImportFeatureTitle"), NbBundle.getMessage(this.getClass(), "KeywordSearch.kwListFailImportMsg"), KeywordSearchUtil.DIALOG_MESSAGE_TYPE.INFO); + } + ModuleSettings.setConfigSetting(ModuleSettings.MAIN_SETTINGS, LAST_KEYWORD_LIST_PATH_KEY, file.getParent()); } - ModuleSettings.setConfigSetting(ModuleSettings.MAIN_SETTINGS, LAST_KEYWORD_LIST_PATH_KEY, selFile.getParent()); } tableModel.resync(); From 338334f62936c2d3ea30979d7076f5b39388d2cc Mon Sep 17 00:00:00 2001 From: Raman Date: Tue, 30 Jan 2018 09:50:25 -0500 Subject: [PATCH 27/62] 3415: Show SQLite table contents Resize columns based on data from top 20 rows --- .../contentviewers/SQLiteTableView.java | 59 +++++++++++++++---- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java index ad1117f0a0..7ca873e13c 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteTableView.java @@ -19,6 +19,7 @@ package org.sleuthkit.autopsy.contentviewers; import java.awt.BorderLayout; +import java.awt.Component; import java.util.List; import java.util.Map; import java.util.Objects; @@ -26,6 +27,8 @@ import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.ScrollPaneConstants; +import javax.swing.SwingWorker; +import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumnModel; import org.netbeans.swing.etable.ETableColumn; import org.netbeans.swing.etable.ETableColumnModel; @@ -70,18 +73,14 @@ class SQLiteTableView extends JPanel implements ExplorerManager.Provider { */ void setupTable(List> tableRows) { - explorerManager.setRootContext(new AbstractNode(Children.create(new SQLiteTableRowFactory(tableRows), true))); - + if (Objects.isNull(tableRows) || tableRows.isEmpty()) { outlineView.setPropertyColumns(); -// return; } else { + // Set up the column names Map row = tableRows.get(0); - - // Get the columns setup with respect to names and sortability String[] propStrings = new String[row.size() * 2]; - int i = 0; for (Map.Entry col : row.entrySet()) { String colName = col.getKey(); @@ -93,19 +92,55 @@ class SQLiteTableView extends JPanel implements ExplorerManager.Provider { outlineView.setPropertyColumns(propStrings); } - // TBD: Set width based on actual data in the top N rows?? - // TBD: Can't seem to get the horizontal scrollbar working - for (int col = 0; col< outline.getModel().getColumnCount(); col++) { - outline.getColumnModel().getColumn(col).setMinWidth(50); - } - // Hide the 'Nodes' column TableColumnModel columnModel = outline.getColumnModel(); ETableColumn column = (ETableColumn) columnModel.getColumn(0); ((ETableColumnModel) columnModel).setColumnHidden(column, true); + // Set the Nodes for the ExplorerManager. + // The Swingworker ensures that setColumnWidths() is called after all nodes have been created. + new SwingWorker() { + @Override + protected Boolean doInBackground() throws Exception { + + explorerManager.setRootContext(new AbstractNode(Children.create(new SQLiteTableRowFactory(tableRows), true))); + return false; + } + + @Override + protected void done() { + super.done(); + + setColumnWidths(); + } + }.execute(); + } + private void setColumnWidths() { + int margin = 4; + int padding = 8; + + // find the maximum width needed to fit the values for the first N rows, at most + final int rows = Math.min(20, outline.getRowCount()); + for (int col = 1; col < outline.getColumnCount(); col++) { + int columnWidthLimit = 500; + int columnWidth = 50; + + for (int row = 0; row < rows; row++) { + TableCellRenderer renderer = outline.getCellRenderer(row, col); + Component comp = outline.prepareRenderer(renderer, row, col); + + columnWidth = Math.max(comp.getPreferredSize().width, columnWidth); + } + + columnWidth += 2 * margin + padding; // add margin and regular padding + columnWidth = Math.min(columnWidth, columnWidthLimit); + outline.getColumnModel().getColumn(col).setPreferredWidth(columnWidth); + } + } + + /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always From 196a13ddb37ce453bc9a325143f9681914267366 Mon Sep 17 00:00:00 2001 From: rishwanth Date: Tue, 30 Jan 2018 12:10:55 -0500 Subject: [PATCH 28/62] removed xdock jvm.option for linux and window build --- build.xml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/build.xml b/build.xml index 4eaa7df1c8..d044f68f06 100644 --- a/build.xml +++ b/build.xml @@ -32,7 +32,10 @@ - + + + + @@ -82,7 +85,13 @@ - + + + + + + + @@ -91,8 +100,17 @@ + - + + + + + + + + + From 8bd4317f94b35a7bb9ec83d2fb8461cd5ed19a38 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Tue, 30 Jan 2018 16:57:01 -0500 Subject: [PATCH 29/62] Add NamedThreadFactory to ThreadUtils --- .../autopsy/coreutils/ThreadUtils.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ThreadUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/ThreadUtils.java index b9873469e7..8a354a531a 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ThreadUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ThreadUtils.java @@ -19,6 +19,7 @@ package org.sleuthkit.autopsy.coreutils; import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; /* @@ -50,6 +51,35 @@ final public class ThreadUtils { } } + /** + * A thread factory that allows for the creation of distinctly named task + * threads by an ExecutorService constructed using an Executors factory + * method. Each thread created using the factory will be named using the + * thread name and a numerical suffix. + */ + public static class NamedThreadFactory implements ThreadFactory { + + private final String threadName; + + /** + * Contructs a thread factory that allows for the creation of distinctly + * named task threads by an ExecutorService constructed using an + * Executors factory method. Each thread created using the factory will + * be named using the thread name and a numerical suffix. + * + * @param threadName The name of the threads. + */ + public NamedThreadFactory(String threadName) { + this.threadName = threadName; + } + + @Override + public Thread newThread(Runnable task) { + return new Thread(task, threadName); + } + + } + private ThreadUtils() { } } From 52cd06a1147d5aed1dec1b6a8b06d429917e0d5e Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Tue, 30 Jan 2018 17:23:48 -0500 Subject: [PATCH 30/62] Revert "Add NamedThreadFactory to ThreadUtils" This reverts commit 8bd4317f94b35a7bb9ec83d2fb8461cd5ed19a38. --- .../autopsy/coreutils/ThreadUtils.java | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ThreadUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/ThreadUtils.java index 8a354a531a..b9873469e7 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ThreadUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ThreadUtils.java @@ -19,7 +19,6 @@ package org.sleuthkit.autopsy.coreutils; import java.util.concurrent.ExecutorService; -import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; /* @@ -51,35 +50,6 @@ final public class ThreadUtils { } } - /** - * A thread factory that allows for the creation of distinctly named task - * threads by an ExecutorService constructed using an Executors factory - * method. Each thread created using the factory will be named using the - * thread name and a numerical suffix. - */ - public static class NamedThreadFactory implements ThreadFactory { - - private final String threadName; - - /** - * Contructs a thread factory that allows for the creation of distinctly - * named task threads by an ExecutorService constructed using an - * Executors factory method. Each thread created using the factory will - * be named using the thread name and a numerical suffix. - * - * @param threadName The name of the threads. - */ - public NamedThreadFactory(String threadName) { - this.threadName = threadName; - } - - @Override - public Thread newThread(Runnable task) { - return new Thread(task, threadName); - } - - } - private ThreadUtils() { } } From 23c5e5be62195f448294cb7e25a4b7f2c283ec2c Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Wed, 31 Jan 2018 08:48:04 -0500 Subject: [PATCH 31/62] Finished reference set tests --- .../datamodel/AbstractSqlEamDb.java | 3 + .../datamodel/CentralRepoDatamodelTest.java | 489 ++++++++++-------- 2 files changed, 284 insertions(+), 208 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index 3003b28a4a..48a7f34a6e 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -1541,6 +1541,9 @@ public abstract class AbstractSqlEamDb implements EamDb { public EamOrganization getReferenceSetOrganization(int referenceSetID) throws EamDbException { EamGlobalSet globalSet = getReferenceSetByID(referenceSetID); + if(globalSet == null) { + throw new EamDbException("Reference set with ID " + referenceSetID + " not found"); + } return (getOrganizationByID(globalSet.getOrgID())); } diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index f23421fdb9..2aafcf0679 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -71,16 +71,7 @@ public class CentralRepoDatamodelTest extends TestCase { assertTrue("Unable to create test directory", testDirectory.toFile().exists()); // Save the current central repo settings - propertiesMap = ModuleSettings.getConfigSettings(PROPERTIES_FILE); - - // Set up an Autopsy case for testing - try { - Case.createAsCurrentCase(Case.CaseType.SINGLE_USER_CASE, testDirectory.toString(), new CaseDetails("CentralRepoDatamodelTestCase")); - } catch (CaseActionException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - assertTrue("Failed to create test case", testDirectory.toFile().exists()); + propertiesMap = ModuleSettings.getConfigSettings(PROPERTIES_FILE); try { dbSettingsSqlite.setDbName(CR_DB_NAME); @@ -150,14 +141,8 @@ public class CentralRepoDatamodelTest extends TestCase { // Close and delete the test case and central repo db try { EamDb.getInstance().shutdownConnections(); - Case.closeCurrentCase(); - - // This seems to help in allowing the Autopsy case to be deleted - try{ - Thread.sleep(2000); - } catch (Exception ex){ - - } + Case.closeCurrentCase(); // There shouldn't be a case open, but it's fine to call this anyway + FileUtils.deleteDirectory(testDirectory.toFile()); } catch (EamDbException | CaseActionException | IOException ex) { @@ -169,7 +154,40 @@ public class CentralRepoDatamodelTest extends TestCase { } /** - * Test method for the methods related to reference sets + * Test method for the methods related to reference sets (does not include instance testing) + * newReferenceSet(EamGlobalSet eamGlobalSet) tests: + * - Test creating notable reference set + * - Test creating known reference set + * - Test creating duplicate reference set + * - Test creating almost duplicate reference set + * - Test with invalid org ID + * - Test with null name + * - Test with null version + * - Test with null known status + * - Test with null file type + * referenceSetIsValid(int referenceSetID, String referenceSetName, String version) tests: + * - Test on existing reference set + * - Test on invalid reference set + * - Test with null name + * - Test with null version + * referenceSetExists(String referenceSetName, String version) tests: + * - Test on existing reference set + * - Test on invalid reference set + * - Test with null name + * - Test with null version + * getReferenceSetByID(int globalSetID) tests: + * - Test with valid ID + * - Test with invalid ID + * getAllReferenceSets(CorrelationAttribute.Type correlationType) tests: + * - Test getting all file sets + * - Test getting all email sets + * - Test with null type parameter + * deleteReferenceSet(int referenceSetID) tests: + * - Test on valid reference set ID + * - Test on invalid reference set ID + * getReferenceSetOrganization(int referenceSetID) tests: + * - Test on valid reference set ID + * - Test on invalid reference set ID */ public void testReferenceSets() { String set1name = "referenceSet1"; @@ -396,13 +414,44 @@ public class CentralRepoDatamodelTest extends TestCase { assertTrue("setToDelete wasn't found in database", EamDb.getInstance().referenceSetIsValid(setToDeleteID, setToDelete.getSetName(), setToDelete.getVersion())); int currentCount = EamDb.getInstance().getAllReferenceSets(fileType).size(); - + EamDb.getInstance().deleteReferenceSet(setToDeleteID); + assertFalse("Deleted reference set was found in database", EamDb.getInstance().referenceSetIsValid(setToDeleteID, setToDelete.getSetName(), setToDelete.getVersion())); + assertTrue("Unexpected number of reference sets in database after deletion", currentCount - 1 == EamDb.getInstance().getAllReferenceSets(fileType).size()); } catch (EamDbException ex){ Exceptions.printStackTrace(ex); Assert.fail(ex); } + // Test deleting a non-existent reference set + // The expectation is that nothing will happen + try { + int currentCount = EamDb.getInstance().getAllReferenceSets(fileType).size(); + EamDb.getInstance().deleteReferenceSet(1234); + assertTrue("Number of reference sets changed after deleting non-existent set", currentCount == EamDb.getInstance().getAllReferenceSets(fileType).size()); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting reference set organization for valid ID with org set + try { + EamOrganization org = EamDb.getInstance().getReferenceSetOrganization(set1id); + assertTrue("getReferenceSetOrganization returned null for valid set", org != null); + assertTrue("getReferenceSetOrganization returned the incorrect organization", org.getOrgID() == org1.getOrgID()); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting reference set organization for non-existent reference set + try { + EamOrganization org = EamDb.getInstance().getReferenceSetOrganization(4567); + Assert.fail("getReferenceSetOrganization failed to throw exception for invalid reference set ID"); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } } /** @@ -565,201 +614,225 @@ public class CentralRepoDatamodelTest extends TestCase { final String caseAuuid = "caseA_uuid"; CorrelationCase caseA; CorrelationCase caseB; - - // Test creating a case with valid name and uuid + try { - caseA = new CorrelationCase(caseAuuid, caseAname); - caseA = EamDb.getInstance().newCase(caseA); - assertTrue("Failed to create case", caseA != null); - } catch (EamDbException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - return; - } + // Set up an Autopsy case for testing + try { + Case.createAsCurrentCase(Case.CaseType.SINGLE_USER_CASE, testDirectory.toString(), new CaseDetails("CentralRepoDatamodelTestCase")); + } catch (CaseActionException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + assertTrue("Failed to create test case", testDirectory.toFile().exists()); - // Test null uuid - try { - CorrelationCase tempCase = new CorrelationCase(null, "nullUuidCase"); - tempCase = EamDb.getInstance().newCase(tempCase); - Assert.fail("newCase did not throw expected exception from null uuid"); - } catch (EamDbException ex) { - // This is the expected behavior - } - - // Test null name - try { - CorrelationCase tempCase = new CorrelationCase("nullCaseUuid", null); - tempCase = EamDb.getInstance().newCase(tempCase); - Assert.fail("newCase did not throw expected exception from null name"); - } catch (EamDbException ex) { - // This is the expected behavior - } - - // Test creating a case with an already used UUID - // This should just return the existing case object. Check that the total - // number of cases does not increase. - try { - int nCases = EamDb.getInstance().getCases().size(); - CorrelationCase tempCase = new CorrelationCase(caseAuuid, "newCaseWithSameUUID"); - tempCase = EamDb.getInstance().newCase(tempCase); - assertTrue("newCase returned null for existing UUID", tempCase != null); - assertTrue("newCase created a new case for an already existing UUID", nCases == EamDb.getInstance().getCases().size()); - } catch (EamDbException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - - // Test creating a case from an Autopsy case - // The case may already be in the database - the result is the same either way - try { - caseB = EamDb.getInstance().newCase(Case.getCurrentCase()); - assertTrue("Failed to create correlation case from Autopsy case", caseB != null); - } catch (EamDbException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - return; - } - - // Test null Autopsy case - try { - Case nullCase = null; - CorrelationCase tempCase = EamDb.getInstance().newCase(nullCase); - Assert.fail("newCase did not throw expected exception from null case"); - } catch (EamDbException ex) { - // This is the expected behavior - } - - // Test update case - // Will update the fields of an existing case object, save it, and then - // pull a new copy out of the database - try { - assertTrue(caseA != null); - String caseNumber = "12-34-56"; - String creationDate = "01/12/2018"; - String displayName = "Test Case"; - String examinerEmail = "john@sample.com"; - String examinerName = "John Doe"; - String examinerPhone = "123-555-4567"; - String notes = "Notes"; - - caseA.setCaseNumber(caseNumber); - caseA.setCreationDate(creationDate); - caseA.setDisplayName(displayName); - caseA.setExaminerEmail(examinerEmail); - caseA.setExaminerName(examinerName); - caseA.setExaminerPhone(examinerPhone); - caseA.setNotes(notes); - caseA.setOrg(org1); - - EamDb.getInstance().updateCase(caseA); - - // Retrievex a new copy of the case from the database to check that the - // fields were properly updated - CorrelationCase updatedCase = EamDb.getInstance().getCaseByUUID(caseA.getCaseUUID()); - - assertTrue("updateCase failed to update case number", caseNumber.equals(updatedCase.getCaseNumber())); - assertTrue("updateCase failed to update creation date", creationDate.equals(updatedCase.getCreationDate())); - assertTrue("updateCase failed to update display name", displayName.equals(updatedCase.getDisplayName())); - assertTrue("updateCase failed to update examiner email", examinerEmail.equals(updatedCase.getExaminerEmail())); - assertTrue("updateCase failed to update examiner name", examinerName.equals(updatedCase.getExaminerName())); - assertTrue("updateCase failed to update examiner phone number", examinerPhone.equals(updatedCase.getExaminerPhone())); - assertTrue("updateCase failed to update notes", notes.equals(updatedCase.getNotes())); - assertTrue("updateCase failed to update org (org is null)", updatedCase.getOrg() != null); - assertTrue("updateCase failed to update org (org ID is wrong)", org1.getOrgID() == updatedCase.getOrg().getOrgID()); - } catch (EamDbException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - - // Test update case with null case - try { - EamDb.getInstance().updateCase(null); - Assert.fail("updateCase did not throw expected exception from null case"); - } catch (EamDbException ex) { - // This is the expected behavior - } - - // Test getting a case from an Autopsy case - try { - CorrelationCase tempCase = EamDb.getInstance().getCase(Case.getCurrentCase()); - assertTrue("getCase returned null for current Autopsy case", tempCase != null); - } catch (EamDbException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - - // Test getting a case by UUID - try { - CorrelationCase tempCase = EamDb.getInstance().getCaseByUUID(caseAuuid); - assertTrue("Failed to get case by UUID", tempCase != null); - } catch (EamDbException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - - // Test getting a case with a non-existent UUID - try { - CorrelationCase tempCase = EamDb.getInstance().getCaseByUUID("badUUID"); - assertTrue("getCaseByUUID returned non-null case for non-existent UUID", tempCase == null); - } catch (EamDbException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - - // Test getting a case with null UUID - try { - CorrelationCase tempCase = EamDb.getInstance().getCaseByUUID(null); - assertTrue("getCaseByUUID returned non-null case for null UUID", tempCase == null); - } catch (EamDbException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - - // Test getting the list of cases - // The test is to make sure the three cases we know are in the database are in the list - try { - List caseList = EamDb.getInstance().getCases(); - List uuidList - = caseList.stream().map(c -> c.getCaseUUID()).collect(Collectors.toList()); - assertTrue("getCases is missing data for existing cases", uuidList.contains(case1.getCaseUUID()) - && uuidList.contains(case2.getCaseUUID()) && (uuidList.contains(caseA.getCaseUUID())) - && uuidList.contains(caseB.getCaseUUID())); - } catch (EamDbException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } - - // Test bulk case insert - try { - // Create a list of correlation cases. Make enough that the bulk threshold should be hit once. - List cases = new ArrayList<>(); - String bulkTestUuid = "bulkTestUUID_"; - String bulkTestName = "bulkTestName_"; - for (int i = 0; i < dbSettingsSqlite.getBulkThreshold() * 1.5; i++) { - String name = bulkTestUuid + String.valueOf(i); - String uuid = bulkTestName + String.valueOf(i); - cases.add(new CorrelationCase(uuid, name)); + // Test creating a case with valid name and uuid + try { + caseA = new CorrelationCase(caseAuuid, caseAname); + caseA = EamDb.getInstance().newCase(caseA); + assertTrue("Failed to create case", caseA != null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; } - // Get the current case count - int nCases = EamDb.getInstance().getCases().size(); + // Test null uuid + try { + CorrelationCase tempCase = new CorrelationCase(null, "nullUuidCase"); + tempCase = EamDb.getInstance().newCase(tempCase); + Assert.fail("newCase did not throw expected exception from null uuid"); + } catch (EamDbException ex) { + // This is the expected behavior + } - // Insert the big list of cases - EamDb.getInstance().bulkInsertCases(cases); + // Test null name + try { + CorrelationCase tempCase = new CorrelationCase("nullCaseUuid", null); + tempCase = EamDb.getInstance().newCase(tempCase); + Assert.fail("newCase did not throw expected exception from null name"); + } catch (EamDbException ex) { + // This is the expected behavior + } - // Check that the case count is what is expected - assertTrue("bulkInsertCases did not insert the expected number of cases", nCases + cases.size() == EamDb.getInstance().getCases().size()); - } catch (EamDbException ex) { - Exceptions.printStackTrace(ex); - Assert.fail(ex); - } + // Test creating a case with an already used UUID + // This should just return the existing case object. Check that the total + // number of cases does not increase. + try { + int nCases = EamDb.getInstance().getCases().size(); + CorrelationCase tempCase = new CorrelationCase(caseAuuid, "newCaseWithSameUUID"); + tempCase = EamDb.getInstance().newCase(tempCase); + assertTrue("newCase returned null for existing UUID", tempCase != null); + assertTrue("newCase created a new case for an already existing UUID", nCases == EamDb.getInstance().getCases().size()); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } - // Test bulk case insert with null list - try { - EamDb.getInstance().bulkInsertCases(null); - Assert.fail("bulkInsertCases did not throw expected exception from null list"); - } catch (EamDbException ex) { - // This is the expected behavior + // Test creating a case from an Autopsy case + // The case may already be in the database - the result is the same either way + try { + caseB = EamDb.getInstance().newCase(Case.getCurrentCase()); + assertTrue("Failed to create correlation case from Autopsy case", caseB != null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test null Autopsy case + try { + Case nullCase = null; + CorrelationCase tempCase = EamDb.getInstance().newCase(nullCase); + Assert.fail("newCase did not throw expected exception from null case"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test update case + // Will update the fields of an existing case object, save it, and then + // pull a new copy out of the database + try { + assertTrue(caseA != null); + String caseNumber = "12-34-56"; + String creationDate = "01/12/2018"; + String displayName = "Test Case"; + String examinerEmail = "john@sample.com"; + String examinerName = "John Doe"; + String examinerPhone = "123-555-4567"; + String notes = "Notes"; + + caseA.setCaseNumber(caseNumber); + caseA.setCreationDate(creationDate); + caseA.setDisplayName(displayName); + caseA.setExaminerEmail(examinerEmail); + caseA.setExaminerName(examinerName); + caseA.setExaminerPhone(examinerPhone); + caseA.setNotes(notes); + caseA.setOrg(org1); + + EamDb.getInstance().updateCase(caseA); + + // Retrievex a new copy of the case from the database to check that the + // fields were properly updated + CorrelationCase updatedCase = EamDb.getInstance().getCaseByUUID(caseA.getCaseUUID()); + + assertTrue("updateCase failed to update case number", caseNumber.equals(updatedCase.getCaseNumber())); + assertTrue("updateCase failed to update creation date", creationDate.equals(updatedCase.getCreationDate())); + assertTrue("updateCase failed to update display name", displayName.equals(updatedCase.getDisplayName())); + assertTrue("updateCase failed to update examiner email", examinerEmail.equals(updatedCase.getExaminerEmail())); + assertTrue("updateCase failed to update examiner name", examinerName.equals(updatedCase.getExaminerName())); + assertTrue("updateCase failed to update examiner phone number", examinerPhone.equals(updatedCase.getExaminerPhone())); + assertTrue("updateCase failed to update notes", notes.equals(updatedCase.getNotes())); + assertTrue("updateCase failed to update org (org is null)", updatedCase.getOrg() != null); + assertTrue("updateCase failed to update org (org ID is wrong)", org1.getOrgID() == updatedCase.getOrg().getOrgID()); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test update case with null case + try { + EamDb.getInstance().updateCase(null); + Assert.fail("updateCase did not throw expected exception from null case"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting a case from an Autopsy case + try { + CorrelationCase tempCase = EamDb.getInstance().getCase(Case.getCurrentCase()); + assertTrue("getCase returned null for current Autopsy case", tempCase != null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting a case by UUID + try { + CorrelationCase tempCase = EamDb.getInstance().getCaseByUUID(caseAuuid); + assertTrue("Failed to get case by UUID", tempCase != null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting a case with a non-existent UUID + try { + CorrelationCase tempCase = EamDb.getInstance().getCaseByUUID("badUUID"); + assertTrue("getCaseByUUID returned non-null case for non-existent UUID", tempCase == null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting a case with null UUID + try { + CorrelationCase tempCase = EamDb.getInstance().getCaseByUUID(null); + assertTrue("getCaseByUUID returned non-null case for null UUID", tempCase == null); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting the list of cases + // The test is to make sure the three cases we know are in the database are in the list + try { + List caseList = EamDb.getInstance().getCases(); + List uuidList + = caseList.stream().map(c -> c.getCaseUUID()).collect(Collectors.toList()); + assertTrue("getCases is missing data for existing cases", uuidList.contains(case1.getCaseUUID()) + && uuidList.contains(case2.getCaseUUID()) && (uuidList.contains(caseA.getCaseUUID())) + && uuidList.contains(caseB.getCaseUUID())); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test bulk case insert + try { + // Create a list of correlation cases. Make enough that the bulk threshold should be hit once. + List cases = new ArrayList<>(); + String bulkTestUuid = "bulkTestUUID_"; + String bulkTestName = "bulkTestName_"; + for (int i = 0; i < dbSettingsSqlite.getBulkThreshold() * 1.5; i++) { + String name = bulkTestUuid + String.valueOf(i); + String uuid = bulkTestName + String.valueOf(i); + cases.add(new CorrelationCase(uuid, name)); + } + + // Get the current case count + int nCases = EamDb.getInstance().getCases().size(); + + // Insert the big list of cases + EamDb.getInstance().bulkInsertCases(cases); + + // Check that the case count is what is expected + assertTrue("bulkInsertCases did not insert the expected number of cases", nCases + cases.size() == EamDb.getInstance().getCases().size()); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test bulk case insert with null list + try { + EamDb.getInstance().bulkInsertCases(null); + Assert.fail("bulkInsertCases did not throw expected exception from null list"); + } catch (EamDbException ex) { + // This is the expected behavior + } + } finally { + try { + Case.closeCurrentCase(); + // This seems to help in allowing the Autopsy case to be deleted + try{ + Thread.sleep(2000); + } catch (Exception ex){ + + } + } catch (CaseActionException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } } } From 6e35b3d2142cff098615630e2e725c8b8ca2c69f Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Wed, 31 Jan 2018 13:42:35 -0500 Subject: [PATCH 32/62] Finished reference set testing --- .../datamodel/AbstractSqlEamDb.java | 29 +- .../datamodel/EamGlobalFileInstance.java | 15 +- .../modules/hashdatabase/HashDbManager.java | 13 +- .../datamodel/CentralRepoDatamodelTest.java | 396 +++++++++++++++++- 4 files changed, 426 insertions(+), 27 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index 48a7f34a6e..e3b61fbece 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -1394,6 +1394,9 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public boolean isArtifactKnownBadByReference(CorrelationAttribute.Type aType, String value) throws EamDbException { + if(aType == null) { + throw new EamDbException("null correlation type"); + } // TEMP: Only support file correlation type if (aType.getId() != CorrelationAttribute.FILES_TYPE_ID) { @@ -1758,6 +1761,13 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttribute.Type correlationType) throws EamDbException { + if(eamGlobalFileInstance.getKnownStatus() == null){ + throw new EamDbException("known status of EamGlobalFileInstance is null"); + } + if(correlationType == null){ + throw new EamDbException("Correlation type is null"); + } + Connection conn = connect(); PreparedStatement preparedStatement = null; @@ -1821,6 +1831,13 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public void bulkInsertReferenceTypeEntries(Set globalInstances, CorrelationAttribute.Type contentType) throws EamDbException { + if(contentType == null) { + throw new EamDbException("Null correlation type"); + } + if(globalInstances == null) { + throw new EamDbException("Null set of EamGlobalFileInstance"); + } + Connection conn = connect(); PreparedStatement bulkPs = null; @@ -1834,6 +1851,10 @@ public abstract class AbstractSqlEamDb implements EamDb { bulkPs = conn.prepareStatement(String.format(sql, EamDbUtil.correlationTypeToReferenceTableName(contentType))); for (EamGlobalFileInstance globalInstance : globalInstances) { + if(globalInstance.getKnownStatus() == null){ + throw new EamDbException("EamGlobalFileInstance with value " + globalInstance.getMD5Hash() + " has null known status"); + } + bulkPs.setInt(1, globalInstance.getGlobalSetID()); bulkPs.setString(2, globalInstance.getMD5Hash()); bulkPs.setByte(3, globalInstance.getKnownStatus().getFileKnownValue()); @@ -1843,7 +1864,7 @@ public abstract class AbstractSqlEamDb implements EamDb { bulkPs.executeBatch(); conn.commit(); - } catch (SQLException ex) { + } catch (SQLException | EamDbException ex) { try { conn.rollback(); } catch (SQLException ex2) { @@ -1868,6 +1889,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public List getReferenceInstancesByTypeValue(CorrelationAttribute.Type aType, String aValue) throws EamDbException { + if(aType == null) { + throw new EamDbException("correlation type is null"); + } + Connection conn = connect(); List globalFileInstances = new ArrayList<>(); @@ -2251,7 +2276,7 @@ public abstract class AbstractSqlEamDb implements EamDb { return eamGlobalSet; } - private EamGlobalFileInstance getEamGlobalFileInstanceFromResultSet(ResultSet resultSet) throws SQLException { + private EamGlobalFileInstance getEamGlobalFileInstanceFromResultSet(ResultSet resultSet) throws SQLException, EamDbException { if (null == resultSet) { return null; } diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamGlobalFileInstance.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamGlobalFileInstance.java index 87d974f353..3c538e67c8 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamGlobalFileInstance.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamGlobalFileInstance.java @@ -36,7 +36,7 @@ public class EamGlobalFileInstance { int globalSetID, String MD5Hash, TskData.FileKnown knownStatus, - String comment) { + String comment) throws EamDbException { this(-1, globalSetID, MD5Hash, knownStatus, comment); } @@ -45,7 +45,13 @@ public class EamGlobalFileInstance { int globalSetID, String MD5Hash, TskData.FileKnown knownStatus, - String comment) { + String comment) throws EamDbException { + if(MD5Hash == null){ + throw new EamDbException("null MD5 hash"); + } + if(knownStatus == null){ + throw new EamDbException("null known status"); + } this.instanceID = instanceID; this.globalSetID = globalSetID; // Normalize hashes by lower casing @@ -111,7 +117,10 @@ public class EamGlobalFileInstance { /** * @param MD5Hash the MD5Hash to set */ - public void setMD5Hash(String MD5Hash) { + public void setMD5Hash(String MD5Hash) throws EamDbException { + if(MD5Hash == null){ + throw new EamDbException("null MD5 hash"); + } // Normalize hashes by lower casing this.MD5Hash = MD5Hash.toLowerCase(); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java index c032bdc83e..09aec0256f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java +++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbManager.java @@ -1232,9 +1232,10 @@ public class HashDbManager implements PropertyChangeListener { } else { type = TskData.FileKnown.KNOWN; } - EamGlobalFileInstance fileInstance = new EamGlobalFileInstance(referenceSetID, file.getMd5Hash(), - type, comment); + try{ + EamGlobalFileInstance fileInstance = new EamGlobalFileInstance(referenceSetID, file.getMd5Hash(), + type, comment); EamDb.getInstance().addReferenceInstance(fileInstance,EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID)); } catch (EamDbException ex){ throw new TskCoreException("Error adding hashes to " + getDisplayName(), ex); @@ -1259,8 +1260,12 @@ public class HashDbManager implements PropertyChangeListener { type = TskData.FileKnown.BAD; } else { type = TskData.FileKnown.KNOWN; - } - globalFileInstances.add(new EamGlobalFileInstance(referenceSetID, hashEntry.getMd5Hash(), type, hashEntry.getComment())); + } + try { + globalFileInstances.add(new EamGlobalFileInstance(referenceSetID, hashEntry.getMd5Hash(), type, hashEntry.getComment())); + } catch (EamDbException ex){ + throw new TskCoreException("Error adding hashes to " + getDisplayName(), ex); + } } try{ diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 2aafcf0679..cd0a0322a4 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -9,11 +9,12 @@ import java.io.IOException; import java.util.Map; import java.util.List; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Set; +import java.util.HashSet; import java.nio.file.Path; import java.nio.file.Paths; import java.util.stream.Collectors; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertTrue; import junit.framework.Test; import junit.framework.TestCase; import org.apache.commons.io.FileUtils; @@ -25,6 +26,8 @@ import org.sleuthkit.autopsy.casemodule.CaseActionException; import org.sleuthkit.autopsy.casemodule.CaseDetails; import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.datamodel.TskData; +import static junit.framework.Assert.assertFalse; +import static junit.framework.Assert.assertTrue; /** * @@ -33,7 +36,8 @@ public class CentralRepoDatamodelTest extends TestCase { private static final String PROPERTIES_FILE = "CentralRepository"; private static final String CR_DB_NAME = "testcentralrepo.db"; - private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest"); + //private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest"); + private static final Path testDirectory = Paths.get("C:", "Work", "CRDatamodelTest"); SqliteEamDbSettings dbSettingsSqlite; private CorrelationCase case1; @@ -42,6 +46,7 @@ public class CentralRepoDatamodelTest extends TestCase { private CorrelationDataSource dataSource2fromCase1; private EamOrganization org1; private EamOrganization org2; + CorrelationAttribute.Type fileType; private Map propertiesMap = null; @@ -124,6 +129,10 @@ public class CentralRepoDatamodelTest extends TestCase { org2 = new EamOrganization("org2"); org2.setOrgID((int) EamDb.getInstance().newOrganization(org2)); + + // Store the file type object for later use + fileType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID); + assertTrue("getCorrelationTypeById(FILES_TYPE_ID) returned null", fileType != null); } catch (EamDbException ex) { Exceptions.printStackTrace(ex); @@ -141,20 +150,382 @@ public class CentralRepoDatamodelTest extends TestCase { // Close and delete the test case and central repo db try { EamDb.getInstance().shutdownConnections(); - Case.closeCurrentCase(); // There shouldn't be a case open, but it's fine to call this anyway FileUtils.deleteDirectory(testDirectory.toFile()); - } catch (EamDbException | CaseActionException | IOException ex) { - //} catch (EamDbException | CaseActionException ex) { + } catch (EamDbException | IOException ex) { + // } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } assertFalse("Error deleting test directory " + testDirectory.toString(), testDirectory.toFile().exists()); } + /** + * Tests for adding / retrieving reference instances + * Only the files type is currently implemented + * addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttribute.Type correlationType) tests: + * - Test adding multiple valid entries + * - Test invalid reference set ID + * - Test null hash (EamGlobalFileInstance constructor) + * - Test null known status (EamGlobalFileInstance constructor) + * - Test null correlation type + * bulkInsertReferenceTypeEntries(Set globalInstances, CorrelationAttribute.Type contentType) tests: + * - Test with large valid list + * - Test with null list + * - Test with invalid reference set ID + * - Test with null correlation type + * getReferenceInstancesByTypeValue(CorrelationAttribute.Type aType, String aValue) tests: + * - Test with valid entries + * - Test with non-existent value + * - Test with invalid type + * - Test with null type + * - Test with null value + * isFileHashInReferenceSet(String hash, int referenceSetID)tests: + * - Test existing hash/ID + * - Test non-existent (but valid) hash/ID + * - Test invalid ID + * - Test null hash + * isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) tests: + * - Test existing value/ID + * - Test non-existent (but valid) value/ID + * - Test invalid ID + * - Test null value + * - Test invalid type ID + * isArtifactKnownBadByReference(CorrelationAttribute.Type aType, String value) tests: + * - Test notable value + * - Test known value + * - Test non-existent value + * - Test null value + * - Test null type + * - Test invalid type + */ + public void testReferenceSetInstances(){ + + // After the two initial testing blocks, the reference sets should contain: + // notableSet1 - notableHash1, inAllSetsHash + // notableSet2 - inAllSetsHash + // knownSet1 - knownHash1, inAllSetsHash + EamGlobalSet notableSet1; + int notableSet1id; + EamGlobalSet notableSet2; + int notableSet2id; + EamGlobalSet knownSet1; + int knownSet1id; + + String notableHash1 = "d46feecd663c41648dbf690d9343cf4b"; + String knownHash1 = "39c844daee70485143da4ff926601b5b"; + String inAllSetsHash = "6449b39bb23c42879fa0c243726e27f7"; + + CorrelationAttribute.Type emailType; + + // Store the email type object for later use + try{ + emailType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.EMAIL_TYPE_ID); + assertTrue("getCorrelationTypeById(EMAIL_TYPE_ID) returned null", emailType != null); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Set up a few reference sets + try { + notableSet1 = new EamGlobalSet(org1.getOrgID(), "notable set 1", "1.0", TskData.FileKnown.BAD, false, fileType); + notableSet1id = EamDb.getInstance().newReferenceSet(notableSet1); + notableSet2 = new EamGlobalSet(org1.getOrgID(), "notable set 2", "2.4", TskData.FileKnown.BAD, false, fileType); + notableSet2id = EamDb.getInstance().newReferenceSet(notableSet2); + knownSet1 = new EamGlobalSet(org1.getOrgID(), "known set 1", "5.5.4", TskData.FileKnown.KNOWN, false, fileType); + knownSet1id = EamDb.getInstance().newReferenceSet(knownSet1); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test adding file instances with valid data + try { + EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, inAllSetsHash, TskData.FileKnown.BAD, "comment1"); + EamDb.getInstance().addReferenceInstance(temp, fileType); + + temp = new EamGlobalFileInstance(notableSet2id, inAllSetsHash, TskData.FileKnown.BAD, "comment2"); + EamDb.getInstance().addReferenceInstance(temp, fileType); + + temp = new EamGlobalFileInstance(knownSet1id, inAllSetsHash, TskData.FileKnown.KNOWN, "comment3"); + EamDb.getInstance().addReferenceInstance(temp, fileType); + + temp = new EamGlobalFileInstance(notableSet1id, notableHash1, TskData.FileKnown.BAD, "comment4"); + EamDb.getInstance().addReferenceInstance(temp, fileType); + + temp = new EamGlobalFileInstance(knownSet1id, knownHash1, TskData.FileKnown.KNOWN, "comment5"); + EamDb.getInstance().addReferenceInstance(temp, fileType); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test adding file instance with invalid reference set ID + try { + EamGlobalFileInstance temp = new EamGlobalFileInstance(2345, inAllSetsHash, TskData.FileKnown.BAD, "comment"); + EamDb.getInstance().addReferenceInstance(temp, fileType); + Assert.fail("addReferenceInstance failed to throw exception for invalid ID"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test creating file instance with null hash + // Since it isn't possible to get a null hash into the EamGlobalFileInstance, skip trying to + // call addReferenceInstance and just test the EamGlobalFileInstance constructor + try { + EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, null, TskData.FileKnown.BAD, "comment"); + Assert.fail("EamGlobalFileInstance failed to throw exception for null hash"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test adding file instance with null known status + // Since it isn't possible to get a null known status into the EamGlobalFileInstance, skip trying to + // call addReferenceInstance and just test the EamGlobalFileInstance constructor + try { + EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, inAllSetsHash, null, "comment"); + Assert.fail("EamGlobalFileInstance failed to throw exception for null type"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test adding file instance with null correlation type + try { + EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, inAllSetsHash, TskData.FileKnown.BAD, "comment"); + EamDb.getInstance().addReferenceInstance(temp, null); + Assert.fail("addReferenceInstance failed to throw exception for null type"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test bulk insert with large valid set + try { + // Create a list of global file instances. Make enough that the bulk threshold should be hit once. + Set instances = new HashSet<>(); + String bulkTestHash = "bulktesthash_"; + for (int i = 0; i < dbSettingsSqlite.getBulkThreshold() * 1.5; i++) { + String hash = bulkTestHash + String.valueOf(i); + instances.add(new EamGlobalFileInstance(notableSet2id, hash, TskData.FileKnown.BAD, null)); + } + + // Insert the list + EamDb.getInstance().bulkInsertReferenceTypeEntries(instances, fileType); + + // There's no way to get a count of the number of entries in the database, so just do a spot check + if(dbSettingsSqlite.getBulkThreshold() > 10){ + String hash = bulkTestHash + "10"; + assertTrue("Sample bulk insert instance not found", EamDb.getInstance().isFileHashInReferenceSet(hash, notableSet2id)); + } + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test bulk add file instance with null list + try { + EamDb.getInstance().bulkInsertReferenceTypeEntries(null, fileType); + Assert.fail("bulkInsertReferenceTypeEntries failed to throw exception for null list"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test bulk add file instance with invalid reference set ID + try { + Set tempSet = new HashSet<>(Arrays.asList(new EamGlobalFileInstance(2345, inAllSetsHash, TskData.FileKnown.BAD, "comment"))); + EamDb.getInstance().bulkInsertReferenceTypeEntries(tempSet, fileType); + Assert.fail("bulkInsertReferenceTypeEntries failed to throw exception for invalid ID"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test bulk add file instance with null correlation type + try { + Set tempSet = new HashSet<>(Arrays.asList(new EamGlobalFileInstance(notableSet1id, inAllSetsHash, TskData.FileKnown.BAD, "comment"))); + EamDb.getInstance().bulkInsertReferenceTypeEntries(tempSet, null); + Assert.fail("bulkInsertReferenceTypeEntries failed to throw exception for null type"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test getting reference instances with valid data + try { + List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(fileType, inAllSetsHash); + assertTrue("getReferenceInstancesByTypeValue returned " + temp.size() + " instances - expected 3", temp.size() == 3); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting reference instances with non-existent data + try { + List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(fileType, "testHash"); + assertTrue("getReferenceInstancesByTypeValue returned " + temp.size() + " instances for non-existent value - expected 0", temp.isEmpty()); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting reference instances an invalid type (the email table is not yet implemented) + try { + List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(emailType, inAllSetsHash); + Assert.fail("getReferenceInstancesByTypeValue failed to throw exception for invalid table"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test getting reference instances with null type + try { + List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(null, inAllSetsHash); + Assert.fail("getReferenceInstancesByTypeValue failed to throw exception for null type"); + }catch (EamDbException ex){ + // This is the expected behavior + } + + // Test getting reference instances with null value + try { + List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(fileType, null); + assertTrue("getReferenceInstancesByTypeValue returned non-empty list given null value", temp.isEmpty()); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test checking existing hash/ID + try { + assertTrue("isFileHashInReferenceSet returned false for valid data", EamDb.getInstance().isFileHashInReferenceSet(knownHash1, knownSet1id)); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test checking non-existent (but valid) hash/ID + try { + assertFalse("isFileHashInReferenceSet returned true for non-existent data", EamDb.getInstance().isFileHashInReferenceSet(knownHash1, notableSet1id)); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test checking invalid reference set ID + try { + assertFalse("isFileHashInReferenceSet returned true for invalid data", EamDb.getInstance().isFileHashInReferenceSet(knownHash1, 5678)); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test checking null hash + try { + assertFalse("isFileHashInReferenceSet returned true for null hash", EamDb.getInstance().isFileHashInReferenceSet(null, knownSet1id)); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test checking existing hash/ID + try { + assertTrue("isValueInReferenceSet returned false for valid data", + EamDb.getInstance().isValueInReferenceSet(knownHash1, knownSet1id, fileType.getId())); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test checking non-existent (but valid) hash/ID + try { + assertFalse("isValueInReferenceSet returned true for non-existent data", + EamDb.getInstance().isValueInReferenceSet(knownHash1, notableSet1id, fileType.getId())); + }catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test checking invalid reference set ID + try { + assertFalse("isValueInReferenceSet returned true for invalid data", + EamDb.getInstance().isValueInReferenceSet(knownHash1, 5678, fileType.getId())); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test checking null hash + try { + assertFalse("isValueInReferenceSet returned true for null value", + EamDb.getInstance().isValueInReferenceSet(null, knownSet1id, fileType.getId())); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test checking invalid type + try { + EamDb.getInstance().isValueInReferenceSet(knownHash1, knownSet1id, emailType.getId()); + Assert.fail("isValueInReferenceSet failed to throw exception for invalid type"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test known bad with notable data + try { + assertTrue("isArtifactKnownBadByReference returned false for notable value", + EamDb.getInstance().isArtifactKnownBadByReference(fileType, notableHash1)); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test known bad with known data + try { + assertFalse("isArtifactKnownBadByReference returned true for known value", + EamDb.getInstance().isArtifactKnownBadByReference(fileType, knownHash1)); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test known bad with non-existent data + try { + assertFalse("isArtifactKnownBadByReference returned true for non-existent value", + EamDb.getInstance().isArtifactKnownBadByReference(fileType, "abcdef")); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test known bad with null hash + try { + assertFalse("isArtifactKnownBadByReference returned true for null value", + EamDb.getInstance().isArtifactKnownBadByReference(fileType, null)); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test known bad with null type + try { + EamDb.getInstance().isArtifactKnownBadByReference(null, knownHash1); + Assert.fail("isArtifactKnownBadByReference failed to throw exception from null type"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test known bad with invalid type + try { + assertFalse("isArtifactKnownBadByReference returned true for invalid type", EamDb.getInstance().isArtifactKnownBadByReference(emailType, null)); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + } + /** * Test method for the methods related to reference sets (does not include instance testing) + * Only the files type is currently implemented * newReferenceSet(EamGlobalSet eamGlobalSet) tests: * - Test creating notable reference set * - Test creating known reference set @@ -200,16 +571,6 @@ public class CentralRepoDatamodelTest extends TestCase { EamGlobalSet set3; int set3id; - // Store the file type object to save time - CorrelationAttribute.Type fileType; - try{ - fileType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID); - assertTrue("In testReferenceSets, getCorrelationTypeById(FILES_TYPE_ID) returned null", fileType != null); - } catch (EamDbException ex){ - Exceptions.printStackTrace(ex); - Assert.fail(ex); - return; - } // Test creating a notable reference set try { @@ -449,8 +810,7 @@ public class CentralRepoDatamodelTest extends TestCase { EamOrganization org = EamDb.getInstance().getReferenceSetOrganization(4567); Assert.fail("getReferenceSetOrganization failed to throw exception for invalid reference set ID"); } catch (EamDbException ex){ - Exceptions.printStackTrace(ex); - Assert.fail(ex); + // This is the expected behavior } } From 36c4e509726343a572eec51d550e76445abf0a3d Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Wed, 31 Jan 2018 14:48:00 -0500 Subject: [PATCH 33/62] Organizations testing almost complete --- .../datamodel/AbstractSqlEamDb.java | 8 + .../datamodel/CentralRepoDatamodelTest.java | 156 ++++++++++++++++++ 2 files changed, 164 insertions(+) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index e3b61fbece..b8942b1b8d 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -1439,6 +1439,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public long newOrganization(EamOrganization eamOrg) throws EamDbException { + if(eamOrg == null) { + throw new EamDbException("EamOrganization is null"); + } + Connection conn = connect(); ResultSet generatedKeys = null; PreparedStatement preparedStatement = null; @@ -1560,6 +1564,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public void updateOrganization(EamOrganization updatedOrganization) throws EamDbException { + if(updatedOrganization == null) { + throw new EamDbException("null updatedOrganization"); + } + Connection conn = connect(); PreparedStatement preparedStatement = null; String sql = "UPDATE organizations SET org_name = ?, poc_name = ?, poc_email = ?, poc_phone = ? WHERE id = ?"; diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index cd0a0322a4..403181f916 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -161,6 +161,162 @@ public class CentralRepoDatamodelTest extends TestCase { assertFalse("Error deleting test directory " + testDirectory.toString(), testDirectory.toFile().exists()); } + /** + * + */ + public void testOrganizations() { + + EamOrganization orgA; + String orgAname = "orgA"; + EamOrganization orgB; + String orgBname = "orgB"; + String orgBpocName = "pocName"; + String orgBpocEmail = "pocEmail"; + String orgBpocPhone = "pocPhone"; + + // Test adding a basic organization + try{ + orgA = new EamOrganization(orgAname); + orgA.setOrgID((int) EamDb.getInstance().newOrganization(orgA)); + assertTrue("Organization ID is still -1 after adding to db", orgA.getOrgID() != -1); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test adding an organization with additional fields + try{ + orgB = new EamOrganization(orgBname, orgBpocName, orgBpocEmail, orgBpocPhone); + orgB.setOrgID((int) EamDb.getInstance().newOrganization(orgB)); + assertTrue("Organization ID is still -1 after adding to db", orgB.getOrgID() != -1); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test adding a duplicate organization + try{ + EamOrganization temp = new EamOrganization(orgAname); + EamDb.getInstance().newOrganization(temp); + Assert.fail("newOrganization failed to throw exception for duplicate org name"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test adding null organization + try{ + EamDb.getInstance().newOrganization(null); + Assert.fail("newOrganization failed to throw exception for null org"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test adding organization with null name + try{ + EamOrganization temp = new EamOrganization(null); + EamDb.getInstance().newOrganization(temp); + Assert.fail("newOrganization failed to throw exception for null name"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test getting organizations + // We expect five - the default org, two from setUp, and two from this method + try{ + List orgs = EamDb.getInstance().getOrganizations(); + assertTrue("getOrganizations returned null list", orgs != null); + assertTrue("getOrganizations returned " + orgs.size() + " orgs - expected 5", orgs.size() == 5); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting org with valid ID + try{ + EamOrganization temp = EamDb.getInstance().getOrganizationByID(orgB.getOrgID()); + assertTrue("getOrganizationByID returned null for valid ID", temp != null); + assertTrue("getOrganizationByID returned unexpected name for organization", orgBname.equals(temp.getName())); + assertTrue("getOrganizationByID returned unexpected poc name for organization", orgBpocName.equals(temp.getPocName())); + assertTrue("getOrganizationByID returned unexpected poc email for organization", orgBpocEmail.equals(temp.getPocEmail())); + assertTrue("getOrganizationByID returned unexpected poc phone for organization", orgBpocPhone.equals(temp.getPocPhone())); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting org with invalid ID + try{ + EamOrganization temp = EamDb.getInstance().getOrganizationByID(12345); + Assert.fail("getOrganizationByID failed to throw exception for invalid ID"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test updating valid org + try{ + String newName = "newOrgName"; + String newPocName = "newPocName"; + String newPocEmail = "newPocEmail"; + String newPocPhone = "newPocPhone"; + orgA.setName(newName); + orgA.setPocName(newPocName); + orgA.setPocEmail(newPocEmail); + orgA.setPocPhone(newPocPhone); + + EamDb.getInstance().updateOrganization(orgA); + + EamOrganization copyOfA = EamDb.getInstance().getOrganizationByID(orgA.getOrgID()); + + assertTrue("getOrganizationByID returned null for valid ID", copyOfA != null); + assertTrue("updateOrganization failed to update org name", newName.equals(copyOfA.getName())); + assertTrue("updateOrganization failed to update poc name", newPocName.equals(copyOfA.getPocName())); + assertTrue("updateOrganization failed to update poc email", newPocEmail.equals(copyOfA.getPocEmail())); + assertTrue("updateOrganization failed to update poc phone", newPocPhone.equals(copyOfA.getPocPhone())); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test updating invalid org + // Shouldn't do anything + try{ + EamOrganization temp = new EamOrganization("invalidOrg"); + temp.setOrgID(3434); + EamDb.getInstance().updateOrganization(temp); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test updating null org + try{ + EamDb.getInstance().updateOrganization(null); + Assert.fail("updateOrganization failed to throw exception for null org"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test updating org to null name + try{ + EamOrganization copyOfA = EamDb.getInstance().getOrganizationByID(orgA.getOrgID()); + copyOfA.setName(null); + EamDb.getInstance().updateOrganization(copyOfA); + Assert.fail("updateOrganization failed to throw exception for null name"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test deleting existing org that isn't in use + + // Test deleting existing org that is in use + + // Test deleting non-existent org + + // Test deleting null org + } + /** * Tests for adding / retrieving reference instances * Only the files type is currently implemented From c6ab090fe66f1c8f2d1c647abf56a23c7be0966d Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Thu, 1 Feb 2018 08:31:07 -0500 Subject: [PATCH 34/62] Finished organizations --- .../datamodel/AbstractSqlEamDb.java | 4 ++ .../datamodel/CentralRepoDatamodelTest.java | 64 ++++++++++++++++++- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index b8942b1b8d..0a2d91fd02 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -1592,6 +1592,10 @@ public abstract class AbstractSqlEamDb implements EamDb { "AbstractSqlEamDb.deleteOrganization.errorDeleting.message=Error executing query when attempting to delete organization by id."}) @Override public void deleteOrganization(EamOrganization organizationToDelete) throws EamDbException { + if(organizationToDelete == null) { + throw new EamDbException("Organization to delete is null"); + } + Connection conn = connect(); PreparedStatement checkIfUsedStatement = null; ResultSet resultSet = null; diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 403181f916..f887c5cb02 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -162,7 +162,28 @@ public class CentralRepoDatamodelTest extends TestCase { } /** - * + * Test the methods related to organizations + * newOrganization(EamOrganization eamOrg) tests: + * - Test with just org name + * - Test with org name and poc info + * - Test adding duplicate org + * - Test adding null org + * - Test adding org with null name + * getOrganizations() tests: + * - Test getting the list of orgs +* getOrganizationByID(int orgID) tests: +* - Test with valid ID +* - Test with invalid ID +* updateOrganization(EamOrganization updatedOrganization) tests: +* - Test updating valid org +* - Test updating invalid org +* - Test updating null org +* - Test updating org to null name +* deleteOrganization(EamOrganization organizationToDelete) tests: +* - Test deleting org that isn't in use +* - Test deleting org that is in use +* - Test deleting invalid org +* - Test deleting null org */ public void testOrganizations() { @@ -309,12 +330,53 @@ public class CentralRepoDatamodelTest extends TestCase { } // Test deleting existing org that isn't in use + try{ + EamOrganization orgToDelete = new EamOrganization("deleteThis"); + orgToDelete.setOrgID((int)EamDb.getInstance().newOrganization(orgToDelete)); + int orgCount = EamDb.getInstance().getOrganizations().size(); + + EamDb.getInstance().deleteOrganization(orgToDelete); + assertTrue("getOrganizations returned unexpected count after deletion", orgCount - 1 == EamDb.getInstance().getOrganizations().size()); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } // Test deleting existing org that is in use + try{ + // Make a new org + EamOrganization inUseOrg = new EamOrganization("inUseOrg"); + inUseOrg.setOrgID((int)EamDb.getInstance().newOrganization(inUseOrg)); + + // Make a reference set that uses it + EamGlobalSet tempSet = new EamGlobalSet(inUseOrg.getOrgID(), "inUseOrgTest", "1.0", TskData.FileKnown.BAD, false, fileType); + EamDb.getInstance().newReferenceSet(tempSet); + + // It should now throw an exception if we try to delete it + EamDb.getInstance().deleteOrganization(inUseOrg); + Assert.fail("deleteOrganization failed to throw exception for in use organization"); + } catch (EamDbException ex){ + // This is the expected behavior + } // Test deleting non-existent org + // Should do nothing + try{ + EamOrganization temp = new EamOrganization("temp"); + temp.setOrgID(9876); + EamDb.getInstance().deleteOrganization(temp); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } // Test deleting null org + try{ + EamDb.getInstance().deleteOrganization(null); + Assert.fail("deleteOrganization failed to throw exception for null organization"); + } catch (EamDbException ex){ + // This is the expected behavior + } } /** From 205f8e820ce2a64883d9458eec26a7e7aa06f194 Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Thu, 1 Feb 2018 09:17:08 -0500 Subject: [PATCH 35/62] Starting type tests --- .../datamodel/CorrelationAttribute.java | 6 +-- .../datamodel/CentralRepoDatamodelTest.java | 52 +++++++++++++++++++ 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java index 39968d7922..57bafc4ff2 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java @@ -181,7 +181,7 @@ public class CorrelationAttribute implements Serializable { * Must start with a lowercase letter and only contain * lowercase letters, numbers, and '_' characters. * @param supported Is this Type currently supported - * @param enabled Is this Type currentl enabled. + * @param enabled Is this Type currently enabled. */ public Type(int id, String displayName, String dbTableName, Boolean supported, Boolean enabled) throws EamDbException { this.id = id; @@ -195,7 +195,7 @@ public class CorrelationAttribute implements Serializable { } /** - * Constructior for custom types where we do not know the Type ID until + * Constructor for custom types where we do not know the Type ID until * the row has been entered into the correlation_types table * in the central repository. * @@ -204,7 +204,7 @@ public class CorrelationAttribute implements Serializable { * Must start with a lowercase letter and only contain * lowercase letters, numbers, and '_' characters. * @param supported Is this Type currently supported - * @param enabled Is this Type currentl enabled. + * @param enabled Is this Type currently enabled. */ public Type(String displayName, String dbTableName, Boolean supported, Boolean enabled) throws EamDbException { this(-1, displayName, dbTableName, supported, enabled); diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index f887c5cb02..a66a3476ad 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -28,6 +28,8 @@ import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.datamodel.TskData; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; +import static junit.framework.Assert.assertFalse; +import static junit.framework.Assert.assertTrue; /** * @@ -161,6 +163,56 @@ public class CentralRepoDatamodelTest extends TestCase { assertFalse("Error deleting test directory " + testDirectory.toString(), testDirectory.toFile().exists()); } + /** + * newCorrelationType(CorrelationAttribute.Type newType) +getDefinedCorrelationTypes() +getEnabledCorrelationTypes() +getSupportedCorrelationTypes() +* getCorrelationTypeById(int typeId) +updateCorrelationType(CorrelationAttribute.Type aType) + */ + public void testCorrelationTypes() { + + CorrelationAttribute.Type customType; + + // Test new type with valid data + try{ + customType = new CorrelationAttribute.Type("customType", "custom_type", false, false); + customType.setId(EamDb.getInstance().newCorrelationType(customType)); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test new type with duplicate data + try{ + CorrelationAttribute.Type temp = new CorrelationAttribute.Type("customType", "custom_type", false, false); + EamDb.getInstance().newCorrelationType(temp); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test new type with null name + try{ + CorrelationAttribute.Type temp = new CorrelationAttribute.Type(null, "temp_type", false, false); + EamDb.getInstance().newCorrelationType(temp); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test new type with null db name + try{ + CorrelationAttribute.Type temp = new CorrelationAttribute.Type("temp", null, false, false); + EamDb.getInstance().newCorrelationType(temp); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + } + /** * Test the methods related to organizations * newOrganization(EamOrganization eamOrg) tests: From 49e0c8d28c12fde63b101cb7e1f33a3a713bfee0 Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Thu, 1 Feb 2018 09:18:39 -0500 Subject: [PATCH 36/62] Remove Details button from Ingest History screenshot --- .../images/case-properties-history-tab.PNG | Bin 29219 -> 28533 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/docs/doxygen-user/images/case-properties-history-tab.PNG b/docs/doxygen-user/images/case-properties-history-tab.PNG index fc0a4da441bf5cfce71ddfab700066e8b2196994..0a5d8f25b75fbc102bb21cbe921c518f4417e6de 100644 GIT binary patch delta 8454 zcmbt(c|25o-~Y5wNp$5B66!`}3ze*yR4RlpizVx%?23%tDZ*_p3@KY=o3S()vJFvO zwkFGrJtDiYk6~=jIlAuO^Stig^E|&le*eswIcLuIob&yD-pl8GGJox3{Mh%(fMaz3 zKCTldx|xS-h-Mmk02gN9?!s2|?xWX3428OS2Zrw?h*y{o;~;E`I$cBcjyY&5&pj<9)>65_$oep$>7AtY9$MgDvAw~ z?-FnE%t!i%{qd*9*r4+$>~o{z)O3VE_)Uik1}8MlI++K&dNLjXsooO;rt3>^%G5q= zl-T$&q))}-NkWQYx?Q-VY*@t0Q1pFFAG%J`5| z%EciL`+xvTv)V#jtE|Wz zj2@d$>i)CbY3Y--#J4Wrp)@bnTzADhZRn77{^`~Pv~X%i`%%jMeQdBc%PJG})33+X zUl@hMIACw8oB)}PtJ2TAUWC4a!C-P|#Pxl!LuHkfEoYt#?c09=W)Sw-`r+C%A?wS3^t|`8~P*IY<>LI9~=iC^iBF~ zGY~dxBXsaD7yZ0rqFs{sRI^xi!18ENn)y5@A-kZony?w+t>K}|xTk%zibQ2}Qv?N! zjIQQ7H0!vcM@^^6`$ZC&aXI+(Uj=8sA1cX~!;B=>&ub~}-C>mhO=04R-LOW;z! z!w+4Ds|B1by_;;neee7^`B1sDbBzs?22RH z5SPaZKYp(?z55EE$`pYQS*`)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3XliLn3BL2*3sZz|2a|L9lVzZsast1zl6gEBICQ6XA-z) zojqXN{qv_Y#&Z%Z`)SlGYMe5@@qd=)nz7OT7#Wh3ML+^3jTEBO7N`Vn7|-1WVtdSW zG8xy{V+Mhgs?Wr5q$-8V(8;ZXx(NyT?w|*$e|rtooTj^=pb5uuBTl@CSY=6T{1ADx z-~s-dLUg5>i$lH{|;=H<&f{Q_K)_Dp7Vfz5N1u3 g2ll8Bmr5PVsbCF_wMae{;8%#Ug2v-wd9#rJ19o!&eE Date: Thu, 1 Feb 2018 09:25:49 -0500 Subject: [PATCH 37/62] Merge pull request #3395 from zhhl/3366-EditDetailsButtonMisplaced 3366 Edit Details button is misplaced --- .../sleuthkit/autopsy/casemodule/CaseInformationPanel.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java index b03a17920e..2a460d5c46 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseInformationPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -61,6 +61,11 @@ class CaseInformationPanel extends javax.swing.JPanel { @Override public void stateChanged(ChangeEvent e) { tabbedPane.getSelectedComponent().setSize(tabbedPane.getSelectedComponent().getPreferredSize()); + if (tabbedPane.getSelectedComponent() instanceof CasePropertiesPanel) { + editDetailsButton.setVisible(true); + } else { + editDetailsButton.setVisible(false); + } } }); } From 806d7a5bd914e89bf42a5acfb8a32e3aa1ee133b Mon Sep 17 00:00:00 2001 From: "U-BASIS\\zhaohui" Date: Thu, 1 Feb 2018 10:56:16 -0500 Subject: [PATCH 38/62] 3470: Add comments for the Excel Cell size. --- Core/src/org/sleuthkit/autopsy/report/ReportExcel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java index 81045dc5b1..9158790ad6 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java @@ -34,7 +34,7 @@ class ReportExcel implements TableReportModule { private static final Logger logger = Logger.getLogger(ReportExcel.class.getName()); private static ReportExcel instance; - private static final int EXCEL_CELL_MAXIMUM_SIZE = 36767; + private static final int EXCEL_CELL_MAXIMUM_SIZE = 36767; //Specified at:https://poi.apache.org/apidocs/org/apache/poi/ss/SpreadsheetVersion.html private Workbook wb; private Sheet sheet; From d825b36ef2fa2d8581c3d5d6ef58f8f112e2f42e Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Thu, 1 Feb 2018 11:27:15 -0500 Subject: [PATCH 39/62] Finished org testing --- .../datamodel/AbstractSqlEamDb.java | 17 +- .../datamodel/CorrelationAttribute.java | 3 + .../datamodel/CentralRepoDatamodelTest.java | 154 ++++++++++++++++-- 3 files changed, 156 insertions(+), 18 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index 0a2d91fd02..bb8393034f 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -1325,7 +1325,7 @@ public abstract class AbstractSqlEamDb implements EamDb { @Override public boolean referenceSetIsValid(int referenceSetID, String setName, String version) throws EamDbException { EamGlobalSet refSet = this.getReferenceSetByID(referenceSetID); - if (refSet == null) { + if(refSet == null) { return false; } @@ -1941,6 +1941,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public int newCorrelationType(CorrelationAttribute.Type newType) throws EamDbException { + if (newType == null) { + throw new EamDbException("null correlation type"); + } + Connection conn = connect(); PreparedStatement preparedStatement = null; @@ -1955,7 +1959,7 @@ public abstract class AbstractSqlEamDb implements EamDb { } else { insertSql = "INSERT INTO correlation_types(id, display_name, db_table_name, supported, enabled) VALUES (?, ?, ?, ?, ?)"; } - querySql = "SELECT id FROM correlation_types WHERE display_name=? AND db_table_name=?"; + querySql = "SELECT * FROM correlation_types WHERE display_name=? AND db_table_name=?"; try { preparedStatement = conn.prepareStatement(insertSql); @@ -2145,9 +2149,12 @@ public abstract class AbstractSqlEamDb implements EamDb { preparedStatement = conn.prepareStatement(sql); preparedStatement.setInt(1, typeId); resultSet = preparedStatement.executeQuery(); - resultSet.next(); - aType = getCorrelationTypeFromResultSet(resultSet); - return aType; + if(resultSet.next()) { + aType = getCorrelationTypeFromResultSet(resultSet); + return aType; + } else { + throw new EamDbException("Failed to find entry for correlation type ID = " + typeId); + } } catch (SQLException ex) { throw new EamDbException("Error getting correlation type by id.", ex); // NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java index 57bafc4ff2..3a18932aa2 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java @@ -184,6 +184,9 @@ public class CorrelationAttribute implements Serializable { * @param enabled Is this Type currently enabled. */ public Type(int id, String displayName, String dbTableName, Boolean supported, Boolean enabled) throws EamDbException { + if(dbTableName == null) { + throw new EamDbException("dbTableName is null"); + } this.id = id; this.displayName = displayName; this.dbTableName = dbTableName; diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index a66a3476ad..5b639cec14 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -164,20 +164,37 @@ public class CentralRepoDatamodelTest extends TestCase { } /** - * newCorrelationType(CorrelationAttribute.Type newType) -getDefinedCorrelationTypes() -getEnabledCorrelationTypes() -getSupportedCorrelationTypes() -* getCorrelationTypeById(int typeId) -updateCorrelationType(CorrelationAttribute.Type aType) + * Test methods related to correlation types + * newCorrelationType(CorrelationAttribute.Type newType) tests: + * - Test with valid data + * - Test with duplicate data + * - Test with null name + * - Test with null db name + * - Test with null type + * getDefinedCorrelationTypes() tests: + * - Test that the expected number are returned + * getEnabledCorrelationTypes() tests: + * - Test that the expected number are returned + * getSupportedCorrelationTypes() tests: + * - Test that the expected number are returned + * getCorrelationTypeById(int typeId) tests: + * - Test with valid ID + * - Test with invalid ID + * updateCorrelationType(CorrelationAttribute.Type aType) tests: + * - Test with existing type + * - Test with non-existent type + * - Test updating to null name + * - Test with null type */ public void testCorrelationTypes() { CorrelationAttribute.Type customType; + String customTypeName = "customType"; + String customTypeDb = "custom_type"; // Test new type with valid data try{ - customType = new CorrelationAttribute.Type("customType", "custom_type", false, false); + customType = new CorrelationAttribute.Type(customTypeName, customTypeDb, false, false); customType.setId(EamDb.getInstance().newCorrelationType(customType)); } catch (EamDbException ex){ Exceptions.printStackTrace(ex); @@ -187,30 +204,141 @@ updateCorrelationType(CorrelationAttribute.Type aType) // Test new type with duplicate data try{ - CorrelationAttribute.Type temp = new CorrelationAttribute.Type("customType", "custom_type", false, false); + CorrelationAttribute.Type temp = new CorrelationAttribute.Type(customTypeName, customTypeDb, false, false); EamDb.getInstance().newCorrelationType(temp); + Assert.fail("newCorrelationType failed to throw exception for duplicate name/db table"); } catch (EamDbException ex){ - Exceptions.printStackTrace(ex); - Assert.fail(ex); + // This is the expected behavior } // Test new type with null name try{ CorrelationAttribute.Type temp = new CorrelationAttribute.Type(null, "temp_type", false, false); EamDb.getInstance().newCorrelationType(temp); + Assert.fail("newCorrelationType failed to throw exception for null name table"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test new type with null db name + // The constructor should fail in this case + try{ + CorrelationAttribute.Type temp = new CorrelationAttribute.Type("temp", null, false, false); + Assert.fail("CorrelationAttribute.Type failed to throw exception for null db table name"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test new type with null type + try{ + EamDb.getInstance().newCorrelationType(null); + Assert.fail("newCorrelationType failed to throw exception for null type"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test getting all correlation types + try{ + List types = EamDb.getInstance().getDefinedCorrelationTypes(); + + // We expect 6 total - 5 default and the custom one made earlier + assertTrue("getDefinedCorrelationTypes returned " + types.size() + " entries - expected 6", types.size() == 6); } catch (EamDbException ex){ Exceptions.printStackTrace(ex); Assert.fail(ex); } - // Test new type with null db name + // Test getting enabled correlation types try{ - CorrelationAttribute.Type temp = new CorrelationAttribute.Type("temp", null, false, false); - EamDb.getInstance().newCorrelationType(temp); + List types = EamDb.getInstance().getEnabledCorrelationTypes(); + + // We expect 5 - the custom type is disabled + assertTrue("getDefinedCorrelationTypes returned " + types.size() + " enabled entries - expected 5", types.size() == 5); } catch (EamDbException ex){ Exceptions.printStackTrace(ex); Assert.fail(ex); } + + // Test getting supported correlation types + try{ + List types = EamDb.getInstance().getSupportedCorrelationTypes(); + + // We expect 5 - the custom type is not supported + assertTrue("getDefinedCorrelationTypes returned " + types.size() + " supported entries - expected 5", types.size() == 5); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting the type with a valid ID + try{ + CorrelationAttribute.Type temp = EamDb.getInstance().getCorrelationTypeById(customType.getId()); + assertTrue("getCorrelationTypeById returned type with unexpected name " + temp.getDisplayName(), customTypeName.equals(temp.getDisplayName())); + assertTrue("getCorrelationTypeById returned type with unexpected db table name " + temp.getDbTableName(), customTypeDb.equals(temp.getDbTableName())); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting the type with a invalid ID + try{ + CorrelationAttribute.Type temp = EamDb.getInstance().getCorrelationTypeById(5555); + Assert.fail("getCorrelationTypeById failed to throw exception for invalid ID"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test updating a valid type + try{ + String newName = "newName"; + String newDbTable = "new_db_table"; + customType.setDisplayName(newName); + customType.setDbTableName(newDbTable); + customType.setEnabled(true); // These were originally false + customType.setSupported(true); + + EamDb.getInstance().updateCorrelationType(customType); + + // Get a fresh copy from the database + CorrelationAttribute.Type temp = EamDb.getInstance().getCorrelationTypeById(customType.getId()); + + assertTrue("updateCorrelationType failed to update name", newName.equals(temp.getDisplayName())); + assertTrue("updateCorrelationType failed to update db table name", newDbTable.equals(temp.getDbTableName())); + assertTrue("updateCorrelationType failed to update enabled status", temp.isEnabled()); + assertTrue("updateCorrelationType failed to update supported status", temp.isSupported()); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test updating a type with an invalid ID + // Nothing should happen + try{ + CorrelationAttribute.Type temp= new CorrelationAttribute.Type(customTypeName, customTypeDb, false, false); + temp.setId(12345); + EamDb.getInstance().updateCorrelationType(temp); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test updating a type to a null name + try{ + customType.setDisplayName(null); + EamDb.getInstance().updateCorrelationType(customType); + Assert.fail("updateCorrelationType failed to throw exception for null name"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test updating a null type + try{ + customType.setDisplayName(null); + EamDb.getInstance().updateCorrelationType(customType); + Assert.fail("updateCorrelationType failed to throw exception for null type"); + } catch (EamDbException ex){ + // This is the expected behavior + } } /** From 1c5ecb3487e4316368f7c973347f9871e3becb81 Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Thu, 1 Feb 2018 11:47:46 -0500 Subject: [PATCH 40/62] mark temp code --- .../datamodel/CentralRepoDatamodelTest.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 5b639cec14..035db25e6f 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -28,8 +28,6 @@ import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.datamodel.TskData; import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertTrue; -import static junit.framework.Assert.assertFalse; -import static junit.framework.Assert.assertTrue; /** * @@ -39,7 +37,7 @@ public class CentralRepoDatamodelTest extends TestCase { private static final String PROPERTIES_FILE = "CentralRepository"; private static final String CR_DB_NAME = "testcentralrepo.db"; //private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest"); - private static final Path testDirectory = Paths.get("C:", "Work", "CRDatamodelTest"); + private static final Path testDirectory = Paths.get("C:", "Work", "CRDatamodelTest"); // TEMP EASIER FOR TESTING SqliteEamDbSettings dbSettingsSqlite; private CorrelationCase case1; @@ -156,13 +154,20 @@ public class CentralRepoDatamodelTest extends TestCase { FileUtils.deleteDirectory(testDirectory.toFile()); } catch (EamDbException | IOException ex) { - // } catch (EamDbException ex) { + // } catch (EamDbException ex) { // TEMP FOR LOOKING AT DB Exceptions.printStackTrace(ex); Assert.fail(ex); } assertFalse("Error deleting test directory " + testDirectory.toString(), testDirectory.toFile().exists()); } + /** + * Test the module settings + */ + public void testSettings(){ + // Maybe + } + /** * Test methods related to correlation types * newCorrelationType(CorrelationAttribute.Type newType) tests: From 85e5a8c56234cfc19950cdbb81708207a883c898 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\zhaohui" Date: Thu, 1 Feb 2018 13:41:17 -0500 Subject: [PATCH 41/62] 3499: A full Ruleset list. --- ruleset.xml | 283 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 255 insertions(+), 28 deletions(-) diff --git a/ruleset.xml b/ruleset.xml index 2b4e66b821..c85bbe4dcd 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -6,33 +6,260 @@ Ruleset used by Autopsy - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 4c11cb8acb1fa387936dc5beaefb8f1ba85966f3 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 1 Feb 2018 14:24:27 -0500 Subject: [PATCH 42/62] Merge pull request #3392 from zhhl/3469_3470-FixExcelAndHMTLReportIssues 3469 3470 fix Excel and HTML report issues --- .../sleuthkit/autopsy/report/ReportExcel.java | 17 ++++++++++++++++- .../sleuthkit/autopsy/report/ReportHTML.java | 4 +++- .../autopsy/report/TableReportGenerator.java | 6 ++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java index 19526a0a19..9158790ad6 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java @@ -34,6 +34,7 @@ class ReportExcel implements TableReportModule { private static final Logger logger = Logger.getLogger(ReportExcel.class.getName()); private static ReportExcel instance; + private static final int EXCEL_CELL_MAXIMUM_SIZE = 36767; //Specified at:https://poi.apache.org/apidocs/org/apache/poi/ss/SpreadsheetVersion.html private Workbook wb; private Sheet sheet; @@ -236,10 +237,24 @@ class ReportExcel implements TableReportModule { * @param row cells to add */ @Override + @NbBundle.Messages({ + "ReportExcel.exceptionMessage.dataTooLarge=Value is too long to fit into an Excel cell. ", + "ReportExcel.exceptionMessage.errorText=Error showing data into an Excel cell." + }) + public void addRow(List rowData) { Row row = sheet.createRow(rowIndex); for (int i = 0; i < rowData.size(); ++i) { - row.createCell(i).setCellValue(rowData.get(i)); + Cell excelCell = row.createCell(i); + try { + excelCell.setCellValue(rowData.get(i)); + } catch (Exception e) { + if (e instanceof java.lang.IllegalArgumentException && rowData.get(i).length() > EXCEL_CELL_MAXIMUM_SIZE) { + excelCell.setCellValue(Bundle.ReportExcel_exceptionMessage_dataTooLarge() + e.getMessage()); + } else { + excelCell.setCellValue(Bundle.ReportExcel_exceptionMessage_errorText()); + } + } } ++rowIndex; } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java index 88d9fe44b1..01a179a370 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java @@ -51,6 +51,7 @@ import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.services.Services; import org.sleuthkit.autopsy.casemodule.services.TagsManager; +import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.ContentUtils.ExtractFscContentVisitor; @@ -554,7 +555,8 @@ class ReportHTML implements TableReportModule { StringBuilder builder = new StringBuilder(); builder.append("\t\n"); //NON-NLS for (String cell : row) { - builder.append("\t\t").append(cell).append("\n"); //NON-NLS + String escapeHTMLCell = EscapeUtil.escapeHtml(cell); + builder.append("\t\t").append(escapeHTMLCell).append("\n"); //NON-NLS } builder.append("\t\n"); //NON-NLS rowCount++; diff --git a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java index 93894022b3..499f848d54 100644 --- a/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/TableReportGenerator.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2013-16 Basis Technology Corp. + * Copyright 2013-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -40,7 +40,6 @@ import java.util.logging.Level; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.services.TagsManager; -import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.ContentUtils; @@ -666,8 +665,7 @@ class TableReportGenerator { tableModule.startTable(columnHeaderNames); } - String previewreplace = EscapeUtil.escapeHtml(preview); - tableModule.addRow(Arrays.asList(new String[]{previewreplace.replaceAll(" Date: Thu, 1 Feb 2018 16:00:12 -0500 Subject: [PATCH 43/62] 3499: Fix typo. --- ruleset.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruleset.xml b/ruleset.xml index c85bbe4dcd..3576173d64 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -184,7 +184,7 @@ - + From 481bec66c11f780db1417fee5fb094e0f09b3387 Mon Sep 17 00:00:00 2001 From: Raman Date: Thu, 1 Feb 2018 17:08:09 -0500 Subject: [PATCH 44/62] Address review comments --- .../autopsy/contentviewers/SQLiteViewer.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java index d5b5afdb68..627d30e87c 100644 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/SQLiteViewer.java @@ -40,6 +40,7 @@ import java.util.concurrent.ExecutionException; import java.util.logging.Level; import javax.swing.JComboBox; import javax.swing.SwingWorker; +import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.ContentUtils; @@ -457,7 +458,7 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { return resultSetToArrayList(resultSet); } catch (SQLException ex) { - LOGGER.log(Level.SEVERE, "Failed to get data for table.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Failed to get data for table " + tableName, ex); //NON-NLS } //NON-NLS return null; @@ -479,7 +480,7 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { selectedTableView.setupTable(Collections.emptyList()); } } catch (InterruptedException | ExecutionException ex) { - LOGGER.log(Level.SEVERE, "Unexpected exception while reading table.", ex); //NON-NLS + LOGGER.log(Level.SEVERE, "Unexpected exception while reading table " + tableName, ex); //NON-NLS } } }; @@ -487,26 +488,27 @@ public class SQLiteViewer extends javax.swing.JPanel implements FileTypeViewer { worker.execute(); } + @NbBundle.Messages("SQLiteViewer.BlobNotShown.message=BLOB Data not shown") private ArrayList> resultSetToArrayList(ResultSet rs) throws SQLException { - ResultSetMetaData md = rs.getMetaData(); - int columns = md.getColumnCount(); - ArrayList> arraylist = new ArrayList<>(); + ResultSetMetaData metaData = rs.getMetaData(); + int columns = metaData.getColumnCount(); + ArrayList> rowlist = new ArrayList<>(); while (rs.next()) { Map row = new LinkedHashMap<>(columns); for (int i = 1; i <= columns; ++i) { if (rs.getObject(i) == null) { - row.put(md.getColumnName(i), ""); + row.put(metaData.getColumnName(i), ""); } else { - if (md.getColumnTypeName(i).compareToIgnoreCase("blob") == 0) { - row.put(md.getColumnName(i), "BLOB Data not shown..."); + if (metaData.getColumnTypeName(i).compareToIgnoreCase("blob") == 0) { + row.put(metaData.getColumnName(i), Bundle.SQLiteViewer_BlobNotShown_message()); } else { - row.put(md.getColumnName(i), rs.getObject(i)); + row.put(metaData.getColumnName(i), rs.getObject(i)); } } } - arraylist.add(row); + rowlist.add(row); } - return arraylist; + return rowlist; } } From ef74c1f30ac52df5e8c6b8cd4d20bb32542fd5e0 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 2 Feb 2018 11:56:04 -0500 Subject: [PATCH 45/62] 3522 change case path used by Multi-User case panel to be real path instead of all caps --- .../src/org/sleuthkit/autopsy/casemodule/CaseBrowser.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseBrowser.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseBrowser.java index 24aaf70d2e..e283ef91d9 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseBrowser.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseBrowser.java @@ -29,6 +29,8 @@ import org.netbeans.swing.outline.Outline; import org.openide.nodes.Node; import java.awt.EventQueue; import java.io.File; +import java.io.IOException; +import java.nio.file.LinkOption; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -222,10 +224,10 @@ class CaseBrowser extends javax.swing.JPanel implements ExplorerManager.Provider String name = file.getName().toLowerCase(); if (autFilePath == null && name.endsWith(".aut")) { try { - caseList.add(new CaseMetadata(Paths.get(file.getAbsolutePath()))); - } catch (CaseMetadata.CaseMetadataException ex) { + caseList.add(new CaseMetadata(Paths.get(file.getAbsolutePath()).toRealPath(LinkOption.NOFOLLOW_LINKS))); + } catch (CaseMetadata.CaseMetadataException | IOException ex) { LOGGER.log(Level.SEVERE, String.format("Error reading case metadata file '%s'.", autFilePath), ex); - } + } break; } } From dda0e03e7f1f327dd39ca32cdda642a03778b8fa Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 2 Feb 2018 12:02:00 -0500 Subject: [PATCH 46/62] 3402 compare nodes themeselves instead of node names for view file in directory --- .../org/sleuthkit/autopsy/directorytree/ViewContextAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ViewContextAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ViewContextAction.java index 95c5f50c23..792252605a 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ViewContextAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ViewContextAction.java @@ -202,7 +202,7 @@ public class ViewContextAction extends AbstractAction { undecoratedParentNode.setChildNodeSelectionInfo(new ContentNodeSelectionInfo(content)); TreeView treeView = treeViewTopComponent.getTree(); treeView.expandNode(parentTreeViewNode); - if (treeViewTopComponent.getSelectedNode().getDisplayName().equals(parentTreeViewNode.getDisplayName())) { + if (treeViewTopComponent.getSelectedNode().equals(parentTreeViewNode)) { //In the case where our tree view already has the destination directory selected //due to an optimization in the ExplorerManager.setExploredContextAndSelection method //the property change we listen for to call DirectoryTreeTopComponent.respondSelection From 703cb9f223fd378402e29d33befcb035c23f75ec Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 2 Feb 2018 12:47:32 -0500 Subject: [PATCH 47/62] 3522 fix location of real path conversion to before any file access --- .../autopsy/casemodule/CaseBrowser.java | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseBrowser.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseBrowser.java index e283ef91d9..4f25030fd3 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseBrowser.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseBrowser.java @@ -209,28 +209,34 @@ class CaseBrowser extends javax.swing.JPanel implements ExplorerManager.Provider List nodeList = CoordinationService.getInstance().getNodeList(CoordinationService.CategoryNode.CASES); for (String node : nodeList) { - Path casePath = Paths.get(node); - File caseFolder = casePath.toFile(); - if (caseFolder.exists()) { - /* - * Search for '*.aut' files. - */ - File[] fileArray = caseFolder.listFiles(); - if (fileArray == null) { - continue; - } - String autFilePath = null; - for (File file : fileArray) { - String name = file.getName().toLowerCase(); - if (autFilePath == null && name.endsWith(".aut")) { - try { - caseList.add(new CaseMetadata(Paths.get(file.getAbsolutePath()).toRealPath(LinkOption.NOFOLLOW_LINKS))); - } catch (CaseMetadata.CaseMetadataException | IOException ex) { - LOGGER.log(Level.SEVERE, String.format("Error reading case metadata file '%s'.", autFilePath), ex); - } - break; + Path casePath; + try { + casePath = Paths.get(node).toRealPath(LinkOption.NOFOLLOW_LINKS); + + File caseFolder = casePath.toFile(); + if (caseFolder.exists()) { + /* + * Search for '*.aut' files. + */ + File[] fileArray = caseFolder.listFiles(); + if (fileArray == null) { + continue; + } + String autFilePath = null; + for (File file : fileArray) { + String name = file.getName().toLowerCase(); + if (autFilePath == null && name.endsWith(".aut")) { + try { + caseList.add(new CaseMetadata(Paths.get(file.getAbsolutePath()))); + } catch (CaseMetadata.CaseMetadataException ex) { + LOGGER.log(Level.SEVERE, String.format("Error reading case metadata file '%s'.", autFilePath), ex); + } + break; + } } } + } catch (IOException ignore) { + //if a path could not be resolved to a real path do add it to the caseList } } return caseList; From eeaa0bd0b142c132e500d8b035f9705398a5d1f5 Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Fri, 2 Feb 2018 13:02:49 -0500 Subject: [PATCH 48/62] Partway through artifact tests --- .../DataContentViewerOtherCases.java | 16 +- .../datamodel/AbstractSqlEamDb.java | 43 +- .../datamodel/CorrelationAttribute.java | 7 +- .../CorrelationAttributeInstance.java | 14 +- .../datamodel/EamArtifactUtil.java | 3 +- .../datamodel/CentralRepoDatamodelTest.java | 368 +++++++++++++++++- 6 files changed, 417 insertions(+), 34 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java b/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java index ad642a9cbc..c098112efa 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/contentviewer/DataContentViewerOtherCases.java @@ -489,12 +489,16 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D corAttrInstances.addAll(getCorrelatedInstances(corAttr, dataSourceName, deviceId)); corAttrInstances.forEach((corAttrInstance) -> { - CorrelationAttribute newCeArtifact = new CorrelationAttribute( - corAttr.getCorrelationType(), - corAttr.getCorrelationValue() - ); - newCeArtifact.addInstance(corAttrInstance); - tableModel.addEamArtifact(newCeArtifact); + try { + CorrelationAttribute newCeArtifact = new CorrelationAttribute( + corAttr.getCorrelationType(), + corAttr.getCorrelationValue() + ); + newCeArtifact.addInstance(corAttrInstance); + tableModel.addEamArtifact(newCeArtifact); + } catch (EamDbException ex){ + LOGGER.log(Level.SEVERE, "Error creating correlation attribute", ex); + } }); } diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index bb8393034f..a26c0e2a3b 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -521,6 +521,16 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public void addArtifact(CorrelationAttribute eamArtifact) throws EamDbException { + if(eamArtifact == null) { + throw new EamDbException("CorrelationAttribute is null"); + } + if(eamArtifact.getCorrelationType() == null) { + throw new EamDbException("Correlation type is null"); + } + if(eamArtifact.getCorrelationValue() == null) { + throw new EamDbException("Correlation value is null"); + } + Connection conn = connect(); List eamInstances = eamArtifact.getInstances(); @@ -534,11 +544,21 @@ public abstract class AbstractSqlEamDb implements EamDb { sql.append("(case_id, data_source_id, value, file_path, known_status, comment) "); sql.append("VALUES ((SELECT id FROM cases WHERE case_uid=? LIMIT 1), "); sql.append("(SELECT id FROM data_sources WHERE device_id=? AND case_id=? LIMIT 1), ?, ?, ?, ?)"); - + try { preparedStatement = conn.prepareStatement(sql.toString()); for (CorrelationAttributeInstance eamInstance : eamInstances) { if (!eamArtifact.getCorrelationValue().isEmpty()) { + if(eamInstance.getCorrelationCase() == null) { + throw new EamDbException("CorrelationAttributeInstance has null case"); + } + if(eamInstance.getCorrelationDataSource() == null) { + throw new EamDbException("CorrelationAttributeInstance has null data source"); + } + if(eamInstance.getKnownStatus() == null) { + throw new EamDbException("CorrelationAttributeInstance has null known status"); + } + preparedStatement.setString(1, eamInstance.getCorrelationCase().getCaseUUID()); preparedStatement.setString(2, eamInstance.getCorrelationDataSource().getDeviceID()); preparedStatement.setInt(3, eamInstance.getCorrelationDataSource().getCaseID()); @@ -575,6 +595,9 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public List getArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException { + if(aType == null) { + throw new EamDbException("Correlation type is null"); + } Connection conn = connect(); List artifactInstances = new ArrayList<>(); @@ -627,6 +650,12 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public List getArtifactInstancesByPath(CorrelationAttribute.Type aType, String filePath) throws EamDbException { + if(aType == null) { + throw new EamDbException("Correlation type is null"); + } + if(filePath == null) { + throw new EamDbException("Correlation value is null"); + } Connection conn = connect(); List artifactInstances = new ArrayList<>(); @@ -649,7 +678,7 @@ public abstract class AbstractSqlEamDb implements EamDb { try { preparedStatement = conn.prepareStatement(sql.toString()); - preparedStatement.setString(1, filePath); + preparedStatement.setString(1, filePath.toLowerCase()); resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { artifactInstance = getEamArtifactInstanceFromResultSet(resultSet); @@ -678,6 +707,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public Long getCountArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException { + if(aType == null) { + throw new EamDbException("Correlation type is null"); + } + Connection conn = connect(); Long instanceCount = 0L; @@ -2210,8 +2243,8 @@ public abstract class AbstractSqlEamDb implements EamDb { } CorrelationDataSource eamDataSource = new CorrelationDataSource( - resultSet.getInt("id"), resultSet.getInt("case_id"), + resultSet.getInt("id"), resultSet.getString("device_id"), resultSet.getString("name") ); @@ -2245,13 +2278,13 @@ public abstract class AbstractSqlEamDb implements EamDb { * * @throws SQLException when an expected column name is not in the resultSet */ - private CorrelationAttributeInstance getEamArtifactInstanceFromResultSet(ResultSet resultSet) throws SQLException { + private CorrelationAttributeInstance getEamArtifactInstanceFromResultSet(ResultSet resultSet) throws SQLException, EamDbException { if (null == resultSet) { return null; } CorrelationAttributeInstance eamArtifactInstance = new CorrelationAttributeInstance( new CorrelationCase(resultSet.getInt("case_id"), resultSet.getString("case_uid"), resultSet.getString("case_name")), - new CorrelationDataSource(-1, resultSet.getInt("case_id"), resultSet.getString("device_id"), resultSet.getString("name")), + new CorrelationDataSource(resultSet.getInt("case_id"), -1, resultSet.getString("device_id"), resultSet.getString("name")), resultSet.getString("file_path"), resultSet.getString("comment"), TskData.FileKnown.valueOf(resultSet.getByte("known_status")) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java index 3a18932aa2..427bbc97bb 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttribute.java @@ -28,7 +28,7 @@ import org.openide.util.NbBundle.Messages; /** * Represents a type and value pair that can be used for correlation. * CorrelationAttributeInstances store information about the actual - * occurences of the attribute. + * occurrences of the attribute. */ public class CorrelationAttribute implements Serializable { @@ -66,7 +66,10 @@ public class CorrelationAttribute implements Serializable { return DEFAULT_CORRELATION_TYPES; } - public CorrelationAttribute(Type correlationType, String correlationValue) { + public CorrelationAttribute(Type correlationType, String correlationValue) throws EamDbException { + if(correlationValue == null) { + throw new EamDbException ("Correlation value is null"); + } this.ID = ""; this.correlationType = correlationType; // Lower-case all values to normalize and improve correlation hits, going forward make sure this makes sense for all correlation types diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttributeInstance.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttributeInstance.java index f75364c580..5ca99abc7a 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttributeInstance.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/CorrelationAttributeInstance.java @@ -46,7 +46,7 @@ public class CorrelationAttributeInstance implements Serializable { public CorrelationAttributeInstance( CorrelationCase eamCase, CorrelationDataSource eamDataSource - ) { + ) throws EamDbException { this(-1, eamCase, eamDataSource, "", null, TskData.FileKnown.UNKNOWN); } @@ -54,7 +54,7 @@ public class CorrelationAttributeInstance implements Serializable { CorrelationCase eamCase, CorrelationDataSource eamDataSource, String filePath - ) { + ) throws EamDbException { this(-1, eamCase, eamDataSource, filePath, null, TskData.FileKnown.UNKNOWN); } @@ -63,7 +63,7 @@ public class CorrelationAttributeInstance implements Serializable { CorrelationDataSource eamDataSource, String filePath, String comment - ) { + ) throws EamDbException { this(-1, eamCase, eamDataSource, filePath, comment, TskData.FileKnown.UNKNOWN); } @@ -73,7 +73,7 @@ public class CorrelationAttributeInstance implements Serializable { String filePath, String comment, TskData.FileKnown knownStatus - ) { + ) throws EamDbException { this(-1, eamCase, eamDataSource, filePath, comment, knownStatus); } @@ -84,7 +84,11 @@ public class CorrelationAttributeInstance implements Serializable { String filePath, String comment, TskData.FileKnown knownStatus - ) { + ) throws EamDbException { + if(filePath == null) { + throw new EamDbException("file path is null"); + } + this.ID = ID; this.correlationCase = eamCase; this.correlationDataSource = eamDataSource; diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java index 171444fa42..c0810b52d3 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamArtifactUtil.java @@ -135,7 +135,8 @@ public class EamArtifactUtil { * @return the new EamArtifact, or null if one was not created because * bbArtifact did not contain the needed data */ - private static CorrelationAttribute getCorrelationAttributeFromBlackboardArtifact(CorrelationAttribute.Type correlationType, BlackboardArtifact bbArtifact) { + private static CorrelationAttribute getCorrelationAttributeFromBlackboardArtifact(CorrelationAttribute.Type correlationType, + BlackboardArtifact bbArtifact) throws EamDbException { String value = null; int artifactTypeID = bbArtifact.getArtifactTypeID(); diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 035db25e6f..f6587d1412 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -1,7 +1,20 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Central Repository + * + * Copyright 2018 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. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.sleuthkit.autopsy.centralrepository.datamodel; @@ -44,6 +57,7 @@ public class CentralRepoDatamodelTest extends TestCase { private CorrelationCase case2; private CorrelationDataSource dataSource1fromCase1; private CorrelationDataSource dataSource2fromCase1; + private CorrelationDataSource dataSource1fromCase2; private EamOrganization org1; private EamOrganization org2; CorrelationAttribute.Type fileType; @@ -123,6 +137,11 @@ public class CentralRepoDatamodelTest extends TestCase { EamDb.getInstance().newDataSource(dataSource2fromCase1); dataSource2fromCase1 = EamDb.getInstance().getDataSource(case1, dataSource2fromCase1.getDeviceID()); assertTrue("Failed to create test object dataSource2fromCase1", dataSource2fromCase1 != null); + + dataSource1fromCase2 = new CorrelationDataSource(case2.getID(), "dataSource3_deviceID", "dataSource3"); + EamDb.getInstance().newDataSource(dataSource1fromCase2); + dataSource1fromCase2 = EamDb.getInstance().getDataSource(case2, dataSource1fromCase2.getDeviceID()); + assertTrue("Failed to create test object dataSource1fromCase2", dataSource1fromCase2 != null); org1 = new EamOrganization("org1"); org1.setOrgID((int) EamDb.getInstance().newOrganization(org1)); @@ -154,7 +173,7 @@ public class CentralRepoDatamodelTest extends TestCase { FileUtils.deleteDirectory(testDirectory.toFile()); } catch (EamDbException | IOException ex) { - // } catch (EamDbException ex) { // TEMP FOR LOOKING AT DB + // } catch (EamDbException ex) { // TEMP FOR LOOKING AT DB Exceptions.printStackTrace(ex); Assert.fail(ex); } @@ -168,6 +187,324 @@ public class CentralRepoDatamodelTest extends TestCase { // Maybe } + /** + * Test methods related to artifacts + */ + public void testArtifacts() { + + String inAllDataSourcesHash = "6cddb0e31787b79cfdcc0676b98a71ce"; + String inAllDataSourcesPath = "C:\\files\\path0.txt"; + String inDataSource1twiceHash = "b2f5ff47436671b6e533d8dc3614845d"; + String inDataSource1twicePath1 = "C:\\files\\path1.txt"; + String inDataSource1twicePath2 = "C:\\files\\path2.txt"; + String onlyInDataSource3Hash = "2af54305f183778d87de0c70c591fae4"; + String onlyInDataSource3Path = "C:\\files\\path3.txt"; + + // These will all go in dataSource1fromCase1 + String emailValue = "test@gmail.com"; + String emailPath = "C:\\files\\emailPath.txt"; + String phoneValue = "202-555-1234"; + String phonePath = "C:\\files\\phonePath.txt"; + String domainValue = "www.mozilla.com"; + String domainPath = "C:\\files\\domainPath.txt"; + String devIdValue = "94B21234"; + String devIdPath = "C:\\files\\devIdPath.txt"; + + // Test adding attribute with one instance + try{ + CorrelationAttribute attr = new CorrelationAttribute(fileType, onlyInDataSource3Hash); + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case2, dataSource1fromCase2, onlyInDataSource3Path); + attr.addInstance(inst); + EamDb.getInstance().addArtifact(attr); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test adding attribute with an instance in each data source + try{ + CorrelationAttribute attr = new CorrelationAttribute(fileType, inAllDataSourcesHash); + CorrelationAttributeInstance inst1 = new CorrelationAttributeInstance(case1, dataSource1fromCase1, inAllDataSourcesPath); + attr.addInstance(inst1); + CorrelationAttributeInstance inst2 = new CorrelationAttributeInstance(case1, dataSource2fromCase1, inAllDataSourcesPath); + attr.addInstance(inst2); + CorrelationAttributeInstance inst3 = new CorrelationAttributeInstance(case2, dataSource1fromCase2, inAllDataSourcesPath); + attr.addInstance(inst3); + EamDb.getInstance().addArtifact(attr); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test adding attribute with two instances in one data source + try{ + CorrelationAttribute attr = new CorrelationAttribute(fileType, inDataSource1twiceHash); + CorrelationAttributeInstance inst1 = new CorrelationAttributeInstance(case1, dataSource1fromCase1, inDataSource1twicePath1); + attr.addInstance(inst1); + CorrelationAttributeInstance inst2 = new CorrelationAttributeInstance(case1, dataSource1fromCase1, inDataSource1twicePath2); + attr.addInstance(inst2); + EamDb.getInstance().addArtifact(attr); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test adding the other types + // Test adding an email artifact + try{ + CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.EMAIL_TYPE_ID), + emailValue); + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, emailPath); + attr.addInstance(inst); + EamDb.getInstance().addArtifact(attr); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test adding a phone artifact + try{ + CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.PHONE_TYPE_ID), + phoneValue); + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, phonePath); + attr.addInstance(inst); + EamDb.getInstance().addArtifact(attr); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test adding a domain artifact + try{ + CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.DOMAIN_TYPE_ID), + domainValue); + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, domainPath); + attr.addInstance(inst); + EamDb.getInstance().addArtifact(attr); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test adding a device ID artifact + try{ + CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.USBID_TYPE_ID), + devIdValue); + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, devIdPath); + attr.addInstance(inst); + EamDb.getInstance().addArtifact(attr); + } catch (EamDbException ex){ + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test CorrelationAttributeInstance failure cases + + // Create an attribute to use in the next few tests + CorrelationAttribute failAttr; + try { + failAttr = new CorrelationAttribute(fileType, "badInstances"); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Test adding instance with null case + try{ + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(null, dataSource1fromCase2, "badPath"); + failAttr.addInstance(inst); + EamDb.getInstance().addArtifact(failAttr); + Assert.fail("addArtifact failed to throw exception for null case"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test adding instance with invalid case ID + try{ + CorrelationCase badCase = new CorrelationCase("badCaseUuid", "badCaseName"); + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(badCase, dataSource1fromCase2, "badPath"); + failAttr.addInstance(inst); + EamDb.getInstance().addArtifact(failAttr); + Assert.fail("addArtifact failed to throw exception for invalid case"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test adding instance with null data source + try{ + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, null, "badPath"); + failAttr.addInstance(inst); + EamDb.getInstance().addArtifact(failAttr); + Assert.fail("addArtifact failed to throw exception for null data source"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test adding instance with invalid data source ID + try{ + CorrelationDataSource badDS = new CorrelationDataSource(case1.getID(), "badDSUuid", "badDSName"); + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, badDS, "badPath"); + failAttr.addInstance(inst); + EamDb.getInstance().addArtifact(failAttr); + Assert.fail("addArtifact failed to throw exception for invalid data source"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test adding instance with null path + // This will fail in the CorrelationAttributeInstance constructor + try{ + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, null); + Assert.fail("CorrelationAttributeInstance failed to throw exception for null path"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test adding instance with null known status + try{ + CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, null, "comment", null); + failAttr.addInstance(inst); + EamDb.getInstance().addArtifact(failAttr); + Assert.fail("addArtifact failed to throw exception for null known status"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test CorrelationAttribute failure cases + + // Test null type + try{ + CorrelationAttribute attr = new CorrelationAttribute(null, "badInstances"); + EamDb.getInstance().addArtifact(attr); + Assert.fail("addArtifact failed to throw exception for null type"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test null value + // This will fail in the CorrelationAttribute constructor + try{ + CorrelationAttribute attr = new CorrelationAttribute(fileType, null); + Assert.fail("addArtifact failed to throw exception for null value"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + // Test getting instances with expected resuls + try { + List instances = EamDb.getInstance().getArtifactInstancesByTypeValue(fileType, inAllDataSourcesHash); + assertTrue("getArtifactInstancesByTypeValue returned " + instances.size() + " results - expected 3", instances.size() == 3); + + // This test works because all the instances of this hash were set to the same path + for(CorrelationAttributeInstance inst:instances) { + assertTrue("getArtifactInstancesByTypeValue returned instance with unexpected path " + inst.getFilePath(), + inAllDataSourcesPath.equalsIgnoreCase(inst.getFilePath())); + } + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting instances expecting no results + try { + List instances = EamDb.getInstance().getArtifactInstancesByTypeValue( + EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.EMAIL_TYPE_ID), inAllDataSourcesHash); + assertTrue("getArtifactInstancesByTypeValue returned " + instances.size() + " results - expected 0", instances.isEmpty()); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting instances with null type + try { + List instances = EamDb.getInstance().getArtifactInstancesByTypeValue(null, inAllDataSourcesHash); + Assert.fail("getArtifactInstancesByTypeValue failed to throw exception for null type"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting instances with null value + // Should just return nothing + try { + List instances = EamDb.getInstance().getArtifactInstancesByTypeValue(fileType, null); + assertTrue("getArtifactInstancesByTypeValue returned non-empty list for null value", instances.isEmpty()); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting instances with path that should produce results + try { + List instances = EamDb.getInstance().getArtifactInstancesByPath(fileType, inAllDataSourcesPath); + assertTrue("getArtifactInstancesByPath returned " + instances.size() + " objects - expected 3", instances.size() == 3); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting instances with path that should not produce results + try { + List instances = EamDb.getInstance().getArtifactInstancesByPath(fileType, "xyz"); + assertTrue("getArtifactInstancesByPath returned " + instances.size() + " objects - expected 0", instances.isEmpty()); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting instances with null type + try { + List instances = EamDb.getInstance().getArtifactInstancesByPath(null, inAllDataSourcesPath); + Assert.fail("getArtifactInstancesByPath failed to throw exception for null type"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting instances with null value + try { + List instances = EamDb.getInstance().getArtifactInstancesByPath(fileType, null); + Assert.fail("getArtifactInstancesByPath failed to throw exception for null value"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting instance count with path that should produce results + try { + long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(fileType, inAllDataSourcesPath); + assertTrue("getCountArtifactInstancesByTypeValue returned " + count + " - expected 3", count == 3); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting instance count with path that should not produce results + try { + long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(fileType, "xyz"); + assertTrue("getCountArtifactInstancesByTypeValue returned " + count + " - expected 0", count == 0); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting instance count with null type + try { + long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(null, inAllDataSourcesPath); + Assert.fail("getCountArtifactInstancesByTypeValue failed to throw exception for null type"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting instance count with null value + try { + long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(fileType, null); + Assert.fail("getCountArtifactInstancesByTypeValue failed to throw exception for null value"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + + } + /** * Test methods related to correlation types * newCorrelationType(CorrelationAttribute.Type newType) tests: @@ -191,7 +528,7 @@ public class CentralRepoDatamodelTest extends TestCase { * - Test updating to null name * - Test with null type */ - public void testCorrelationTypes() { + public void atestCorrelationTypes() { CorrelationAttribute.Type customType; String customTypeName = "customType"; @@ -370,7 +707,7 @@ public class CentralRepoDatamodelTest extends TestCase { * - Test deleting invalid org * - Test deleting null org */ - public void testOrganizations() { + public void atestOrganizations() { EamOrganization orgA; String orgAname = "orgA"; @@ -603,7 +940,7 @@ public class CentralRepoDatamodelTest extends TestCase { * - Test null type * - Test invalid type */ - public void testReferenceSetInstances(){ + public void atestReferenceSetInstances(){ // After the two initial testing blocks, the reference sets should contain: // notableSet1 - notableHash1, inAllSetsHash @@ -963,7 +1300,7 @@ public class CentralRepoDatamodelTest extends TestCase { * - Test on valid reference set ID * - Test on invalid reference set ID */ - public void testReferenceSets() { + public void atestReferenceSets() { String set1name = "referenceSet1"; String set1version = "1.0"; EamGlobalSet set1; @@ -1236,7 +1573,7 @@ public class CentralRepoDatamodelTest extends TestCase { * Long getCountUniqueDataSources() tests: * - Test that the result is as expected */ - public void testDataSources() { + public void atestDataSources() { final String dataSourceAname = "dataSourceA"; final String dataSourceAid = "dataSourceA_deviceID"; CorrelationDataSource dataSourceA; @@ -1334,16 +1671,17 @@ public class CentralRepoDatamodelTest extends TestCase { } // Test getting the list of data sources - // There should be three data sources, and we'll check for the expected device IDs + // There should be five data sources, and we'll check for the expected device IDs try { List dataSources = EamDb.getInstance().getDataSources(); List devIdList = dataSources.stream().map(c -> c.getDeviceID()).collect(Collectors.toList()); - assertTrue("getDataSources returned unexpected number of data sources", dataSources.size() == 4); + assertTrue("getDataSources returned unexpected number of data sources", dataSources.size() == 5); assertTrue("getDataSources is missing expected data sources", devIdList.contains(dataSourceAid) && devIdList.contains(dataSource1fromCase1.getDeviceID()) - && devIdList.contains(dataSource2fromCase1.getDeviceID())); + && devIdList.contains(dataSource2fromCase1.getDeviceID()) + && devIdList.contains(dataSource1fromCase2.getDeviceID())); } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); @@ -1352,7 +1690,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test the data source count try { assertTrue("getCountUniqueDataSources returned unexpected number of data sources", - EamDb.getInstance().getCountUniqueDataSources() == 4); + EamDb.getInstance().getCountUniqueDataSources() == 5); } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); @@ -1372,7 +1710,7 @@ public class CentralRepoDatamodelTest extends TestCase { * bulkInsertCases(List cases) - Test on a list of cases * larger than the bulk insert threshold. - Test on a null list */ - public void testCases() { + public void atestCases() { final String caseAname = "caseA"; final String caseAuuid = "caseA_uuid"; CorrelationCase caseA; @@ -1609,7 +1947,7 @@ public class CentralRepoDatamodelTest extends TestCase { * to null value - Test updating null name - Test updating non-existing name * to new value */ - public void testDbInfo() { + public void atestDbInfo() { final String name1 = "testName1"; final String name2 = "testName2"; final String name3 = "testName3"; From 699995fd638551ed45203faf664aa05e4f93ec6d Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Fri, 2 Feb 2018 14:07:29 -0500 Subject: [PATCH 49/62] disabled some rulesets from initial commit --- ruleset.xml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/ruleset.xml b/ruleset.xml index 3576173d64..6ff40194e3 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -53,10 +53,18 @@ - - + + + + + + + + @@ -122,7 +131,9 @@ - + @@ -182,7 +193,8 @@ - + @@ -258,7 +270,8 @@ - + From 3aedf68dd29c04f4555bc079a605b344a6e548c0 Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Fri, 2 Feb 2018 14:31:10 -0500 Subject: [PATCH 50/62] more pmd changes --- ruleset.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ruleset.xml b/ruleset.xml index 6ff40194e3..9c8f7e34c2 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -92,7 +92,8 @@ - + @@ -176,7 +177,8 @@ - + From 5d0cb87f5fab1693272d9ddeb22428a9ed41009a Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Fri, 2 Feb 2018 16:33:55 -0500 Subject: [PATCH 51/62] Artifact testing partially done. --- .../datamodel/AbstractSqlEamDb.java | 16 +- .../datamodel/CentralRepoDatamodelTest.java | 237 +++++++++++++++++- 2 files changed, 245 insertions(+), 8 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index a26c0e2a3b..1517466116 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -710,6 +710,9 @@ public abstract class AbstractSqlEamDb implements EamDb { if(aType == null) { throw new EamDbException("Correlation type is null"); } + if(value == null) { + throw new EamDbException("Correlation value is null"); + } Connection conn = connect(); @@ -725,7 +728,7 @@ public abstract class AbstractSqlEamDb implements EamDb { try { preparedStatement = conn.prepareStatement(sql.toString()); - preparedStatement.setString(1, value); + preparedStatement.setString(1, value.toLowerCase()); resultSet = preparedStatement.executeQuery(); resultSet.next(); instanceCount = resultSet.getLong(1); @@ -742,6 +745,9 @@ public abstract class AbstractSqlEamDb implements EamDb { @Override public int getFrequencyPercentage(CorrelationAttribute corAttr) throws EamDbException { + if (corAttr == null) { + throw new EamDbException("Correlation attribute is null"); + } Double uniqueTypeValueTuples = getCountUniqueCaseDataSourceTuplesHavingTypeValue(corAttr.getCorrelationType(), corAttr.getCorrelationValue()).doubleValue(); Double uniqueCaseDataSourceTuples = getCountUniqueDataSources().doubleValue(); Double commonalityPercentage = uniqueTypeValueTuples / uniqueCaseDataSourceTuples * 100; @@ -760,6 +766,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttribute.Type aType, String value) throws EamDbException { + if(aType == null) { + throw new EamDbException("Correlation type is null"); + } + Connection conn = connect(); Long instanceCount = 0L; @@ -881,6 +891,10 @@ public abstract class AbstractSqlEamDb implements EamDb { @Override public void prepareBulkArtifact(CorrelationAttribute eamArtifact) throws EamDbException { + if(eamArtifact.getCorrelationType() == null) { + throw new EamDbException("Correlation type is null"); + } + synchronized (bulkArtifacts) { bulkArtifacts.get(eamArtifact.getCorrelationType().getDbTableName()).add(eamArtifact); bulkArtifactsCount++; diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index f6587d1412..e0177f12f0 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -173,7 +173,7 @@ public class CentralRepoDatamodelTest extends TestCase { FileUtils.deleteDirectory(testDirectory.toFile()); } catch (EamDbException | IOException ex) { - // } catch (EamDbException ex) { // TEMP FOR LOOKING AT DB + // } catch (EamDbException ex) { // TEMP FOR LOOKING AT DB Exceptions.printStackTrace(ex); Assert.fail(ex); } @@ -183,10 +183,97 @@ public class CentralRepoDatamodelTest extends TestCase { /** * Test the module settings */ - public void testSettings(){ + public void atestSettings(){ // Maybe } + /** + * Test the methods associated with bulk artifacts + * First test the normal use case of a large number of valid artifacts getting added + * Next test the error conditions: + * + */ + public void testBulkArtifacts() { + + // Test bulk artifacts + // Steps: + // - Make a list of artifacts roughly half the threshold size + // - Call prepareBulkArtifact on all of them + // - Verify that nothing has been written to the database + // - Make a list of artifacts equal to the threshold size + // - Call prepareBulkArtifact on all of them + // - Verify that the bulk threshold number of them were written to the database + // - Call bulkInsertArtifacts to insert the remainder + // - Verify that the database now has all the artifacts + try { + // Make sure there are no artifacts in the database to start + long originalArtifactCount = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), dataSource1fromCase1.getDeviceID()); + assertTrue("getCountArtifactInstancesByCaseDataSource returned non-zero count", originalArtifactCount == 0); + + // Create the first list, which will have (bulkThreshold / 2) entries + List list1 = new ArrayList<>(); + for(int i = 0; i < dbSettingsSqlite.getBulkThreshold() / 2;i++) { + String value = "bulkInsertValue1_" + String.valueOf(i); + String path = "C:\\bulkInsertPath1\\file" + String.valueOf(i); + + CorrelationAttribute attr = new CorrelationAttribute(fileType, value); + attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase1, path)); + list1.add(attr); + } + + // Queue up the current list. There should not be enough to trigger the insert + for(CorrelationAttribute attr:list1){ + EamDb.getInstance().prepareBulkArtifact(attr); + } + + // Check that nothing has been written yet + assertTrue("Artifacts written to database before threshold was reached", + originalArtifactCount == EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), dataSource1fromCase1.getDeviceID())); + + // Make a second list with length equal to bulkThreshold + List list2 = new ArrayList<>(); + for(int i = 0; i < dbSettingsSqlite.getBulkThreshold();i++) { + String value = "bulkInsertValue2_" + String.valueOf(i); + String path = "C:\\bulkInsertPath2\\file" + String.valueOf(i); + + CorrelationAttribute attr = new CorrelationAttribute(fileType, value); + attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase1, path)); + list2.add(attr); + } + + // Queue up the current list. This will trigger an insert partway through + for(CorrelationAttribute attr:list2){ + EamDb.getInstance().prepareBulkArtifact(attr); + } + + // There should now be bulkThreshold artifacts in the database + long count = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), dataSource1fromCase1.getDeviceID()); + assertTrue("Artifact count " + count + " does not match bulkThreshold " + dbSettingsSqlite.getBulkThreshold(), count == dbSettingsSqlite.getBulkThreshold()); + + // Now call bulkInsertArtifacts() to insert the rest of queue + EamDb.getInstance().bulkInsertArtifacts(); + count = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), dataSource1fromCase1.getDeviceID()); + int expectedCount = list1.size() + list2.size(); + assertTrue("Artifact count " + count + " does not match expected count " + expectedCount, count == expectedCount); + + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test preparing artifact with null type + try{ + CorrelationAttribute attr = new CorrelationAttribute(null, "value"); + EamDb.getInstance().prepareBulkArtifact(attr); + Assert.fail("prepareBulkArtifact failed to throw exception for null type"); + } catch (EamDbException ex){ + // This is the expected behavior + } + + + + } + /** * Test methods related to artifacts */ @@ -210,6 +297,17 @@ public class CentralRepoDatamodelTest extends TestCase { String devIdValue = "94B21234"; String devIdPath = "C:\\files\\devIdPath.txt"; + // Store the email type + CorrelationAttribute.Type emailType; + + try { + emailType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.EMAIL_TYPE_ID); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + // Test adding attribute with one instance try{ CorrelationAttribute attr = new CorrelationAttribute(fileType, onlyInDataSource3Hash); @@ -252,8 +350,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test adding the other types // Test adding an email artifact try{ - CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.EMAIL_TYPE_ID), - emailValue); + CorrelationAttribute attr = new CorrelationAttribute(emailType, emailValue); CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, emailPath); attr.addInstance(inst); EamDb.getInstance().addArtifact(attr); @@ -409,7 +506,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting instances expecting no results try { List instances = EamDb.getInstance().getArtifactInstancesByTypeValue( - EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.EMAIL_TYPE_ID), inAllDataSourcesHash); + emailType, inAllDataSourcesHash); assertTrue("getArtifactInstancesByTypeValue returned " + instances.size() + " results - expected 0", instances.isEmpty()); } catch (EamDbException ex) { Exceptions.printStackTrace(ex); @@ -470,7 +567,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting instance count with path that should produce results try { - long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(fileType, inAllDataSourcesPath); + long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(fileType, inAllDataSourcesHash); assertTrue("getCountArtifactInstancesByTypeValue returned " + count + " - expected 3", count == 3); } catch (EamDbException ex) { Exceptions.printStackTrace(ex); @@ -488,7 +585,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting instance count with null type try { - long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(null, inAllDataSourcesPath); + long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(null, inAllDataSourcesHash); Assert.fail("getCountArtifactInstancesByTypeValue failed to throw exception for null type"); } catch (EamDbException ex) { // This is the expected behavior @@ -502,7 +599,133 @@ public class CentralRepoDatamodelTest extends TestCase { // This is the expected behavior } + // Test getting frequency of value that is in all three data sources + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, inAllDataSourcesHash); + int freq = EamDb.getInstance().getFrequencyPercentage(attr); + assertTrue("getFrequencyPercentage returned " + freq + " - expected 100", freq == 100); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + // Test getting frequency of value that appears twice in a single data source + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, inDataSource1twiceHash); + int freq = EamDb.getInstance().getFrequencyPercentage(attr); + assertTrue("getFrequencyPercentage returned " + freq + " - expected 33", freq == 33); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting frequency of non-file type + try { + CorrelationAttribute attr = new CorrelationAttribute(emailType, emailValue); + int freq = EamDb.getInstance().getFrequencyPercentage(attr); + assertTrue("getFrequencyPercentage returned " + freq + " - expected 33", freq == 33); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting frequency of non-existent value + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, "randomValue"); + int freq = EamDb.getInstance().getFrequencyPercentage(attr); + assertTrue("getFrequencyPercentage returned " + freq + " - expected 0", freq == 0); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting frequency with null type + try { + CorrelationAttribute attr = new CorrelationAttribute(null, "randomValue"); + int freq = EamDb.getInstance().getFrequencyPercentage(attr); + Assert.fail("getFrequencyPercentage failed to throw exception for null type"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting frequency with null attribute + try { + int freq = EamDb.getInstance().getFrequencyPercentage(null); + Assert.fail("getFrequencyPercentage failed to throw exception for null attribute"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting count for dataSource1fromCase1 (includes all types) + try { + long count = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), dataSource1fromCase1.getDeviceID()); + assertTrue("getCountArtifactInstancesByCaseDataSource returned " + count + " - expected 7", count == 7); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting count with null case UUID + try { + long count = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(null, dataSource1fromCase1.getDeviceID()); + assertTrue("getCountArtifactInstancesByCaseDataSource returned " + count + " - expected 0", count == 0); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting count with null data source ID + try { + long count = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), null); + assertTrue("getCountArtifactInstancesByCaseDataSource returned " + count + " - expected 0", count == 0); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting data source count for entry that is in all three + try { + long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(fileType, inAllDataSourcesHash); + assertTrue("getCountUniqueCaseDataSourceTuplesHavingTypeValue returned " + count + " - expected 3", count == 3); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting data source count for entry that is in one data source twice + try { + long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(fileType, inDataSource1twiceHash); + assertTrue("getCountUniqueCaseDataSourceTuplesHavingTypeValue returned " + count + " - expected 1", count == 1); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting data source count for entry that is not in any data sources + try { + long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(fileType, "abcdef"); + assertTrue("getCountUniqueCaseDataSourceTuplesHavingTypeValue returned " + count + " - expected 0", count == 0); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting data source count for null type + try { + long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(null, "abcdef"); + Assert.fail("getCountUniqueCaseDataSourceTuplesHavingTypeValue failed to throw exception for null type"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting data source count for null value + try { + long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(fileType, null); + assertTrue("getCountUniqueCaseDataSourceTuplesHavingTypeValue returned " + count + " - expected 0", count == 0); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } } /** From 3bfe08ccf918240ea6826f68bd4e8279eaeb45df Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Tue, 6 Feb 2018 14:14:29 -0500 Subject: [PATCH 52/62] Finished notable artifact tests --- .../datamodel/AbstractSqlEamDb.java | 40 +- .../datamodel/CentralRepoDatamodelTest.java | 1463 ++++++++++------- 2 files changed, 949 insertions(+), 554 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index 1517466116..18af7f6c81 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -948,6 +948,17 @@ public abstract class AbstractSqlEamDb implements EamDb { for (CorrelationAttributeInstance eamInstance : eamInstances) { if (!eamArtifact.getCorrelationValue().isEmpty()) { + + if(eamInstance.getCorrelationCase() == null) { + throw new EamDbException("Correlation attribute instance has null case"); + } + if(eamInstance.getCorrelationDataSource() == null) { + throw new EamDbException("Correlation attribute instance has null data source"); + } + if(eamInstance.getKnownStatus()== null) { + throw new EamDbException("Correlation attribute instance has null known known status"); + } + bulkPs.setString(1, eamInstance.getCorrelationCase().getCaseUUID()); bulkPs.setString(2, eamInstance.getCorrelationDataSource().getDeviceID()); bulkPs.setInt(3, eamInstance.getCorrelationDataSource().getCaseID()); @@ -1071,15 +1082,28 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public void setArtifactInstanceKnownStatus(CorrelationAttribute eamArtifact, TskData.FileKnown knownStatus) throws EamDbException { + if(eamArtifact == null) { + throw new EamDbException("Correlation attribute is null"); + } + if(knownStatus == null) { + throw new EamDbException("Known status is null"); + } if (1 != eamArtifact.getInstances().size()) { throw new EamDbException("Error: Artifact must have exactly one (1) Artifact Instance to set as notable."); // NON-NLS } - Connection conn = connect(); - List eamInstances = eamArtifact.getInstances(); CorrelationAttributeInstance eamInstance = eamInstances.get(0); + if(eamInstance.getCorrelationCase() == null) { + throw new EamDbException("Correlation case is null"); + } + if(eamInstance.getCorrelationDataSource() == null) { + throw new EamDbException("Correlation data source is null"); + } + + Connection conn = connect(); + PreparedStatement preparedUpdate = null; PreparedStatement preparedQuery = null; ResultSet resultSet = null; @@ -1162,6 +1186,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public List getArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) throws EamDbException { + if(aType == null) { + throw new EamDbException("Correlation type is null"); + } + Connection conn = connect(); List artifactInstances = new ArrayList<>(); @@ -1212,6 +1240,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public Long getCountArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) throws EamDbException { + if(aType == null) { + throw new EamDbException("Correlation type is null"); + } + Connection conn = connect(); Long badInstances = 0L; @@ -1256,6 +1288,10 @@ public abstract class AbstractSqlEamDb implements EamDb { */ @Override public List getListCasesHavingArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) throws EamDbException { + if(aType == null) { + throw new EamDbException("Correlation type is null"); + } + Connection conn = connect(); Collection caseNames = new LinkedHashSet<>(); diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index e0177f12f0..b2e05d8694 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -49,8 +49,7 @@ public class CentralRepoDatamodelTest extends TestCase { private static final String PROPERTIES_FILE = "CentralRepository"; private static final String CR_DB_NAME = "testcentralrepo.db"; - //private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest"); - private static final Path testDirectory = Paths.get("C:", "Work", "CRDatamodelTest"); // TEMP EASIER FOR TESTING + private static final Path testDirectory = Paths.get(System.getProperty("java.io.tmpdir"), "CentralRepoDatamodelTest"); SqliteEamDbSettings dbSettingsSqlite; private CorrelationCase case1; @@ -90,7 +89,7 @@ public class CentralRepoDatamodelTest extends TestCase { assertTrue("Unable to create test directory", testDirectory.toFile().exists()); // Save the current central repo settings - propertiesMap = ModuleSettings.getConfigSettings(PROPERTIES_FILE); + propertiesMap = ModuleSettings.getConfigSettings(PROPERTIES_FILE); try { dbSettingsSqlite.setDbName(CR_DB_NAME); @@ -137,7 +136,7 @@ public class CentralRepoDatamodelTest extends TestCase { EamDb.getInstance().newDataSource(dataSource2fromCase1); dataSource2fromCase1 = EamDb.getInstance().getDataSource(case1, dataSource2fromCase1.getDeviceID()); assertTrue("Failed to create test object dataSource2fromCase1", dataSource2fromCase1 != null); - + dataSource1fromCase2 = new CorrelationDataSource(case2.getID(), "dataSource3_deviceID", "dataSource3"); EamDb.getInstance().newDataSource(dataSource1fromCase2); dataSource1fromCase2 = EamDb.getInstance().getDataSource(case2, dataSource1fromCase2.getDeviceID()); @@ -148,7 +147,7 @@ public class CentralRepoDatamodelTest extends TestCase { org2 = new EamOrganization("org2"); org2.setOrgID((int) EamDb.getInstance().newOrganization(org2)); - + // Store the file type object for later use fileType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID); assertTrue("getCorrelationTypeById(FILES_TYPE_ID) returned null", fileType != null); @@ -169,33 +168,291 @@ public class CentralRepoDatamodelTest extends TestCase { // Close and delete the test case and central repo db try { EamDb.getInstance().shutdownConnections(); - FileUtils.deleteDirectory(testDirectory.toFile()); - } catch (EamDbException | IOException ex) { - // } catch (EamDbException ex) { // TEMP FOR LOOKING AT DB Exceptions.printStackTrace(ex); Assert.fail(ex); } assertFalse("Error deleting test directory " + testDirectory.toString(), testDirectory.toFile().exists()); } - + /** - * Test the module settings + * Test the notable status of artifacts + * addArtifact(CorrelationAttribute eamArtifact) tests: + * - Test that two artifacts created with BAD status still have it when fetched from the database + * - Test that two artifacts created with BAD and KNOWN status still have the correct status when fetched from the database + * setArtifactInstanceKnownStatus(CorrelationAttribute eamArtifact, TskData.FileKnown knownStatus) tests: + * - Test updating status + * - Test updating artifact with two instances + * - Test updating null artifact + * - Test updating artifact with null known status + * - Test updating artifact with null case + * - Test updating artifact with null data source + * getArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) tests: + * - Test getting two notable instances + * - Test getting notable instances where one instance is notable and the other is known + * - Test getting notable instances with null type + * - Test getting notable instances with null value + * getCountArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) tests: + * - Test getting count of two notable instances + * - Test getting notable instance count where one instance is notable and the other is known + * - Test getting notable instance count with null type + * - Test getting notable instance count with null value + * getListCasesHavingArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) tests: + * - Test getting cases with notable instances (all instances are notable) + * - Test getting cases with notable instances (only one instance is notable) + * - Test getting cases with null type + * - Test getting cases with null value */ - public void atestSettings(){ - // Maybe + public void testNotableArtifactStatus() { + + String notableHashInBothCases = "e34a8899ef6468b74f8a1048419ccc8b"; + String notableHashInOneCaseKnownOther = "d293f2f5cebcb427cde3bb95db5e1797"; + String hashToChangeToNotable = "23bd4ea37ec6304e75ac723527472a0f"; + + // Add two instances with notable status + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, notableHashInBothCases); + attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase1, "path1", + "", TskData.FileKnown.BAD)); + attr.addInstance(new CorrelationAttributeInstance(case2, dataSource1fromCase2, "path2", + "", TskData.FileKnown.BAD)); + EamDb.getInstance().addArtifact(attr); + + List attrs = EamDb.getInstance().getArtifactInstancesByTypeValue(fileType, notableHashInBothCases); + assertTrue("getArtifactInstancesByTypeValue returned " + attrs.size() + " values - expected 2", attrs.size() == 2); + for (CorrelationAttributeInstance a : attrs) { + assertTrue("Artifact did not have expected BAD status", a.getKnownStatus().equals(TskData.FileKnown.BAD)); + } + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Add two instances with one notable, one known + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, notableHashInOneCaseKnownOther); + attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase1, "path3", + "", TskData.FileKnown.BAD)); + attr.addInstance(new CorrelationAttributeInstance(case2, dataSource1fromCase2, "path4", + "", TskData.FileKnown.KNOWN)); + EamDb.getInstance().addArtifact(attr); + + List attrs = EamDb.getInstance().getArtifactInstancesByTypeValue(fileType, notableHashInOneCaseKnownOther); + assertTrue("getArtifactInstancesByTypeValue returned " + attrs.size() + " values - expected 2", attrs.size() == 2); + for (CorrelationAttributeInstance a : attrs) { + if (case1.getCaseUUID().equals(a.getCorrelationCase().getCaseUUID())) { + assertTrue("Artifact did not have expected BAD status", a.getKnownStatus().equals(TskData.FileKnown.BAD)); + } else if (case2.getCaseUUID().equals(a.getCorrelationCase().getCaseUUID())) { + assertTrue("Artifact did not have expected KNOWN status", a.getKnownStatus().equals(TskData.FileKnown.KNOWN)); + } else { + Assert.fail("getArtifactInstancesByTypeValue returned unexpected case"); + } + } + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Add an artifact and then update its status + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, hashToChangeToNotable); + attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase2, "path5", + "", TskData.FileKnown.KNOWN)); + EamDb.getInstance().addArtifact(attr); + + EamDb.getInstance().setArtifactInstanceKnownStatus(attr, TskData.FileKnown.BAD); + + List attrs = EamDb.getInstance().getArtifactInstancesByTypeValue(fileType, hashToChangeToNotable); + assertTrue("getArtifactInstancesByTypeValue returned " + attrs.size() + " values - expected 1", attrs.size() == 1); + assertTrue("Artifact status did not change to BAD", attrs.get(0).getKnownStatus().equals(TskData.FileKnown.BAD)); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + return; + } + + // Try to update artifact with two CorrelationAttributeInstance instances + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, "badHash"); + attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase1, "badPath", + "", TskData.FileKnown.KNOWN)); + attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase2, "badPath", + "", TskData.FileKnown.KNOWN)); + + EamDb.getInstance().setArtifactInstanceKnownStatus(attr, TskData.FileKnown.BAD); + Assert.fail("setArtifactInstanceKnownStatus failed to throw exception for multiple Correlation Attribute Instances"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Try to update null artifact + try { + EamDb.getInstance().setArtifactInstanceKnownStatus(null, TskData.FileKnown.BAD); + Assert.fail("setArtifactInstanceKnownStatus failed to throw exception for null correlation attribute"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Try to update artifact with null known status + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, "badHash"); + attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase1, "badPath", + "", TskData.FileKnown.KNOWN)); + + EamDb.getInstance().setArtifactInstanceKnownStatus(attr, null); + Assert.fail("setArtifactInstanceKnownStatus failed to throw exception for null known status"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Try to update artifact with null case + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, "badHash"); + attr.addInstance(new CorrelationAttributeInstance(null, dataSource1fromCase1, "badPath", + "", TskData.FileKnown.KNOWN)); + + EamDb.getInstance().setArtifactInstanceKnownStatus(attr, TskData.FileKnown.BAD); + Assert.fail("setArtifactInstanceKnownStatus failed to throw exception for null case"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Try to update artifact with null data source + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, "badHash"); + attr.addInstance(new CorrelationAttributeInstance(case1, null, "badPath", + "", TskData.FileKnown.KNOWN)); + + EamDb.getInstance().setArtifactInstanceKnownStatus(attr, TskData.FileKnown.BAD); + Assert.fail("setArtifactInstanceKnownStatus failed to throw exception for null case"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting two notable instances + try { + List attrs = EamDb.getInstance().getArtifactInstancesKnownBad(fileType, notableHashInBothCases); + assertTrue("getArtifactInstancesKnownBad returned " + attrs.size() + " values - expected 2", attrs.size() == 2); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting notable instances where one instance is notable and the other is known + try { + List attrs = EamDb.getInstance().getArtifactInstancesKnownBad(fileType, notableHashInOneCaseKnownOther); + assertTrue("getArtifactInstancesKnownBad returned " + attrs.size() + " values - expected 1", attrs.size() == 1); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting notable instances with null type + try { + List attrs = EamDb.getInstance().getArtifactInstancesKnownBad(null, notableHashInOneCaseKnownOther); + Assert.fail("getArtifactInstancesKnownBad failed to throw exception for null type"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting notable instances with null value (should work fine) + try { + List attrs = EamDb.getInstance().getArtifactInstancesKnownBad(fileType, null); + assertTrue("getArtifactInstancesKnownBad returned " + attrs.size() + " values - expected ", attrs.size() == 0); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting count of two notable instances + try { + long count = EamDb.getInstance().getCountArtifactInstancesKnownBad(fileType, notableHashInBothCases); + assertTrue("getCountArtifactInstancesKnownBad returned " + count + " values - expected 2", count == 2); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting notable instance count where one instance is notable and the other is known + try { + long count = EamDb.getInstance().getCountArtifactInstancesKnownBad(fileType, notableHashInOneCaseKnownOther); + assertTrue("getCountArtifactInstancesKnownBad returned " + count + " values - expected 1", count == 1); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting notable instance count with null type + try { + EamDb.getInstance().getCountArtifactInstancesKnownBad(null, notableHashInOneCaseKnownOther); + Assert.fail("getCountArtifactInstancesKnownBad failed to throw exception for null type"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting notable instance count with null value (should work fine) + try { + long count = EamDb.getInstance().getCountArtifactInstancesKnownBad(fileType, null); + assertTrue("getCountArtifactInstancesKnownBad returned " + count + " values - expected ", count == 0); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting cases with notable instances (all instances are notable) + try { + List cases = EamDb.getInstance().getListCasesHavingArtifactInstancesKnownBad(fileType, notableHashInBothCases); + assertTrue("getListCasesHavingArtifactInstancesKnownBad returned " + cases.size() + " values - expected 2", cases.size() == 2); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting cases with notable instances (only one instance is notable) + try { + List cases = EamDb.getInstance().getListCasesHavingArtifactInstancesKnownBad(fileType, notableHashInOneCaseKnownOther); + assertTrue("getListCasesHavingArtifactInstancesKnownBad returned " + cases.size() + " values - expected 1", cases.size() == 1); + assertTrue("getListCasesHavingArtifactInstancesKnownBad returned unexpected case " + cases.get(0), case1.getDisplayName().equals(cases.get(0))); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } + + // Test getting cases with null type + try { + EamDb.getInstance().getListCasesHavingArtifactInstancesKnownBad(null, notableHashInOneCaseKnownOther); + Assert.fail("getListCasesHavingArtifactInstancesKnownBad failed to throw exception for null type"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test getting cases with null value (should work fine) + try { + List cases = EamDb.getInstance().getListCasesHavingArtifactInstancesKnownBad(fileType, null); + assertTrue("getListCasesHavingArtifactInstancesKnownBad returned " + cases.size() + " values - expected ", cases.isEmpty()); + } catch (EamDbException ex) { + Exceptions.printStackTrace(ex); + Assert.fail(ex); + } } - + /** - * Test the methods associated with bulk artifacts - * First test the normal use case of a large number of valid artifacts getting added + * Test the methods associated with bulk artifacts (prepareBulkArtifact and + * bulkInsertArtifacts). + * First test the normal use case of a large number of valid artifacts getting added. * Next test the error conditions: - * + * - Test preparing artifact with null type + * - Test preparing artifact with null case + * - Test preparing artifact with null data source + * - Test preparing artifact with null path + * - Test preparing artifact with null known status */ public void testBulkArtifacts() { - - // Test bulk artifacts + + // Test normal addition of bulk artifacts // Steps: // - Make a list of artifacts roughly half the threshold size // - Call prepareBulkArtifact on all of them @@ -209,76 +466,164 @@ public class CentralRepoDatamodelTest extends TestCase { // Make sure there are no artifacts in the database to start long originalArtifactCount = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), dataSource1fromCase1.getDeviceID()); assertTrue("getCountArtifactInstancesByCaseDataSource returned non-zero count", originalArtifactCount == 0); - + // Create the first list, which will have (bulkThreshold / 2) entries List list1 = new ArrayList<>(); - for(int i = 0; i < dbSettingsSqlite.getBulkThreshold() / 2;i++) { + for (int i = 0; i < dbSettingsSqlite.getBulkThreshold() / 2; i++) { String value = "bulkInsertValue1_" + String.valueOf(i); String path = "C:\\bulkInsertPath1\\file" + String.valueOf(i); - + CorrelationAttribute attr = new CorrelationAttribute(fileType, value); attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase1, path)); list1.add(attr); } - + // Queue up the current list. There should not be enough to trigger the insert - for(CorrelationAttribute attr:list1){ + for (CorrelationAttribute attr : list1) { EamDb.getInstance().prepareBulkArtifact(attr); } - + // Check that nothing has been written yet - assertTrue("Artifacts written to database before threshold was reached", + assertTrue("Artifacts written to database before threshold was reached", originalArtifactCount == EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), dataSource1fromCase1.getDeviceID())); // Make a second list with length equal to bulkThreshold List list2 = new ArrayList<>(); - for(int i = 0; i < dbSettingsSqlite.getBulkThreshold();i++) { + for (int i = 0; i < dbSettingsSqlite.getBulkThreshold(); i++) { String value = "bulkInsertValue2_" + String.valueOf(i); String path = "C:\\bulkInsertPath2\\file" + String.valueOf(i); - + CorrelationAttribute attr = new CorrelationAttribute(fileType, value); attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase1, path)); list2.add(attr); } - + // Queue up the current list. This will trigger an insert partway through - for(CorrelationAttribute attr:list2){ + for (CorrelationAttribute attr : list2) { EamDb.getInstance().prepareBulkArtifact(attr); } - + // There should now be bulkThreshold artifacts in the database long count = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), dataSource1fromCase1.getDeviceID()); assertTrue("Artifact count " + count + " does not match bulkThreshold " + dbSettingsSqlite.getBulkThreshold(), count == dbSettingsSqlite.getBulkThreshold()); - + // Now call bulkInsertArtifacts() to insert the rest of queue EamDb.getInstance().bulkInsertArtifacts(); count = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), dataSource1fromCase1.getDeviceID()); int expectedCount = list1.size() + list2.size(); assertTrue("Artifact count " + count + " does not match expected count " + expectedCount, count == expectedCount); - + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test preparing artifact with null type - try{ + try { CorrelationAttribute attr = new CorrelationAttribute(null, "value"); EamDb.getInstance().prepareBulkArtifact(attr); Assert.fail("prepareBulkArtifact failed to throw exception for null type"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test preparing artifact with null case + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, "value"); + attr.addInstance(new CorrelationAttributeInstance(null, dataSource1fromCase1, "path")); + EamDb.getInstance().prepareBulkArtifact(attr); + EamDb.getInstance().bulkInsertArtifacts(); + Assert.fail("bulkInsertArtifacts failed to throw exception for null case"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test preparing artifact with null data source + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, "value"); + attr.addInstance(new CorrelationAttributeInstance(case1, null, "path")); + EamDb.getInstance().prepareBulkArtifact(attr); + EamDb.getInstance().bulkInsertArtifacts(); + Assert.fail("prepareBulkArtifact failed to throw exception for null data source"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test preparing artifact with null path + // CorrelationAttributeInstance will throw an exception + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, "value"); + attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase1, null)); + Assert.fail("CorrelationAttributeInstance failed to throw exception for null path"); + } catch (EamDbException ex) { + // This is the expected behavior + } + + // Test preparing artifact with null known status + try { + CorrelationAttribute attr = new CorrelationAttribute(fileType, "value"); + attr.addInstance(new CorrelationAttributeInstance(case1, dataSource1fromCase1, "path", "comment", null)); + EamDb.getInstance().prepareBulkArtifact(attr); + EamDb.getInstance().bulkInsertArtifacts(); + Assert.fail("prepareBulkArtifact failed to throw exception for null known status"); + } catch (EamDbException ex) { // This is the expected behavior } - - - } - + /** - * Test methods related to artifacts + * Test most methods related to artifacts + * addArtifact(CorrelationAttribute eamArtifact) tests: + * - Test adding artifact with one instance + * - Test adding artifact with one instance in each data source + * - Test adding artifact with two instances in the same data source + * - Test adding email artifact + * - Test adding phone artifact + * - Test adding domain artifact + * - Test adding device artifact + * - Test adding artifact with null case + * - Test adding artifact with invalid case ID + * - Test adding artifact with null data source + * - Test adding artifact with invalid data source ID + * - Test adding artifact with null path + * - Test adding artifact with null known status + * - Test adding artifact with null correlation type + * - Test adding artifact with null value + * getArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value) tests: + * - Test getting three expected instances + * - Test getting no expected instances + * - Test with null type + * - Test with null value + * getArtifactInstancesByPath(CorrelationAttribute.Type aType, String filePath) tests: + * - Test with existing path + * - Test with non-existent path + * - Test with null type + * - Test with null path + * getCountArtifactInstancesByTypeValue(CorrelationAttribute.Type aType, String value) tests: + * - Test getting three expected instances + * - Test getting no expected instances + * - Test with null type + * - Test with null value + * getFrequencyPercentage(CorrelationAttribute corAttr) tests: + * - Test value in every data source + * - Test value in one data source twice + * - Test email + * - Test value in no data sources + * - Test with null type + * - Test with null attribute + * getCountArtifactInstancesByCaseDataSource(String caseUUID, String dataSourceID) tests: + * - Test data source with seven instances + * - Test with null case UUID + * - Test with null device ID + * getCountUniqueCaseDataSourceTuplesHavingTypeValue(CorrelationAttribute.Type aType, String value) tests: + * - Test value in every data source + * - Test value in one data source twice + * - Test value in no data sources + * - Test with null type + * - Test with null value */ public void testArtifacts() { - + String inAllDataSourcesHash = "6cddb0e31787b79cfdcc0676b98a71ce"; String inAllDataSourcesPath = "C:\\files\\path0.txt"; String inDataSource1twiceHash = "b2f5ff47436671b6e533d8dc3614845d"; @@ -286,7 +631,7 @@ public class CentralRepoDatamodelTest extends TestCase { String inDataSource1twicePath2 = "C:\\files\\path2.txt"; String onlyInDataSource3Hash = "2af54305f183778d87de0c70c591fae4"; String onlyInDataSource3Path = "C:\\files\\path3.txt"; - + // These will all go in dataSource1fromCase1 String emailValue = "test@gmail.com"; String emailPath = "C:\\files\\emailPath.txt"; @@ -296,10 +641,9 @@ public class CentralRepoDatamodelTest extends TestCase { String domainPath = "C:\\files\\domainPath.txt"; String devIdValue = "94B21234"; String devIdPath = "C:\\files\\devIdPath.txt"; - + // Store the email type CorrelationAttribute.Type emailType; - try { emailType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.EMAIL_TYPE_ID); } catch (EamDbException ex) { @@ -307,20 +651,20 @@ public class CentralRepoDatamodelTest extends TestCase { Assert.fail(ex); return; } - + // Test adding attribute with one instance - try{ + try { CorrelationAttribute attr = new CorrelationAttribute(fileType, onlyInDataSource3Hash); CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case2, dataSource1fromCase2, onlyInDataSource3Path); attr.addInstance(inst); EamDb.getInstance().addArtifact(attr); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test adding attribute with an instance in each data source - try{ + try { CorrelationAttribute attr = new CorrelationAttribute(fileType, inAllDataSourcesHash); CorrelationAttributeInstance inst1 = new CorrelationAttributeInstance(case1, dataSource1fromCase1, inAllDataSourcesPath); attr.addInstance(inst1); @@ -329,74 +673,73 @@ public class CentralRepoDatamodelTest extends TestCase { CorrelationAttributeInstance inst3 = new CorrelationAttributeInstance(case2, dataSource1fromCase2, inAllDataSourcesPath); attr.addInstance(inst3); EamDb.getInstance().addArtifact(attr); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test adding attribute with two instances in one data source - try{ + try { CorrelationAttribute attr = new CorrelationAttribute(fileType, inDataSource1twiceHash); CorrelationAttributeInstance inst1 = new CorrelationAttributeInstance(case1, dataSource1fromCase1, inDataSource1twicePath1); attr.addInstance(inst1); CorrelationAttributeInstance inst2 = new CorrelationAttributeInstance(case1, dataSource1fromCase1, inDataSource1twicePath2); attr.addInstance(inst2); EamDb.getInstance().addArtifact(attr); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test adding the other types // Test adding an email artifact - try{ + try { CorrelationAttribute attr = new CorrelationAttribute(emailType, emailValue); CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, emailPath); attr.addInstance(inst); EamDb.getInstance().addArtifact(attr); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test adding a phone artifact - try{ - CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.PHONE_TYPE_ID), + try { + CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.PHONE_TYPE_ID), phoneValue); CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, phonePath); attr.addInstance(inst); EamDb.getInstance().addArtifact(attr); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test adding a domain artifact - try{ - CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.DOMAIN_TYPE_ID), + try { + CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.DOMAIN_TYPE_ID), domainValue); CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, domainPath); attr.addInstance(inst); EamDb.getInstance().addArtifact(attr); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test adding a device ID artifact - try{ - CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.USBID_TYPE_ID), + try { + CorrelationAttribute attr = new CorrelationAttribute(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.USBID_TYPE_ID), devIdValue); CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, devIdPath); attr.addInstance(inst); EamDb.getInstance().addArtifact(attr); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test CorrelationAttributeInstance failure cases - // Create an attribute to use in the next few tests CorrelationAttribute failAttr; try { @@ -406,103 +749,102 @@ public class CentralRepoDatamodelTest extends TestCase { Assert.fail(ex); return; } - + // Test adding instance with null case - try{ + try { CorrelationAttributeInstance inst = new CorrelationAttributeInstance(null, dataSource1fromCase2, "badPath"); failAttr.addInstance(inst); EamDb.getInstance().addArtifact(failAttr); Assert.fail("addArtifact failed to throw exception for null case"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test adding instance with invalid case ID - try{ + try { CorrelationCase badCase = new CorrelationCase("badCaseUuid", "badCaseName"); CorrelationAttributeInstance inst = new CorrelationAttributeInstance(badCase, dataSource1fromCase2, "badPath"); failAttr.addInstance(inst); EamDb.getInstance().addArtifact(failAttr); Assert.fail("addArtifact failed to throw exception for invalid case"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test adding instance with null data source - try{ + try { CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, null, "badPath"); failAttr.addInstance(inst); EamDb.getInstance().addArtifact(failAttr); Assert.fail("addArtifact failed to throw exception for null data source"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test adding instance with invalid data source ID - try{ + try { CorrelationDataSource badDS = new CorrelationDataSource(case1.getID(), "badDSUuid", "badDSName"); CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, badDS, "badPath"); failAttr.addInstance(inst); EamDb.getInstance().addArtifact(failAttr); Assert.fail("addArtifact failed to throw exception for invalid data source"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test adding instance with null path // This will fail in the CorrelationAttributeInstance constructor - try{ + try { CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, null); Assert.fail("CorrelationAttributeInstance failed to throw exception for null path"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test adding instance with null known status - try{ + try { CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, null, "comment", null); failAttr.addInstance(inst); EamDb.getInstance().addArtifact(failAttr); Assert.fail("addArtifact failed to throw exception for null known status"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test CorrelationAttribute failure cases - // Test null type - try{ + try { CorrelationAttribute attr = new CorrelationAttribute(null, "badInstances"); EamDb.getInstance().addArtifact(attr); Assert.fail("addArtifact failed to throw exception for null type"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test null value // This will fail in the CorrelationAttribute constructor - try{ + try { CorrelationAttribute attr = new CorrelationAttribute(fileType, null); Assert.fail("addArtifact failed to throw exception for null value"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting instances with expected resuls try { List instances = EamDb.getInstance().getArtifactInstancesByTypeValue(fileType, inAllDataSourcesHash); assertTrue("getArtifactInstancesByTypeValue returned " + instances.size() + " results - expected 3", instances.size() == 3); - + // This test works because all the instances of this hash were set to the same path - for(CorrelationAttributeInstance inst:instances) { - assertTrue("getArtifactInstancesByTypeValue returned instance with unexpected path " + inst.getFilePath(), + for (CorrelationAttributeInstance inst : instances) { + assertTrue("getArtifactInstancesByTypeValue returned instance with unexpected path " + inst.getFilePath(), inAllDataSourcesPath.equalsIgnoreCase(inst.getFilePath())); } } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting instances expecting no results try { List instances = EamDb.getInstance().getArtifactInstancesByTypeValue( @@ -512,7 +854,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting instances with null type try { List instances = EamDb.getInstance().getArtifactInstancesByTypeValue(null, inAllDataSourcesHash); @@ -520,7 +862,7 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting instances with null value // Should just return nothing try { @@ -530,7 +872,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting instances with path that should produce results try { List instances = EamDb.getInstance().getArtifactInstancesByPath(fileType, inAllDataSourcesPath); @@ -539,7 +881,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting instances with path that should not produce results try { List instances = EamDb.getInstance().getArtifactInstancesByPath(fileType, "xyz"); @@ -548,7 +890,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting instances with null type try { List instances = EamDb.getInstance().getArtifactInstancesByPath(null, inAllDataSourcesPath); @@ -556,15 +898,15 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { // This is the expected behavior } - - // Test getting instances with null value + + // Test getting instances with null path try { List instances = EamDb.getInstance().getArtifactInstancesByPath(fileType, null); - Assert.fail("getArtifactInstancesByPath failed to throw exception for null value"); + Assert.fail("getArtifactInstancesByPath failed to throw exception for null path"); } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting instance count with path that should produce results try { long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(fileType, inAllDataSourcesHash); @@ -573,7 +915,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting instance count with path that should not produce results try { long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(fileType, "xyz"); @@ -582,7 +924,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting instance count with null type try { long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(null, inAllDataSourcesHash); @@ -590,7 +932,7 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting instance count with null value try { long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(fileType, null); @@ -598,7 +940,7 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting frequency of value that is in all three data sources try { CorrelationAttribute attr = new CorrelationAttribute(fileType, inAllDataSourcesHash); @@ -608,7 +950,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting frequency of value that appears twice in a single data source try { CorrelationAttribute attr = new CorrelationAttribute(fileType, inDataSource1twiceHash); @@ -618,7 +960,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting frequency of non-file type try { CorrelationAttribute attr = new CorrelationAttribute(emailType, emailValue); @@ -628,7 +970,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting frequency of non-existent value try { CorrelationAttribute attr = new CorrelationAttribute(fileType, "randomValue"); @@ -638,7 +980,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting frequency with null type try { CorrelationAttribute attr = new CorrelationAttribute(null, "randomValue"); @@ -647,7 +989,7 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting frequency with null attribute try { int freq = EamDb.getInstance().getFrequencyPercentage(null); @@ -655,7 +997,7 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting count for dataSource1fromCase1 (includes all types) try { long count = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), dataSource1fromCase1.getDeviceID()); @@ -664,7 +1006,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting count with null case UUID try { long count = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(null, dataSource1fromCase1.getDeviceID()); @@ -673,8 +1015,8 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - - // Test getting count with null data source ID + + // Test getting count with null device ID try { long count = EamDb.getInstance().getCountArtifactInstancesByCaseDataSource(case1.getCaseUUID(), null); assertTrue("getCountArtifactInstancesByCaseDataSource returned " + count + " - expected 0", count == 0); @@ -682,7 +1024,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting data source count for entry that is in all three try { long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(fileType, inAllDataSourcesHash); @@ -691,7 +1033,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting data source count for entry that is in one data source twice try { long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(fileType, inDataSource1twiceHash); @@ -700,7 +1042,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting data source count for entry that is not in any data sources try { long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(fileType, "abcdef"); @@ -709,7 +1051,7 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting data source count for null type try { long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(null, "abcdef"); @@ -717,7 +1059,7 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting data source count for null value try { long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(fileType, null); @@ -727,211 +1069,211 @@ public class CentralRepoDatamodelTest extends TestCase { Assert.fail(ex); } } - + /** * Test methods related to correlation types - * newCorrelationType(CorrelationAttribute.Type newType) tests: - * - Test with valid data - * - Test with duplicate data - * - Test with null name - * - Test with null db name + * newCorrelationType(CorrelationAttribute.Type newType) tests: + * - Test with valid data + * - Test with duplicate data + * - Test with null name + * - Test with null db name + * - Test with null type + * getDefinedCorrelationTypes() tests: + * - Test that the expected number are returned + * getEnabledCorrelationTypes() tests: + * - Test that the expected number are returned + * getSupportedCorrelationTypes() tests: + * - Test that the expected number are returned + * getCorrelationTypeById(int typeId) tests: + * - Test with valid ID + * - Test with invalid ID + * updateCorrelationType(CorrelationAttribute.Type aType) tests: + * - Test with existing type + * - Test with non-existent type + * - Test updating to null name * - Test with null type - * getDefinedCorrelationTypes() tests: - * - Test that the expected number are returned - * getEnabledCorrelationTypes() tests: - * - Test that the expected number are returned - * getSupportedCorrelationTypes() tests: - * - Test that the expected number are returned - * getCorrelationTypeById(int typeId) tests: - * - Test with valid ID - * - Test with invalid ID - * updateCorrelationType(CorrelationAttribute.Type aType) tests: - * - Test with existing type - * - Test with non-existent type - * - Test updating to null name - * - Test with null type */ - public void atestCorrelationTypes() { - + public void testCorrelationTypes() { + CorrelationAttribute.Type customType; String customTypeName = "customType"; String customTypeDb = "custom_type"; - + // Test new type with valid data - try{ + try { customType = new CorrelationAttribute.Type(customTypeName, customTypeDb, false, false); customType.setId(EamDb.getInstance().newCorrelationType(customType)); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); return; } - + // Test new type with duplicate data - try{ + try { CorrelationAttribute.Type temp = new CorrelationAttribute.Type(customTypeName, customTypeDb, false, false); EamDb.getInstance().newCorrelationType(temp); Assert.fail("newCorrelationType failed to throw exception for duplicate name/db table"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test new type with null name - try{ + try { CorrelationAttribute.Type temp = new CorrelationAttribute.Type(null, "temp_type", false, false); EamDb.getInstance().newCorrelationType(temp); Assert.fail("newCorrelationType failed to throw exception for null name table"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test new type with null db name // The constructor should fail in this case - try{ + try { CorrelationAttribute.Type temp = new CorrelationAttribute.Type("temp", null, false, false); Assert.fail("CorrelationAttribute.Type failed to throw exception for null db table name"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test new type with null type - try{ + try { EamDb.getInstance().newCorrelationType(null); Assert.fail("newCorrelationType failed to throw exception for null type"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting all correlation types - try{ + try { List types = EamDb.getInstance().getDefinedCorrelationTypes(); - + // We expect 6 total - 5 default and the custom one made earlier assertTrue("getDefinedCorrelationTypes returned " + types.size() + " entries - expected 6", types.size() == 6); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting enabled correlation types - try{ + try { List types = EamDb.getInstance().getEnabledCorrelationTypes(); - + // We expect 5 - the custom type is disabled assertTrue("getDefinedCorrelationTypes returned " + types.size() + " enabled entries - expected 5", types.size() == 5); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting supported correlation types - try{ + try { List types = EamDb.getInstance().getSupportedCorrelationTypes(); - + // We expect 5 - the custom type is not supported assertTrue("getDefinedCorrelationTypes returned " + types.size() + " supported entries - expected 5", types.size() == 5); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting the type with a valid ID - try{ + try { CorrelationAttribute.Type temp = EamDb.getInstance().getCorrelationTypeById(customType.getId()); assertTrue("getCorrelationTypeById returned type with unexpected name " + temp.getDisplayName(), customTypeName.equals(temp.getDisplayName())); assertTrue("getCorrelationTypeById returned type with unexpected db table name " + temp.getDbTableName(), customTypeDb.equals(temp.getDbTableName())); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting the type with a invalid ID - try{ + try { CorrelationAttribute.Type temp = EamDb.getInstance().getCorrelationTypeById(5555); Assert.fail("getCorrelationTypeById failed to throw exception for invalid ID"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } // Test updating a valid type - try{ + try { String newName = "newName"; String newDbTable = "new_db_table"; customType.setDisplayName(newName); customType.setDbTableName(newDbTable); customType.setEnabled(true); // These were originally false customType.setSupported(true); - + EamDb.getInstance().updateCorrelationType(customType); - + // Get a fresh copy from the database CorrelationAttribute.Type temp = EamDb.getInstance().getCorrelationTypeById(customType.getId()); - + assertTrue("updateCorrelationType failed to update name", newName.equals(temp.getDisplayName())); assertTrue("updateCorrelationType failed to update db table name", newDbTable.equals(temp.getDbTableName())); assertTrue("updateCorrelationType failed to update enabled status", temp.isEnabled()); assertTrue("updateCorrelationType failed to update supported status", temp.isSupported()); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test updating a type with an invalid ID // Nothing should happen - try{ - CorrelationAttribute.Type temp= new CorrelationAttribute.Type(customTypeName, customTypeDb, false, false); + try { + CorrelationAttribute.Type temp = new CorrelationAttribute.Type(customTypeName, customTypeDb, false, false); temp.setId(12345); EamDb.getInstance().updateCorrelationType(temp); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test updating a type to a null name - try{ + try { customType.setDisplayName(null); EamDb.getInstance().updateCorrelationType(customType); Assert.fail("updateCorrelationType failed to throw exception for null name"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test updating a null type - try{ + try { customType.setDisplayName(null); EamDb.getInstance().updateCorrelationType(customType); Assert.fail("updateCorrelationType failed to throw exception for null type"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } } - + /** - * Test the methods related to organizations + * Test the methods related to organizations * newOrganization(EamOrganization eamOrg) tests: * - Test with just org name - * - Test with org name and poc info - * - Test adding duplicate org - * - Test adding null org - * - Test adding org with null name - * getOrganizations() tests: - * - Test getting the list of orgs -* getOrganizationByID(int orgID) tests: -* - Test with valid ID -* - Test with invalid ID -* updateOrganization(EamOrganization updatedOrganization) tests: -* - Test updating valid org -* - Test updating invalid org -* - Test updating null org -* - Test updating org to null name -* deleteOrganization(EamOrganization organizationToDelete) tests: -* - Test deleting org that isn't in use -* - Test deleting org that is in use -* - Test deleting invalid org -* - Test deleting null org + * - Test with org name and poc info + * - Test adding duplicate org + * - Test adding null org + * - Test adding org with null name + * getOrganizations() tests: + * - Test getting the list of orgs + * getOrganizationByID(int orgID) tests: + * - Test with valid ID + * - Test with invalid ID + * updateOrganization(EamOrganization updatedOrganization) tests: + * - Test updating valid org + * - Test updating invalid org + * - Test updating null org + * - Test updating org to null name + * deleteOrganization(EamOrganization organizationToDelete) tests: + * - Test deleting org that isn't in use + * - Test deleting org that is in use + * - Test deleting invalid org + * - Test deleting null org */ - public void atestOrganizations() { - + public void testOrganizations() { + EamOrganization orgA; String orgAname = "orgA"; EamOrganization orgB; @@ -939,89 +1281,89 @@ public class CentralRepoDatamodelTest extends TestCase { String orgBpocName = "pocName"; String orgBpocEmail = "pocEmail"; String orgBpocPhone = "pocPhone"; - + // Test adding a basic organization - try{ + try { orgA = new EamOrganization(orgAname); orgA.setOrgID((int) EamDb.getInstance().newOrganization(orgA)); assertTrue("Organization ID is still -1 after adding to db", orgA.getOrgID() != -1); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); return; } - + // Test adding an organization with additional fields - try{ + try { orgB = new EamOrganization(orgBname, orgBpocName, orgBpocEmail, orgBpocPhone); orgB.setOrgID((int) EamDb.getInstance().newOrganization(orgB)); assertTrue("Organization ID is still -1 after adding to db", orgB.getOrgID() != -1); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); return; } - + // Test adding a duplicate organization - try{ + try { EamOrganization temp = new EamOrganization(orgAname); EamDb.getInstance().newOrganization(temp); Assert.fail("newOrganization failed to throw exception for duplicate org name"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test adding null organization - try{ + try { EamDb.getInstance().newOrganization(null); Assert.fail("newOrganization failed to throw exception for null org"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test adding organization with null name - try{ + try { EamOrganization temp = new EamOrganization(null); EamDb.getInstance().newOrganization(temp); Assert.fail("newOrganization failed to throw exception for null name"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting organizations // We expect five - the default org, two from setUp, and two from this method - try{ + try { List orgs = EamDb.getInstance().getOrganizations(); assertTrue("getOrganizations returned null list", orgs != null); assertTrue("getOrganizations returned " + orgs.size() + " orgs - expected 5", orgs.size() == 5); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting org with valid ID - try{ + try { EamOrganization temp = EamDb.getInstance().getOrganizationByID(orgB.getOrgID()); assertTrue("getOrganizationByID returned null for valid ID", temp != null); assertTrue("getOrganizationByID returned unexpected name for organization", orgBname.equals(temp.getName())); assertTrue("getOrganizationByID returned unexpected poc name for organization", orgBpocName.equals(temp.getPocName())); assertTrue("getOrganizationByID returned unexpected poc email for organization", orgBpocEmail.equals(temp.getPocEmail())); assertTrue("getOrganizationByID returned unexpected poc phone for organization", orgBpocPhone.equals(temp.getPocPhone())); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting org with invalid ID - try{ + try { EamOrganization temp = EamDb.getInstance().getOrganizationByID(12345); Assert.fail("getOrganizationByID failed to throw exception for invalid ID"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test updating valid org - try{ + try { String newName = "newOrgName"; String newPocName = "newPocName"; String newPocEmail = "newPocEmail"; @@ -1030,141 +1372,141 @@ public class CentralRepoDatamodelTest extends TestCase { orgA.setPocName(newPocName); orgA.setPocEmail(newPocEmail); orgA.setPocPhone(newPocPhone); - + EamDb.getInstance().updateOrganization(orgA); - + EamOrganization copyOfA = EamDb.getInstance().getOrganizationByID(orgA.getOrgID()); - + assertTrue("getOrganizationByID returned null for valid ID", copyOfA != null); assertTrue("updateOrganization failed to update org name", newName.equals(copyOfA.getName())); assertTrue("updateOrganization failed to update poc name", newPocName.equals(copyOfA.getPocName())); assertTrue("updateOrganization failed to update poc email", newPocEmail.equals(copyOfA.getPocEmail())); assertTrue("updateOrganization failed to update poc phone", newPocPhone.equals(copyOfA.getPocPhone())); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test updating invalid org // Shouldn't do anything - try{ + try { EamOrganization temp = new EamOrganization("invalidOrg"); temp.setOrgID(3434); EamDb.getInstance().updateOrganization(temp); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test updating null org - try{ + try { EamDb.getInstance().updateOrganization(null); Assert.fail("updateOrganization failed to throw exception for null org"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test updating org to null name - try{ + try { EamOrganization copyOfA = EamDb.getInstance().getOrganizationByID(orgA.getOrgID()); copyOfA.setName(null); EamDb.getInstance().updateOrganization(copyOfA); Assert.fail("updateOrganization failed to throw exception for null name"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test deleting existing org that isn't in use - try{ + try { EamOrganization orgToDelete = new EamOrganization("deleteThis"); - orgToDelete.setOrgID((int)EamDb.getInstance().newOrganization(orgToDelete)); + orgToDelete.setOrgID((int) EamDb.getInstance().newOrganization(orgToDelete)); int orgCount = EamDb.getInstance().getOrganizations().size(); - + EamDb.getInstance().deleteOrganization(orgToDelete); assertTrue("getOrganizations returned unexpected count after deletion", orgCount - 1 == EamDb.getInstance().getOrganizations().size()); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test deleting existing org that is in use - try{ + try { // Make a new org EamOrganization inUseOrg = new EamOrganization("inUseOrg"); - inUseOrg.setOrgID((int)EamDb.getInstance().newOrganization(inUseOrg)); - + inUseOrg.setOrgID((int) EamDb.getInstance().newOrganization(inUseOrg)); + // Make a reference set that uses it EamGlobalSet tempSet = new EamGlobalSet(inUseOrg.getOrgID(), "inUseOrgTest", "1.0", TskData.FileKnown.BAD, false, fileType); EamDb.getInstance().newReferenceSet(tempSet); - + // It should now throw an exception if we try to delete it EamDb.getInstance().deleteOrganization(inUseOrg); Assert.fail("deleteOrganization failed to throw exception for in use organization"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior - } - + } + // Test deleting non-existent org // Should do nothing - try{ + try { EamOrganization temp = new EamOrganization("temp"); temp.setOrgID(9876); EamDb.getInstance().deleteOrganization(temp); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - } - + } + // Test deleting null org - try{ + try { EamDb.getInstance().deleteOrganization(null); Assert.fail("deleteOrganization failed to throw exception for null organization"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior - } + } } - + /** - * Tests for adding / retrieving reference instances - * Only the files type is currently implemented + * Tests for adding / retrieving reference instances + * Only the files type is currently implemented * addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, CorrelationAttribute.Type correlationType) tests: - * - Test adding multiple valid entries - * - Test invalid reference set ID - * - Test null hash (EamGlobalFileInstance constructor) - * - Test null known status (EamGlobalFileInstance constructor) + * - Test adding multiple valid entries + * - Test invalid reference set ID + * - Test null hash (EamGlobalFileInstance constructor) + * - Test null known status (EamGlobalFileInstance constructor) * - Test null correlation type - * bulkInsertReferenceTypeEntries(Set globalInstances, CorrelationAttribute.Type contentType) tests: - * - Test with large valid list - * - Test with null list - * - Test with invalid reference set ID - * - Test with null correlation type - * getReferenceInstancesByTypeValue(CorrelationAttribute.Type aType, String aValue) tests: - * - Test with valid entries - * - Test with non-existent value - * - Test with invalid type - * - Test with null type - * - Test with null value - * isFileHashInReferenceSet(String hash, int referenceSetID)tests: - * - Test existing hash/ID - * - Test non-existent (but valid) hash/ID - * - Test invalid ID - * - Test null hash - * isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) tests: - * - Test existing value/ID - * - Test non-existent (but valid) value/ID - * - Test invalid ID - * - Test null value - * - Test invalid type ID - * isArtifactKnownBadByReference(CorrelationAttribute.Type aType, String value) tests: - * - Test notable value - * - Test known value - * - Test non-existent value - * - Test null value - * - Test null type - * - Test invalid type + * bulkInsertReferenceTypeEntries(Set globalInstances, CorrelationAttribute.Type contentType) tests: + * - Test with large valid list + * - Test with null list + * - Test with invalid reference set ID + * - Test with null correlation type + * getReferenceInstancesByTypeValue(CorrelationAttribute.Type aType, String aValue) tests: + * - Test with valid entries + * - Test with non-existent value + * - Test with invalid type + * - Test with null type + * - Test with null value + * isFileHashInReferenceSet(String hash, int referenceSetID)tests: + * - Test existing hash/ID + * - Test non-existent (but valid) hash/ID + * - Test invalid ID + * - Test null hash + * isValueInReferenceSet(String value, int referenceSetID, int correlationTypeID) tests: + * - Test existing value/ID + * - Test non-existent (but valid) value/ID + * - Test invalid ID + * - Test null value + * - Test invalid type ID + * isArtifactKnownBadByReference(CorrelationAttribute.Type aType, String value) tests: + * - Test notable value + * - Test known value + * - Test non-existent value + * - Test null value + * - Test null type + * - Test invalid type */ - public void atestReferenceSetInstances(){ - + public void testReferenceSetInstances() { + // After the two initial testing blocks, the reference sets should contain: // notableSet1 - notableHash1, inAllSetsHash // notableSet2 - inAllSetsHash @@ -1175,23 +1517,23 @@ public class CentralRepoDatamodelTest extends TestCase { int notableSet2id; EamGlobalSet knownSet1; int knownSet1id; - - String notableHash1 = "d46feecd663c41648dbf690d9343cf4b"; - String knownHash1 = "39c844daee70485143da4ff926601b5b"; + + String notableHash1 = "d46feecd663c41648dbf690d9343cf4b"; + String knownHash1 = "39c844daee70485143da4ff926601b5b"; String inAllSetsHash = "6449b39bb23c42879fa0c243726e27f7"; - + CorrelationAttribute.Type emailType; - + // Store the email type object for later use - try{ + try { emailType = EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.EMAIL_TYPE_ID); assertTrue("getCorrelationTypeById(EMAIL_TYPE_ID) returned null", emailType != null); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); return; } - + // Set up a few reference sets try { notableSet1 = new EamGlobalSet(org1.getOrgID(), "notable set 1", "1.0", TskData.FileKnown.BAD, false, fileType); @@ -1200,71 +1542,71 @@ public class CentralRepoDatamodelTest extends TestCase { notableSet2id = EamDb.getInstance().newReferenceSet(notableSet2); knownSet1 = new EamGlobalSet(org1.getOrgID(), "known set 1", "5.5.4", TskData.FileKnown.KNOWN, false, fileType); knownSet1id = EamDb.getInstance().newReferenceSet(knownSet1); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); return; } - + // Test adding file instances with valid data try { EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, inAllSetsHash, TskData.FileKnown.BAD, "comment1"); EamDb.getInstance().addReferenceInstance(temp, fileType); - + temp = new EamGlobalFileInstance(notableSet2id, inAllSetsHash, TskData.FileKnown.BAD, "comment2"); EamDb.getInstance().addReferenceInstance(temp, fileType); - + temp = new EamGlobalFileInstance(knownSet1id, inAllSetsHash, TskData.FileKnown.KNOWN, "comment3"); EamDb.getInstance().addReferenceInstance(temp, fileType); - + temp = new EamGlobalFileInstance(notableSet1id, notableHash1, TskData.FileKnown.BAD, "comment4"); EamDb.getInstance().addReferenceInstance(temp, fileType); - + temp = new EamGlobalFileInstance(knownSet1id, knownHash1, TskData.FileKnown.KNOWN, "comment5"); - EamDb.getInstance().addReferenceInstance(temp, fileType); - }catch (EamDbException ex){ + EamDb.getInstance().addReferenceInstance(temp, fileType); + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test adding file instance with invalid reference set ID try { EamGlobalFileInstance temp = new EamGlobalFileInstance(2345, inAllSetsHash, TskData.FileKnown.BAD, "comment"); - EamDb.getInstance().addReferenceInstance(temp, fileType); + EamDb.getInstance().addReferenceInstance(temp, fileType); Assert.fail("addReferenceInstance failed to throw exception for invalid ID"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test creating file instance with null hash // Since it isn't possible to get a null hash into the EamGlobalFileInstance, skip trying to // call addReferenceInstance and just test the EamGlobalFileInstance constructor try { EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, null, TskData.FileKnown.BAD, "comment"); Assert.fail("EamGlobalFileInstance failed to throw exception for null hash"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test adding file instance with null known status // Since it isn't possible to get a null known status into the EamGlobalFileInstance, skip trying to // call addReferenceInstance and just test the EamGlobalFileInstance constructor try { - EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, inAllSetsHash, null, "comment"); + EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, inAllSetsHash, null, "comment"); Assert.fail("EamGlobalFileInstance failed to throw exception for null type"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test adding file instance with null correlation type try { EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, inAllSetsHash, TskData.FileKnown.BAD, "comment"); - EamDb.getInstance().addReferenceInstance(temp, null); + EamDb.getInstance().addReferenceInstance(temp, null); Assert.fail("addReferenceInstance failed to throw exception for null type"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test bulk insert with large valid set try { // Create a list of global file instances. Make enough that the bulk threshold should be hit once. @@ -1274,256 +1616,256 @@ public class CentralRepoDatamodelTest extends TestCase { String hash = bulkTestHash + String.valueOf(i); instances.add(new EamGlobalFileInstance(notableSet2id, hash, TskData.FileKnown.BAD, null)); } - + // Insert the list EamDb.getInstance().bulkInsertReferenceTypeEntries(instances, fileType); - + // There's no way to get a count of the number of entries in the database, so just do a spot check - if(dbSettingsSqlite.getBulkThreshold() > 10){ + if (dbSettingsSqlite.getBulkThreshold() > 10) { String hash = bulkTestHash + "10"; assertTrue("Sample bulk insert instance not found", EamDb.getInstance().isFileHashInReferenceSet(hash, notableSet2id)); } - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test bulk add file instance with null list try { - EamDb.getInstance().bulkInsertReferenceTypeEntries(null, fileType); + EamDb.getInstance().bulkInsertReferenceTypeEntries(null, fileType); Assert.fail("bulkInsertReferenceTypeEntries failed to throw exception for null list"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test bulk add file instance with invalid reference set ID try { Set tempSet = new HashSet<>(Arrays.asList(new EamGlobalFileInstance(2345, inAllSetsHash, TskData.FileKnown.BAD, "comment"))); EamDb.getInstance().bulkInsertReferenceTypeEntries(tempSet, fileType); Assert.fail("bulkInsertReferenceTypeEntries failed to throw exception for invalid ID"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test bulk add file instance with null correlation type try { Set tempSet = new HashSet<>(Arrays.asList(new EamGlobalFileInstance(notableSet1id, inAllSetsHash, TskData.FileKnown.BAD, "comment"))); - EamDb.getInstance().bulkInsertReferenceTypeEntries(tempSet, null); + EamDb.getInstance().bulkInsertReferenceTypeEntries(tempSet, null); Assert.fail("bulkInsertReferenceTypeEntries failed to throw exception for null type"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting reference instances with valid data try { List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(fileType, inAllSetsHash); assertTrue("getReferenceInstancesByTypeValue returned " + temp.size() + " instances - expected 3", temp.size() == 3); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting reference instances with non-existent data try { List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(fileType, "testHash"); assertTrue("getReferenceInstancesByTypeValue returned " + temp.size() + " instances for non-existent value - expected 0", temp.isEmpty()); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting reference instances an invalid type (the email table is not yet implemented) try { List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(emailType, inAllSetsHash); Assert.fail("getReferenceInstancesByTypeValue failed to throw exception for invalid table"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting reference instances with null type try { List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(null, inAllSetsHash); Assert.fail("getReferenceInstancesByTypeValue failed to throw exception for null type"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test getting reference instances with null value try { List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(fileType, null); assertTrue("getReferenceInstancesByTypeValue returned non-empty list given null value", temp.isEmpty()); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test checking existing hash/ID try { assertTrue("isFileHashInReferenceSet returned false for valid data", EamDb.getInstance().isFileHashInReferenceSet(knownHash1, knownSet1id)); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test checking non-existent (but valid) hash/ID try { assertFalse("isFileHashInReferenceSet returned true for non-existent data", EamDb.getInstance().isFileHashInReferenceSet(knownHash1, notableSet1id)); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test checking invalid reference set ID try { assertFalse("isFileHashInReferenceSet returned true for invalid data", EamDb.getInstance().isFileHashInReferenceSet(knownHash1, 5678)); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test checking null hash try { assertFalse("isFileHashInReferenceSet returned true for null hash", EamDb.getInstance().isFileHashInReferenceSet(null, knownSet1id)); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test checking existing hash/ID try { - assertTrue("isValueInReferenceSet returned false for valid data", + assertTrue("isValueInReferenceSet returned false for valid data", EamDb.getInstance().isValueInReferenceSet(knownHash1, knownSet1id, fileType.getId())); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test checking non-existent (but valid) hash/ID try { - assertFalse("isValueInReferenceSet returned true for non-existent data", + assertFalse("isValueInReferenceSet returned true for non-existent data", EamDb.getInstance().isValueInReferenceSet(knownHash1, notableSet1id, fileType.getId())); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test checking invalid reference set ID try { - assertFalse("isValueInReferenceSet returned true for invalid data", + assertFalse("isValueInReferenceSet returned true for invalid data", EamDb.getInstance().isValueInReferenceSet(knownHash1, 5678, fileType.getId())); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test checking null hash try { - assertFalse("isValueInReferenceSet returned true for null value", + assertFalse("isValueInReferenceSet returned true for null value", EamDb.getInstance().isValueInReferenceSet(null, knownSet1id, fileType.getId())); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test checking invalid type try { EamDb.getInstance().isValueInReferenceSet(knownHash1, knownSet1id, emailType.getId()); Assert.fail("isValueInReferenceSet failed to throw exception for invalid type"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test known bad with notable data try { - assertTrue("isArtifactKnownBadByReference returned false for notable value", + assertTrue("isArtifactKnownBadByReference returned false for notable value", EamDb.getInstance().isArtifactKnownBadByReference(fileType, notableHash1)); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test known bad with known data try { - assertFalse("isArtifactKnownBadByReference returned true for known value", + assertFalse("isArtifactKnownBadByReference returned true for known value", EamDb.getInstance().isArtifactKnownBadByReference(fileType, knownHash1)); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test known bad with non-existent data try { - assertFalse("isArtifactKnownBadByReference returned true for non-existent value", + assertFalse("isArtifactKnownBadByReference returned true for non-existent value", EamDb.getInstance().isArtifactKnownBadByReference(fileType, "abcdef")); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test known bad with null hash try { - assertFalse("isArtifactKnownBadByReference returned true for null value", + assertFalse("isArtifactKnownBadByReference returned true for null value", EamDb.getInstance().isArtifactKnownBadByReference(fileType, null)); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test known bad with null type try { EamDb.getInstance().isArtifactKnownBadByReference(null, knownHash1); Assert.fail("isArtifactKnownBadByReference failed to throw exception from null type"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test known bad with invalid type try { assertFalse("isArtifactKnownBadByReference returned true for invalid type", EamDb.getInstance().isArtifactKnownBadByReference(emailType, null)); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } } - + /** - * Test method for the methods related to reference sets (does not include instance testing) - * Only the files type is currently implemented - * newReferenceSet(EamGlobalSet eamGlobalSet) tests: - * - Test creating notable reference set - * - Test creating known reference set - * - Test creating duplicate reference set - * - Test creating almost duplicate reference set - * - Test with invalid org ID - * - Test with null name - * - Test with null version - * - Test with null known status + * Test method for the methods related to reference sets (does not include + * instance testing) Only the files type is currently implemented + * newReferenceSet(EamGlobalSet eamGlobalSet) tests: + * - Test creating notable reference set + * - Test creating known reference set + * - Test creating duplicate reference set + * - Test creating almost duplicate reference set + * - Test with invalid org ID + * - Test with null name + * - Test with null version + * - Test with null known status * - Test with null file type - * referenceSetIsValid(int referenceSetID, String referenceSetName, String version) tests: - * - Test on existing reference set - * - Test on invalid reference set - * - Test with null name - * - Test with null version - * referenceSetExists(String referenceSetName, String version) tests: - * - Test on existing reference set - * - Test on invalid reference set - * - Test with null name - * - Test with null version - * getReferenceSetByID(int globalSetID) tests: - * - Test with valid ID - * - Test with invalid ID - * getAllReferenceSets(CorrelationAttribute.Type correlationType) tests: - * - Test getting all file sets - * - Test getting all email sets - * - Test with null type parameter - * deleteReferenceSet(int referenceSetID) tests: - * - Test on valid reference set ID - * - Test on invalid reference set ID - * getReferenceSetOrganization(int referenceSetID) tests: - * - Test on valid reference set ID - * - Test on invalid reference set ID + * referenceSetIsValid(int referenceSetID, String referenceSetName, String version) tests: + * - Test on existing reference set + * - Test on invalid reference set + * - Test with null name + * - Test with null version + * referenceSetExists(String referenceSetName, String version) tests: + * - Test on existing reference set + * - Test on invalid reference set + * - Test with null name + * - Test with null version + * getReferenceSetByID(int globalSetID) tests: + * - Test with valid ID + * - Test with invalid ID + * getAllReferenceSets(CorrelationAttribute.Type correlationType) tests: + * - Test getting all file sets + * - Test getting all email sets + * - Test with null type parameter + * deleteReferenceSet(int referenceSetID) tests: + * - Test on valid reference set ID + * - Test on invalid reference set ID + * getReferenceSetOrganization(int referenceSetID) tests: + * - Test on valid reference set ID + * - Test on invalid reference set ID */ - public void atestReferenceSets() { + public void testReferenceSets() { String set1name = "referenceSet1"; String set1version = "1.0"; EamGlobalSet set1; @@ -1533,202 +1875,201 @@ public class CentralRepoDatamodelTest extends TestCase { int set2id; EamGlobalSet set3; int set3id; - - + // Test creating a notable reference set try { set1 = new EamGlobalSet(org1.getOrgID(), set1name, set1version, TskData.FileKnown.BAD, false, fileType); set1id = EamDb.getInstance().newReferenceSet(set1); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); return; } - + // Test creating a known reference set try { set2 = new EamGlobalSet(org2.getOrgID(), set2name, "", TskData.FileKnown.KNOWN, false, fileType); set2id = EamDb.getInstance().newReferenceSet(set2); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); return; } - + // Test creating a reference set with the same name and version try { EamGlobalSet temp = new EamGlobalSet(org1.getOrgID(), set1name, "1.0", TskData.FileKnown.BAD, false, fileType); EamDb.getInstance().newReferenceSet(temp); Assert.fail("newReferenceSet failed to throw exception from duplicate name/version pair"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test creating a reference set with the same name but different version try { set3 = new EamGlobalSet(org1.getOrgID(), set1name, "2.0", TskData.FileKnown.BAD, false, fileType); set3id = EamDb.getInstance().newReferenceSet(set3); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); return; } - + // Test creating a reference set with invalid org ID try { EamGlobalSet temp = new EamGlobalSet(5000, "tempName", "", TskData.FileKnown.BAD, false, fileType); EamDb.getInstance().newReferenceSet(temp); Assert.fail("newReferenceSet failed to throw exception from invalid org ID"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test creating a reference set with null name try { EamGlobalSet temp = new EamGlobalSet(org2.getOrgID(), null, "", TskData.FileKnown.BAD, false, fileType); EamDb.getInstance().newReferenceSet(temp); Assert.fail("newReferenceSet failed to throw exception from null name"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test creating a reference set with null version try { EamGlobalSet temp = new EamGlobalSet(org2.getOrgID(), "tempName", null, TskData.FileKnown.BAD, false, fileType); EamDb.getInstance().newReferenceSet(temp); Assert.fail("newReferenceSet failed to throw exception from null version"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test creating a reference set with null file known status try { EamGlobalSet temp = new EamGlobalSet(org2.getOrgID(), "tempName", "", null, false, fileType); EamDb.getInstance().newReferenceSet(temp); Assert.fail("newReferenceSet failed to throw exception from null file known status"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test creating a reference set with null file type try { EamGlobalSet temp = new EamGlobalSet(org2.getOrgID(), "tempName", "", TskData.FileKnown.BAD, false, null); EamDb.getInstance().newReferenceSet(temp); Assert.fail("newReferenceSet failed to throw exception from null file type"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior } - + // Test validation with a valid reference set try { assertTrue("referenceSetIsValid returned false for valid reference set", EamDb.getInstance().referenceSetIsValid(set1id, set1name, set1version)); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test validation with an invalid reference set try { assertFalse("referenceSetIsValid returned true for invalid reference set", EamDb.getInstance().referenceSetIsValid(5000, set1name, set1version)); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test validation with a null name try { assertFalse("referenceSetIsValid returned true with null name", EamDb.getInstance().referenceSetIsValid(set1id, null, set1version)); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test validation with a null version try { assertFalse("referenceSetIsValid returned true with null version", EamDb.getInstance().referenceSetIsValid(set1id, set1name, null)); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test existence with a valid reference set try { assertTrue("referenceSetExists returned false for valid reference set", EamDb.getInstance().referenceSetExists(set1name, set1version)); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test existence with an invalid reference set try { assertFalse("referenceSetExists returned true for invalid reference set", EamDb.getInstance().referenceSetExists(set1name, "5.5")); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test existence with null name try { assertFalse("referenceSetExists returned true for null name", EamDb.getInstance().referenceSetExists(null, "1.0")); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test existence with null version try { assertFalse("referenceSetExists returned true for null version", EamDb.getInstance().referenceSetExists(set1name, null)); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting global set with valid ID try { EamGlobalSet temp = EamDb.getInstance().getReferenceSetByID(set1id); assertTrue("getReferenceSetByID returned null for valid ID", temp != null); - assertTrue("getReferenceSetByID returned set with incorrect name and/or version", + assertTrue("getReferenceSetByID returned set with incorrect name and/or version", set1name.equals(temp.getSetName()) && set1version.equals(temp.getVersion())); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting global set with invalid ID try { EamGlobalSet temp = EamDb.getInstance().getReferenceSetByID(1234); assertTrue("getReferenceSetByID returned non-null result for invalid ID", temp == null); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting all file reference sets try { List referenceSets = EamDb.getInstance().getAllReferenceSets(fileType); assertTrue("getAllReferenceSets(FILES) returned unexpected number", referenceSets.size() == 3); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test getting all email reference sets try { List referenceSets = EamDb.getInstance().getAllReferenceSets(EamDb.getInstance().getCorrelationTypeById(CorrelationAttribute.EMAIL_TYPE_ID)); assertTrue("getAllReferenceSets(EMAIL) returned unexpected number", referenceSets.isEmpty()); - }catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - } - + } + // Test null argument to getAllReferenceSets try { EamDb.getInstance().getAllReferenceSets(null); Assert.fail("getAllReferenceSets failed to throw exception from null type argument"); - }catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior - } - + } + // Test deleting an existing reference set // First: create a new reference set, check that it's in the database, and get the number of reference sets // Second: delete the reference set, check that it is no longer in the database, and the total number of sets decreased by one @@ -1737,66 +2078,66 @@ public class CentralRepoDatamodelTest extends TestCase { int setToDeleteID = EamDb.getInstance().newReferenceSet(setToDelete); assertTrue("setToDelete wasn't found in database", EamDb.getInstance().referenceSetIsValid(setToDeleteID, setToDelete.getSetName(), setToDelete.getVersion())); int currentCount = EamDb.getInstance().getAllReferenceSets(fileType).size(); - - EamDb.getInstance().deleteReferenceSet(setToDeleteID); + + EamDb.getInstance().deleteReferenceSet(setToDeleteID); assertFalse("Deleted reference set was found in database", EamDb.getInstance().referenceSetIsValid(setToDeleteID, setToDelete.getSetName(), setToDelete.getVersion())); assertTrue("Unexpected number of reference sets in database after deletion", currentCount - 1 == EamDb.getInstance().getAllReferenceSets(fileType).size()); - - } catch (EamDbException ex){ + + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - } - + } + // Test deleting a non-existent reference set // The expectation is that nothing will happen try { - int currentCount = EamDb.getInstance().getAllReferenceSets(fileType).size(); - EamDb.getInstance().deleteReferenceSet(1234); - assertTrue("Number of reference sets changed after deleting non-existent set", currentCount == EamDb.getInstance().getAllReferenceSets(fileType).size()); - } catch (EamDbException ex){ + int currentCount = EamDb.getInstance().getAllReferenceSets(fileType).size(); + EamDb.getInstance().deleteReferenceSet(1234); + assertTrue("Number of reference sets changed after deleting non-existent set", currentCount == EamDb.getInstance().getAllReferenceSets(fileType).size()); + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - } - + } + // Test getting reference set organization for valid ID with org set try { EamOrganization org = EamDb.getInstance().getReferenceSetOrganization(set1id); assertTrue("getReferenceSetOrganization returned null for valid set", org != null); assertTrue("getReferenceSetOrganization returned the incorrect organization", org.getOrgID() == org1.getOrgID()); - } catch (EamDbException ex){ + } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - } - + } + // Test getting reference set organization for non-existent reference set try { EamOrganization org = EamDb.getInstance().getReferenceSetOrganization(4567); Assert.fail("getReferenceSetOrganization failed to throw exception for invalid reference set ID"); - } catch (EamDbException ex){ + } catch (EamDbException ex) { // This is the expected behavior - } + } } - + /** * Test method for the methods related to the data sources table - * newDataSource(CorrelationDataSource eamDataSource) tests: + * newDataSource(CorrelationDataSource eamDataSource) tests: + * - Test with valid data + * - Test with duplicate data + * - Test with duplicate device ID and name but different case + * - Test with invalid case ID + * - Test with null device ID + * - Test with null name + * getDataSource(CorrelationCase correlationCase, String dataSourceDeviceId) tests: * - Test with valid data - * - Test with duplicate data - * - Test with duplicate device ID and name but different case - * - Test with invalid case ID + * - Test with non-existent data + * - Test with null correlationCase * - Test with null device ID - * - Test with null name - * getDataSource(CorrelationCase correlationCase, String dataSourceDeviceId) tests: - * - Test with valid data - * - Test with non-existent data - * - Test with null correlationCase - * - Test with null device ID - * List getDataSources()tests: - * - Test that the count and device IDs are as expected - * Long getCountUniqueDataSources() tests: - * - Test that the result is as expected - */ - public void atestDataSources() { + * getDataSources()tests: + * - Test that the count and device IDs are as expected + * getCountUniqueDataSources() tests: + * - Test that the result is as expected + */ + public void testDataSources() { final String dataSourceAname = "dataSourceA"; final String dataSourceAid = "dataSourceA_deviceID"; CorrelationDataSource dataSourceA; @@ -1811,7 +2152,7 @@ public class CentralRepoDatamodelTest extends TestCase { Assert.fail(ex); return; } - + // Test creating a data source with the same case, name, and ID try { CorrelationDataSource temp = new CorrelationDataSource(case2.getID(), dataSourceAid, dataSourceAname); @@ -1820,7 +2161,7 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { // This is the expected behavior } - + // Test creating a data source with the same name and ID but different case try { dataSourceB = new CorrelationDataSource(case1.getID(), dataSourceAid, dataSourceAname); @@ -1909,10 +2250,10 @@ public class CentralRepoDatamodelTest extends TestCase { Exceptions.printStackTrace(ex); Assert.fail(ex); } - + // Test the data source count try { - assertTrue("getCountUniqueDataSources returned unexpected number of data sources", + assertTrue("getCountUniqueDataSources returned unexpected number of data sources", EamDb.getInstance().getCountUniqueDataSources() == 5); } catch (EamDbException ex) { Exceptions.printStackTrace(ex); @@ -1922,23 +2263,35 @@ public class CentralRepoDatamodelTest extends TestCase { /** * Test method for the methods related to the cases table - * newCase(CorrelationCase eamCase) tests: - Test valid data - Test null - * UUID - Test null case name - Test repeated UUID newCase(Case autopsyCase) - * tests: - Test valid data - Test null autopsyCase - * updateCase(CorrelationCase eamCase) tests: - Test with valid data, - * checking all fields - Test null eamCase getCase(Case autopsyCase) tests: - * - Test with current Autopsy case getCaseByUUID(String caseUUID) - * getCases() - Test with UUID that is in the database - Test with UUID that - * is not in the database - Test with null UUID - * bulkInsertCases(List cases) - Test on a list of cases - * larger than the bulk insert threshold. - Test on a null list + * newCase(CorrelationCase eamCase) tests: + * - Test valid data + * - Test null UUID + * - Test null case name + * - Test repeated UUID + * newCase(Case autopsyCase) tests: + * - Test valid data + * - Test null autopsyCase + * updateCase(CorrelationCase eamCase) tests: + * - Test with valid data, checking all fields + * - Test null eamCase + * getCase(Case autopsyCase) tests: + * - Test with current Autopsy case + * getCaseByUUID(String caseUUID) + * - Test with UUID that is in the database + * - Test with UUID that is not in the database + * - Test with null UUID + * getCases() tests: + * - Test getting all cases, checking the count and fields + * bulkInsertCases(List cases) + * - Test on a list of cases larger than the bulk insert threshold. + * - Test on a null list */ - public void atestCases() { + public void testCases() { final String caseAname = "caseA"; final String caseAuuid = "caseA_uuid"; CorrelationCase caseA; CorrelationCase caseB; - + try { // Set up an Autopsy case for testing try { @@ -2148,12 +2501,12 @@ public class CentralRepoDatamodelTest extends TestCase { try { Case.closeCurrentCase(); // This seems to help in allowing the Autopsy case to be deleted - try{ - Thread.sleep(2000); - } catch (Exception ex){ + try { + Thread.sleep(2000); + } catch (Exception ex) { } - } catch (CaseActionException ex){ + } catch (CaseActionException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); } @@ -2162,15 +2515,21 @@ public class CentralRepoDatamodelTest extends TestCase { /** * Test method for the three methods related to the db_info table - * newDbInfo(String name, String value) tests: - Test valid data - Test null - * name - Test null value getDbInfo(String name) - Test getting value for - * existing name - Test getting value for non-existing name - Test getting - * value for null name updateDbInfo(String name, String value) - Test - * updating existing name to valid new value - Test updating existing name - * to null value - Test updating null name - Test updating non-existing name - * to new value + * newDbInfo(String name, String value) tests: + * - Test valid data + * - Test null name + * - Test null value + * getDbInfo(String name) + * - Test getting value for existing name + * - Test getting value for non-existing name + * - Test getting value for null name + * updateDbInfo(String name, String value) + * - Test updating existing name to valid new value + * - Test updating existing name to null value + * - Test updating null name + * - Test updating non-existing name to new value */ - public void atestDbInfo() { + public void testDbInfo() { final String name1 = "testName1"; final String name2 = "testName2"; final String name3 = "testName3"; From 66d3694159df5b393c54c30144b44ecf7e11fa9a Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Tue, 6 Feb 2018 14:51:14 -0500 Subject: [PATCH 53/62] Some codacy fixes --- .../datamodel/CentralRepoDatamodelTest.java | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index b2e05d8694..29a3abee71 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -352,7 +352,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting notable instances with null type try { - List attrs = EamDb.getInstance().getArtifactInstancesKnownBad(null, notableHashInOneCaseKnownOther); + EamDb.getInstance().getArtifactInstancesKnownBad(null, notableHashInOneCaseKnownOther); Assert.fail("getArtifactInstancesKnownBad failed to throw exception for null type"); } catch (EamDbException ex) { // This is the expected behavior @@ -361,7 +361,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting notable instances with null value (should work fine) try { List attrs = EamDb.getInstance().getArtifactInstancesKnownBad(fileType, null); - assertTrue("getArtifactInstancesKnownBad returned " + attrs.size() + " values - expected ", attrs.size() == 0); + assertTrue("getArtifactInstancesKnownBad returned " + attrs.size() + " values - expected ", attrs.isEmpty()); } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); @@ -857,7 +857,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting instances with null type try { - List instances = EamDb.getInstance().getArtifactInstancesByTypeValue(null, inAllDataSourcesHash); + EamDb.getInstance().getArtifactInstancesByTypeValue(null, inAllDataSourcesHash); Assert.fail("getArtifactInstancesByTypeValue failed to throw exception for null type"); } catch (EamDbException ex) { // This is the expected behavior @@ -901,7 +901,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting instances with null path try { - List instances = EamDb.getInstance().getArtifactInstancesByPath(fileType, null); + EamDb.getInstance().getArtifactInstancesByPath(fileType, null); Assert.fail("getArtifactInstancesByPath failed to throw exception for null path"); } catch (EamDbException ex) { // This is the expected behavior @@ -927,7 +927,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting instance count with null type try { - long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(null, inAllDataSourcesHash); + EamDb.getInstance().getCountArtifactInstancesByTypeValue(null, inAllDataSourcesHash); Assert.fail("getCountArtifactInstancesByTypeValue failed to throw exception for null type"); } catch (EamDbException ex) { // This is the expected behavior @@ -935,7 +935,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting instance count with null value try { - long count = EamDb.getInstance().getCountArtifactInstancesByTypeValue(fileType, null); + EamDb.getInstance().getCountArtifactInstancesByTypeValue(fileType, null); Assert.fail("getCountArtifactInstancesByTypeValue failed to throw exception for null value"); } catch (EamDbException ex) { // This is the expected behavior @@ -984,7 +984,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting frequency with null type try { CorrelationAttribute attr = new CorrelationAttribute(null, "randomValue"); - int freq = EamDb.getInstance().getFrequencyPercentage(attr); + EamDb.getInstance().getFrequencyPercentage(attr); Assert.fail("getFrequencyPercentage failed to throw exception for null type"); } catch (EamDbException ex) { // This is the expected behavior @@ -992,7 +992,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting frequency with null attribute try { - int freq = EamDb.getInstance().getFrequencyPercentage(null); + EamDb.getInstance().getFrequencyPercentage(null); Assert.fail("getFrequencyPercentage failed to throw exception for null attribute"); } catch (EamDbException ex) { // This is the expected behavior @@ -1054,7 +1054,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting data source count for null type try { - long count = EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(null, "abcdef"); + EamDb.getInstance().getCountUniqueCaseDataSourceTuplesHavingTypeValue(null, "abcdef"); Assert.fail("getCountUniqueCaseDataSourceTuplesHavingTypeValue failed to throw exception for null type"); } catch (EamDbException ex) { // This is the expected behavior @@ -1189,7 +1189,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting the type with a invalid ID try { - CorrelationAttribute.Type temp = EamDb.getInstance().getCorrelationTypeById(5555); + EamDb.getInstance().getCorrelationTypeById(5555); Assert.fail("getCorrelationTypeById failed to throw exception for invalid ID"); } catch (EamDbException ex) { // This is the expected behavior @@ -1356,7 +1356,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting org with invalid ID try { - EamOrganization temp = EamDb.getInstance().getOrganizationByID(12345); + EamDb.getInstance().getOrganizationByID(12345); Assert.fail("getOrganizationByID failed to throw exception for invalid ID"); } catch (EamDbException ex) { // This is the expected behavior @@ -1676,7 +1676,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting reference instances an invalid type (the email table is not yet implemented) try { - List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(emailType, inAllSetsHash); + EamDb.getInstance().getReferenceInstancesByTypeValue(emailType, inAllSetsHash); Assert.fail("getReferenceInstancesByTypeValue failed to throw exception for invalid table"); } catch (EamDbException ex) { // This is the expected behavior @@ -1684,7 +1684,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting reference instances with null type try { - List temp = EamDb.getInstance().getReferenceInstancesByTypeValue(null, inAllSetsHash); + EamDb.getInstance().getReferenceInstancesByTypeValue(null, inAllSetsHash); Assert.fail("getReferenceInstancesByTypeValue failed to throw exception for null type"); } catch (EamDbException ex) { // This is the expected behavior @@ -1872,9 +1872,7 @@ public class CentralRepoDatamodelTest extends TestCase { int set1id; String set2name = "referenceSet2"; EamGlobalSet set2; - int set2id; EamGlobalSet set3; - int set3id; // Test creating a notable reference set try { @@ -1889,7 +1887,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test creating a known reference set try { set2 = new EamGlobalSet(org2.getOrgID(), set2name, "", TskData.FileKnown.KNOWN, false, fileType); - set2id = EamDb.getInstance().newReferenceSet(set2); + EamDb.getInstance().newReferenceSet(set2); } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); @@ -1908,7 +1906,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test creating a reference set with the same name but different version try { set3 = new EamGlobalSet(org1.getOrgID(), set1name, "2.0", TskData.FileKnown.BAD, false, fileType); - set3id = EamDb.getInstance().newReferenceSet(set3); + EamDb.getInstance().newReferenceSet(set3); } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); @@ -2111,7 +2109,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting reference set organization for non-existent reference set try { - EamOrganization org = EamDb.getInstance().getReferenceSetOrganization(4567); + EamDb.getInstance().getReferenceSetOrganization(4567); Assert.fail("getReferenceSetOrganization failed to throw exception for invalid reference set ID"); } catch (EamDbException ex) { // This is the expected behavior @@ -2219,7 +2217,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting a data source with a null case try { - CorrelationDataSource temp = EamDb.getInstance().getDataSource(null, dataSourceAid); + EamDb.getInstance().getDataSource(null, dataSourceAid); Assert.fail("getDataSource did not throw exception from null case"); } catch (EamDbException ex) { // This is the expected behavior @@ -2316,7 +2314,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test null uuid try { CorrelationCase tempCase = new CorrelationCase(null, "nullUuidCase"); - tempCase = EamDb.getInstance().newCase(tempCase); + EamDb.getInstance().newCase(tempCase); Assert.fail("newCase did not throw expected exception from null uuid"); } catch (EamDbException ex) { // This is the expected behavior @@ -2325,7 +2323,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test null name try { CorrelationCase tempCase = new CorrelationCase("nullCaseUuid", null); - tempCase = EamDb.getInstance().newCase(tempCase); + EamDb.getInstance().newCase(tempCase); Assert.fail("newCase did not throw expected exception from null name"); } catch (EamDbException ex) { // This is the expected behavior @@ -2359,7 +2357,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test null Autopsy case try { Case nullCase = null; - CorrelationCase tempCase = EamDb.getInstance().newCase(nullCase); + EamDb.getInstance().newCase(nullCase); Assert.fail("newCase did not throw expected exception from null case"); } catch (EamDbException ex) { // This is the expected behavior From 144360a886506d0dfff6aef26f610cce0c0a06ef Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Tue, 6 Feb 2018 22:42:49 -0500 Subject: [PATCH 54/62] Revisions. --- .../autopsy/keywordsearch/AccountsText.java | 6 +++--- .../keywordsearch/ExtractedContentPanel.java | 12 ++++++------ .../keywordsearch/ExtractedContentViewer.java | 14 +++++++------- .../autopsy/keywordsearch/HighlightedText.java | 12 ++++++------ .../sleuthkit/autopsy/keywordsearch/RawText.java | 16 ++++++++-------- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java index 995a267758..4796730565 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java @@ -52,7 +52,7 @@ import org.sleuthkit.datamodel.TskCoreException; */ class AccountsText implements IndexedText { - private static final Logger LOGGER = Logger.getLogger(AccountsText.class.getName()); + private static final Logger logger = Logger.getLogger(AccountsText.class.getName()); private static final boolean DEBUG = (Version.getBuildType() == Version.Type.DEVELOPMENT); private static final String CCN_REGEX = "(%?)(B?)([0-9][ \\-]*?){12,19}(\\^?)"; @@ -311,8 +311,8 @@ class AccountsText implements IndexedText { // extracted content (minus highlight tags) is HTML-escaped return "
" + highlightedText + "
"; //NON-NLS } catch (Exception ex) { - LOGGER.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + this.solrObjectId + ", chunkID " + this.currentPage, ex); //NON-NLS - return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getText.error.msg"); + logger.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + this.solrObjectId + ", chunkID " + this.currentPage, ex); //NON-NLS + return Bundle.ExtractedContentViewer_getText_error_msg(); } } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java index fd8966e254..d6a81371b2 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-17 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,6 +24,7 @@ import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.logging.Level; import javax.swing.JTextPane; @@ -648,7 +649,8 @@ class ExtractedContentPanel extends javax.swing.JPanel { } @NbBundle.Messages({ - "ExtractedContentPanel.SetMarkup.error.msg=Error getting text."}) + "ExtractedContentPanel.getText.error=Error getting text." + }) @Override protected void done() { super.done(); @@ -663,11 +665,9 @@ class ExtractedContentPanel extends javax.swing.JPanel { setPanelText("", false); } - } catch (InterruptedException | ExecutionException ex) { + } catch (InterruptedException | CancellationException | ExecutionException ex) { logger.log(Level.SEVERE, "Error getting marked up text", ex); //NON-NLS - setPanelText(NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentPanel.getText.error.msg"), true); - } // catch and ignore if we were cancelled - catch (java.util.concurrent.CancellationException ex) { + setPanelText(Bundle.ExtractedContentPanel_getText_error(), true); } updateControls(source); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java index 8f8ae75b8d..624e8c497c 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java @@ -57,7 +57,7 @@ import org.sleuthkit.datamodel.TskCoreException; @ServiceProvider(service = DataContentViewer.class, position = 4) public class ExtractedContentViewer implements DataContentViewer { - private static final Logger LOGGER = Logger.getLogger(ExtractedContentViewer.class.getName()); + private static final Logger logger = Logger.getLogger(ExtractedContentViewer.class.getName()); private static final long INVALID_DOCUMENT_ID = 0L; private static final BlackboardAttribute.Type TSK_ASSOCIATED_ARTIFACT_TYPE = new BlackboardAttribute.Type(TSK_ASSOCIATED_ARTIFACT); @@ -125,7 +125,7 @@ public class ExtractedContentViewer implements DataContentViewer { // if the artifact is an account artifact, get an account text . highlightedHitText = getAccountsText(content, nodeLookup); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to create AccountsText for " + content, ex); //NON-NLS + logger.log(Level.SEVERE, "Failed to create AccountsText for " + content, ex); //NON-NLS } } else if (artifact != null @@ -134,7 +134,7 @@ public class ExtractedContentViewer implements DataContentViewer { //if there is kwh artifact use that to construct the HighlightedText highlightedHitText = new HighlightedText(artifact); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Failed to create HighlightedText for " + artifact, ex); //NON-NLS + logger.log(Level.SEVERE, "Failed to create HighlightedText for " + artifact, ex); //NON-NLS } } @@ -158,7 +158,7 @@ public class ExtractedContentViewer implements DataContentViewer { try { rawArtifactText = getRawArtifactText(nodeLookup); } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error creating RawText for " + content, ex); //NON-NLS + logger.log(Level.SEVERE, "Error creating RawText for " + content, ex); //NON-NLS } if (rawArtifactText != null) { @@ -295,7 +295,7 @@ public class ExtractedContentViewer implements DataContentViewer { return true; } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error getting TSK_ACCOUNT_TYPE attribute from artifact " + art.getArtifactID(), ex); + logger.log(Level.SEVERE, "Error getting TSK_ACCOUNT_TYPE attribute from artifact " + art.getArtifactID(), ex); } } else if (artifactTypeID == TSK_KEYWORD_HIT.getTypeID()) { return true; @@ -359,7 +359,7 @@ public class ExtractedContentViewer implements DataContentViewer { try { return solrServer.queryIsIndexed(objectId); } catch (NoOpenCoreException | KeywordSearchModuleException ex) { - LOGGER.log(Level.SEVERE, "Error querying Solr server", ex); //NON-NLS + logger.log(Level.SEVERE, "Error querying Solr server", ex); //NON-NLS return false; } } @@ -393,7 +393,7 @@ public class ExtractedContentViewer implements DataContentViewer { return blackboardAttribute.getValueLong(); } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, "Error getting associated artifact attributes", ex); //NON-NLS + logger.log(Level.SEVERE, "Error getting associated artifact attributes", ex); //NON-NLS } } } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java index 61dfcfcdc8..030519b3da 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java @@ -53,7 +53,7 @@ import org.sleuthkit.datamodel.TskCoreException; */ class HighlightedText implements IndexedText { - private static final Logger LOGGER = Logger.getLogger(HighlightedText.class.getName()); + private static final Logger logger = Logger.getLogger(HighlightedText.class.getName()); private static final boolean DEBUG = (Version.getBuildType() == Version.Type.DEVELOPMENT); @@ -397,7 +397,7 @@ class HighlightedText implements IndexedText { // either be a single chunk containing hits or we narrow our // query down to the current page/chunk. if (response.getResults().size() > 1) { - LOGGER.log(Level.WARNING, "Unexpected number of results for Solr highlighting query: {0}", q); //NON-NLS + logger.log(Level.WARNING, "Unexpected number of results for Solr highlighting query: {0}", q); //NON-NLS } String highlightedContent; Map>> responseHighlight = response.getHighlighting(); @@ -423,14 +423,14 @@ class HighlightedText implements IndexedText { return "
" + highlightedContent + "
"; //NON-NLS } catch (TskCoreException | KeywordSearchModuleException | NoOpenCoreException ex) { - LOGGER.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + objectId + ", chunkID " + chunkID + ", highlight query: " + highlightField, ex); //NON-NLS - return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getText.error.msg"); + logger.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + objectId + ", chunkID " + chunkID + ", highlight query: " + highlightField, ex); //NON-NLS + return Bundle.ExtractedContentViewer_getText_error(); } } @Override public String toString() { - return NbBundle.getMessage(this.getClass(), "HighlightedMatchesSource.toString"); + return Bundle.HighlightedMatchesSource_toString(); } @Override @@ -467,7 +467,7 @@ class HighlightedText implements IndexedText { */ static String attemptManualHighlighting(SolrDocumentList solrDocumentList, String highlightField, Collection keywords) { if (solrDocumentList.isEmpty()) { - return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "document"); + return Bundle.ExtractedContentViewer_getSolrContent_noTxtYetMsg("document"); } // It doesn't make sense for there to be more than a single document in diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java index dc281ce100..af1d6bc01f 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java @@ -43,7 +43,7 @@ class RawText implements IndexedText { //keep last content cached private String cachedString; private int cachedChunk; - private static final Logger LOGGER = Logger.getLogger(RawText.class.getName()); + private static final Logger logger = Logger.getLogger(RawText.class.getName()); /** * Construct a new RawText object for the given content and object id. This @@ -153,9 +153,9 @@ class RawText implements IndexedText { return getArtifactText(); } } catch (SolrServerException | NoOpenCoreException ex) { - LOGGER.log(Level.SEVERE, "Couldn't get extracted text", ex); //NON-NLS + logger.log(Level.SEVERE, "Couldn't get extracted text", ex); //NON-NLS } - return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewerRawText.getText.error.msg"); + return Bundle.ExtractedContentViewer_getText_error_msg(); } @NbBundle.Messages({ @@ -207,7 +207,7 @@ class RawText implements IndexedText { hasChunks = true; } } catch (KeywordSearchModuleException | NoOpenCoreException ex) { - LOGGER.log(Level.SEVERE, "Could not get number of chunks: ", ex); //NON-NLS + logger.log(Level.SEVERE, "Could not get number of chunks: ", ex); //NON-NLS } } @@ -239,13 +239,13 @@ class RawText implements IndexedText { //we know it's AbstractFile, but do quick check to make sure if we index other objects in future boolean isKnown = TskData.FileKnown.KNOWN.equals(((AbstractFile)content).getKnown()); if (isKnown && KeywordSearchSettings.getSkipKnown()) { - msg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.knownFileMsg", content.getName()); + msg = Bundle.ExtractedContentViewer_getSolrContent_knownFileMsg(content.getName()); } } if(msg == null) { - msg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "file"); + msg = Bundle.ExtractedContentViewer_getSolrContent_noTxtYetMsg("file"); } - String htmlMsg = NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.txtBodyItal", msg); + String htmlMsg = Bundle.ExtractedContentViewer_getSolrContent_txtBodyItal(msg); return htmlMsg; } @@ -284,7 +284,7 @@ class RawText implements IndexedText { private String getArtifactText() throws NoOpenCoreException, SolrServerException{ String indexedText = KeywordSearch.getServer().getSolrContent(this.objectId, 1); if (indexedText == null || indexedText.isEmpty()) { - return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "artifact"); + return Bundle.ExtractedContentViewer_getSolrContent_noTxtYetMsg("artifact"); } indexedText = EscapeUtil.escapeHtml(indexedText).trim(); From a7a2c86ab3758d3dab826510bf0d96707294632e Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Wed, 7 Feb 2018 01:31:04 -0500 Subject: [PATCH 55/62] Revisions. --- .../autopsy/keywordsearch/AccountsText.java | 2 +- .../keywordsearch/Bundle_ja.properties | 1 - .../keywordsearch/ExtractedContentViewer.java | 7 --- .../keywordsearch/HighlightedText.java | 25 +++++----- .../autopsy/keywordsearch/IndexedText.java | 10 +++- .../autopsy/keywordsearch/RawText.java | 49 +++++++++++-------- 6 files changed, 51 insertions(+), 43 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java index 4796730565..00d5670151 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AccountsText.java @@ -312,7 +312,7 @@ class AccountsText implements IndexedText { return "
" + highlightedText + "
"; //NON-NLS } catch (Exception ex) { logger.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + this.solrObjectId + ", chunkID " + this.currentPage, ex); //NON-NLS - return Bundle.ExtractedContentViewer_getText_error_msg(); + return Bundle.IndexedText_errorMessage_errorGettingText(); } } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle_ja.properties b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle_ja.properties index dbaae76b16..2442e5bbc4 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle_ja.properties +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle_ja.properties @@ -199,7 +199,6 @@ KeywordSearchIngestModule.doInBackGround.finalizeMsg=- \u6700\u7d42\u51e6\u7406\ KeywordSearchIngestModule.doInBackGround.pendingMsg=\uff08\u30da\u30f3\u30c7\u30a3\u30f3\u30b0\uff09 SearchRunner.doInBackGround.cancelMsg=\uff08\u30ad\u30e3\u30f3\u30bb\u30eb\u4e2d\u2026\uff09 Server.addDoc.exception.msg2=\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u30cf\u30f3\u30c9\u30e9\u30fc\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u304c\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u6b21\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\uff1a{0} -ExtractedContentViewer.getSolrContent.txtBodyItal={0} KeywordSearchJobSettingsPanel.keywordSearchEncodings.text=- KeywordSearchJobSettingsPanel.languagesValLabel.text=- KeywordSearchJobSettingsPanel.encodingsLabel.text=\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\uff1a diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java index 624e8c497c..b13e1fbca4 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java @@ -29,7 +29,6 @@ import java.util.logging.Level; import org.openide.nodes.Node; import org.openide.util.Lookup; import org.openide.util.NbBundle; -import org.openide.util.NbBundle.Messages; import org.openide.util.lookup.ServiceProvider; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer; @@ -48,12 +47,6 @@ import org.sleuthkit.datamodel.TskCoreException; * A content viewer that displays the indexed text associated with a file or an * artifact, possibly marked up with HTML to highlight keyword hits. */ -@Messages({ - "ExtractedContentViewer.getText.error.msg=Error getting text.", - "ExtractedContentViewer.getSolrContent.knownFileMsg=

{0} is a known file (based on MD5 hash) and does not have text in the index.

", - "ExtractedContentViewer.getSolrContent.noTxtYetMsg=

There is currently no text in the index for this {0}. It may have no text, it may not have been analyzed yet, there may have been an error extracting text, or keyword search was not enabled during ingest.

", - "ExtractedContentViewer.getSolrContent.txtBodyItal={0}" -}) @ServiceProvider(service = DataContentViewer.class, position = 4) public class ExtractedContentViewer implements DataContentViewer { diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java index 030519b3da..14298a044a 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java @@ -102,13 +102,13 @@ class HighlightedText implements IndexedText { /** * This constructor is used when keyword hits are accessed from the ad-hoc * search results. In that case we have the entire QueryResults object and - need to arrange the paging. + * need to arrange the paging. * * @param objectId The objectID of the content whose text will be * highlighted. * @param QueryResults The QueryResults for the ad-hoc search from whose - results a selection was made leading to this - HighlightedText. + * results a selection was made leading to this + * HighlightedText. */ HighlightedText(long objectId, QueryResults hits) { this.objectId = objectId; @@ -203,10 +203,10 @@ class HighlightedText implements IndexedText { isLiteral = hits.getQuery().isLiteral(); /** - * Organize the hits by page, filter as needed. - * We process *every* keyword here because in the case of a regular - * expression search there may be multiple different keyword - * hits located in different chunks for the same file/artifact. + * Organize the hits by page, filter as needed. We process *every* + * keyword here because in the case of a regular expression search there + * may be multiple different keyword hits located in different chunks + * for the same file/artifact. */ for (Keyword k : hits.getKeywords()) { for (KeywordHit hit : hits.getResults(k)) { @@ -424,13 +424,13 @@ class HighlightedText implements IndexedText { return "
" + highlightedContent + "
"; //NON-NLS } catch (TskCoreException | KeywordSearchModuleException | NoOpenCoreException ex) { logger.log(Level.SEVERE, "Error getting highlighted text for Solr doc id " + objectId + ", chunkID " + chunkID + ", highlight query: " + highlightField, ex); //NON-NLS - return Bundle.ExtractedContentViewer_getText_error(); + return Bundle.IndexedText_errorMessage_errorGettingText(); } } @Override public String toString() { - return Bundle.HighlightedMatchesSource_toString(); + return NbBundle.getMessage(this.getClass(), "HighlightedMatchesSource.toString"); } @Override @@ -462,12 +462,13 @@ class HighlightedText implements IndexedText { * to a Solr query. We expect there to only ever be * a single document. * - * @return Either a string with the keyword highlighted via HTML span tags or a string - * indicating that we did not find a hit in the document. + * @return Either a string with the keyword highlighted via HTML span tags + * or a string indicating that we did not find a hit in the + * document. */ static String attemptManualHighlighting(SolrDocumentList solrDocumentList, String highlightField, Collection keywords) { if (solrDocumentList.isEmpty()) { - return Bundle.ExtractedContentViewer_getSolrContent_noTxtYetMsg("document"); + return Bundle.IndexedText_errorMessage_errorGettingText(); } // It doesn't make sense for there to be more than a single document in diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexedText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexedText.java index 6bf6a4f3ef..9095788c6a 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexedText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexedText.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,12 +18,20 @@ */ package org.sleuthkit.autopsy.keywordsearch; +import org.openide.util.NbBundle; + /** * Interface to provide HTML text to display in ExtractedContentViewer. There is * a SOLR implementation of this that interfaces with SOLR to highlight the * keyword hits and a version that does not do markup so that you can simply * view the stored text. */ +@NbBundle.Messages({ + "IndexedText.errorMessage.errorGettingText=

Error retrieving indexed text.

", + "IndexedText.warningMessage.knownFile=

This file is a known file (based on MD5 hash) and does not have indexed text.

", + "IndexedText.warningMessage.noTextAvailable=

No indexed text for this file.

", + "IndexedText.htmlStyle.textBodyItalics={0}" +}) interface IndexedText { /** diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java index af1d6bc01f..c7c263ce48 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java @@ -155,7 +155,7 @@ class RawText implements IndexedText { } catch (SolrServerException | NoOpenCoreException ex) { logger.log(Level.SEVERE, "Couldn't get extracted text", ex); //NON-NLS } - return Bundle.ExtractedContentViewer_getText_error_msg(); + return Bundle.IndexedText_errorMessage_errorGettingText(); } @NbBundle.Messages({ @@ -185,7 +185,6 @@ class RawText implements IndexedText { return 0; } - @Override public int getNumberPages() { return numPages; @@ -224,7 +223,8 @@ class RawText implements IndexedText { * @return the extracted text * * @throws NoOpenCoreException If no Solr core is available. - * @throws SolrServerException If there's a Solr communication or parsing issue. + * @throws SolrServerException If there's a Solr communication or parsing + * issue. */ private String getContentText(int currentPage, boolean hasChunks) throws NoOpenCoreException, SolrServerException { final Server solrServer = KeywordSearch.getServer(); @@ -234,18 +234,18 @@ class RawText implements IndexedText { //because we are storing extracted text in chunks only //and the non-chunk stores meta-data only String msg = null; - + if (content instanceof AbstractFile) { //we know it's AbstractFile, but do quick check to make sure if we index other objects in future - boolean isKnown = TskData.FileKnown.KNOWN.equals(((AbstractFile)content).getKnown()); + boolean isKnown = TskData.FileKnown.KNOWN.equals(((AbstractFile) content).getKnown()); if (isKnown && KeywordSearchSettings.getSkipKnown()) { - msg = Bundle.ExtractedContentViewer_getSolrContent_knownFileMsg(content.getName()); + msg = Bundle.IndexedText_warningMessage_knownFile(); } } - if(msg == null) { - msg = Bundle.ExtractedContentViewer_getSolrContent_noTxtYetMsg("file"); + if (msg == null) { + msg = Bundle.IndexedText_warningMessage_noTextAvailable(); } - String htmlMsg = Bundle.ExtractedContentViewer_getSolrContent_txtBodyItal(msg); + String htmlMsg = Bundle.IndexedText_htmlStyle_textBodyItalics(msg); return htmlMsg; } @@ -260,38 +260,45 @@ class RawText implements IndexedText { //not cached String indexedText = solrServer.getSolrContent(this.objectId, chunkId); - if (indexedText == null || indexedText.isEmpty()) { - return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "file"); + if (indexedText == null) { + if (content instanceof AbstractFile) { + return Bundle.IndexedText_errorMessage_errorGettingText(); + } else { + return Bundle.IndexedText_warningMessage_noTextAvailable(); + } + } else if (indexedText.isEmpty()) { + return Bundle.IndexedText_warningMessage_noTextAvailable(); } - + cachedString = EscapeUtil.escapeHtml(indexedText).trim(); StringBuilder sb = new StringBuilder(cachedString.length() + 20); sb.append("
").append(cachedString).append("
"); //NON-NLS cachedString = sb.toString(); cachedChunk = chunkId; - + return cachedString; } - + /** * Get extracted artifact for a node from Solr * * @return the extracted text - * + * * @throws NoOpenCoreException If no Solr core is available. - * @throws SolrServerException If there's a Solr communication or parsing issue. + * @throws SolrServerException If there's a Solr communication or parsing + * issue. */ - private String getArtifactText() throws NoOpenCoreException, SolrServerException{ + private String getArtifactText() throws NoOpenCoreException, SolrServerException { String indexedText = KeywordSearch.getServer().getSolrContent(this.objectId, 1); if (indexedText == null || indexedText.isEmpty()) { - return Bundle.ExtractedContentViewer_getSolrContent_noTxtYetMsg("artifact"); + return Bundle.IndexedText_errorMessage_errorGettingText(); } - + indexedText = EscapeUtil.escapeHtml(indexedText).trim(); StringBuilder sb = new StringBuilder(indexedText.length() + 20); sb.append("
").append(indexedText).append("
"); //NON-NLS - + return sb.toString(); } - + } From b58a7b18536930b36e4b27305e0b5933f169251a Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Wed, 7 Feb 2018 07:50:20 -0500 Subject: [PATCH 56/62] codacy fix and removed a few unnecessary return statements. --- .../datamodel/CentralRepoDatamodelTest.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 29a3abee71..644372feab 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -227,7 +227,6 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - return; } // Add two instances with one notable, one known @@ -253,7 +252,6 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - return; } // Add an artifact and then update its status @@ -271,7 +269,6 @@ public class CentralRepoDatamodelTest extends TestCase { } catch (EamDbException ex) { Exceptions.printStackTrace(ex); Assert.fail(ex); - return; } // Try to update artifact with two CorrelationAttributeInstance instances @@ -893,7 +890,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test getting instances with null type try { - List instances = EamDb.getInstance().getArtifactInstancesByPath(null, inAllDataSourcesPath); + EamDb.getInstance().getArtifactInstancesByPath(null, inAllDataSourcesPath); Assert.fail("getArtifactInstancesByPath failed to throw exception for null type"); } catch (EamDbException ex) { // This is the expected behavior From bb0a7c26c7cc5c9538417512f5ca06e51b9ba56e Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Wed, 7 Feb 2018 11:41:44 -0500 Subject: [PATCH 57/62] Revisions. --- .../autopsy/keywordsearch/ExtractedContentPanel.java | 5 +---- .../org/sleuthkit/autopsy/keywordsearch/IndexedText.java | 7 +++---- .../src/org/sleuthkit/autopsy/keywordsearch/RawText.java | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java index d6a81371b2..bc68962693 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java @@ -648,9 +648,6 @@ class ExtractedContentPanel extends javax.swing.JPanel { return source.getText(); } - @NbBundle.Messages({ - "ExtractedContentPanel.getText.error=Error getting text." - }) @Override protected void done() { super.done(); @@ -667,7 +664,7 @@ class ExtractedContentPanel extends javax.swing.JPanel { } catch (InterruptedException | CancellationException | ExecutionException ex) { logger.log(Level.SEVERE, "Error getting marked up text", ex); //NON-NLS - setPanelText(Bundle.ExtractedContentPanel_getText_error(), true); + setPanelText(Bundle.IndexedText_errorMessage_errorGettingText(), true); } updateControls(source); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexedText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexedText.java index 9095788c6a..17366483e3 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexedText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexedText.java @@ -27,10 +27,9 @@ import org.openide.util.NbBundle; * view the stored text. */ @NbBundle.Messages({ - "IndexedText.errorMessage.errorGettingText=

Error retrieving indexed text.

", - "IndexedText.warningMessage.knownFile=

This file is a known file (based on MD5 hash) and does not have indexed text.

", - "IndexedText.warningMessage.noTextAvailable=

No indexed text for this file.

", - "IndexedText.htmlStyle.textBodyItalics={0}" + "IndexedText.errorMessage.errorGettingText=Error retrieving indexed text.", + "IndexedText.warningMessage.knownFile=This file is a known file (based on MD5 hash) and does not have indexed text.", + "IndexedText.warningMessage.noTextAvailable=No indexed text for this file." }) interface IndexedText { diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java index c7c263ce48..789de3fd50 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/RawText.java @@ -245,8 +245,7 @@ class RawText implements IndexedText { if (msg == null) { msg = Bundle.IndexedText_warningMessage_noTextAvailable(); } - String htmlMsg = Bundle.IndexedText_htmlStyle_textBodyItalics(msg); - return htmlMsg; + return msg; } int chunkId = currentPage; From 4cd548e456532e502172f4b7bcaa8138a16e7da6 Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Wed, 7 Feb 2018 22:43:56 -0500 Subject: [PATCH 58/62] 3536 - Look at all Content in node so that artifacts are not shown --- .../corecomponents/DataContentViewerHex.java | 2 +- .../DataContentViewerString.java | 3 +- .../DataContentViewerUtility.java | 54 +++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100755 Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerUtility.java diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java index a7a97e4b75..7a4df69e9d 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java @@ -453,7 +453,7 @@ public class DataContentViewerHex extends javax.swing.JPanel implements DataCont return; } - Content content = (selectedNode).getLookup().lookup(Content.class); + Content content = DataContentViewerUtility.getDefaultContent(selectedNode); if (content == null) { resetComponent(); return; diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java index 14cb2eb2c1..936ff3c46b 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java @@ -452,8 +452,7 @@ public class DataContentViewerString extends javax.swing.JPanel implements DataC return; } - Lookup lookup = selectedNode.getLookup(); - Content content = lookup.lookup(Content.class); + Content content = DataContentViewerUtility.getDefaultContent(selectedNode); if (content != null) { this.setDataView(content, 0); return; diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerUtility.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerUtility.java new file mode 100755 index 0000000000..53491b407e --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerUtility.java @@ -0,0 +1,54 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2018 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.corecomponents; + +import org.sleuthkit.datamodel.Content; +import org.openide.nodes.Node; +import org.sleuthkit.datamodel.BlackboardArtifact; + +/** + * Utility classes for content viewers. + * In theory, this would live in the contentviewer package, + * but the initial method was needed only be viewers in + * corecomponents and therefore can stay out of public API. + */ +class DataContentViewerUtility { + /** + * Returns the first non-Blackboard Artifact from a Node. + * Needed for (at least) Hex and Strings that want to view + * all types of content (not just AbstractFile), but don't want + * to display an artifact unless that's the only thing there. + * Scenario is hash hit or interesting item hit. + * + * @param node Node passed into content viewer + * @return highest priority content or null if there is no content + */ + static Content getDefaultContent(Node node) { + Content bbContentSeen = null; + for (Content content : (node).getLookup().lookupAll(Content.class)) { + if (content instanceof BlackboardArtifact) { + bbContentSeen = content; + } + else { + return content; + } + } + return bbContentSeen; + } +} From 4bcd518f4bb7f71b3e42b3499344e969a5a1b31c Mon Sep 17 00:00:00 2001 From: "U-BASIS\\zhaohui" Date: Thu, 8 Feb 2018 15:04:29 -0500 Subject: [PATCH 59/62] Disalbe the run time test in nightly. --- test/script/regression.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/script/regression.py b/test/script/regression.py index afe1ea4976..53f8810ff8 100644 --- a/test/script/regression.py +++ b/test/script/regression.py @@ -810,7 +810,7 @@ class TestConfiguration(object): if parsed_config.getElementsByTagName("singleUser_golddir"): self.singleUser_gold = parsed_config.getElementsByTagName("singleUser_golddir")[0].getAttribute("value").encode().decode("utf_8") if parsed_config.getElementsByTagName("timing"): - self.timing = parsed_config.getElementsByTagName("timing")[0].getAttribute("value").encode().decode("utf_8") + self.timing = ("True" == parsed_config.getElementsByTagName("timing")[0].getAttribute("value").encode().decode("utf_8")) if parsed_config.getElementsByTagName("autopsyPlatform"): self.autopsyPlatform = parsed_config.getElementsByTagName("autopsyPlatform")[0].getAttribute("value").encode().decode("utf_8") # Multi-user settings @@ -1392,7 +1392,7 @@ class Logs(object): try: Logs._fill_ingest_data(test_data) except Exception as e: - Errors.print_error("Error: Unknown fatal error when filling test_config data.") + Errors.print_error("Error when filling test_config data.") Errors.print_error(str(e) + "\n") logging.critical(traceback.format_exc()) # If running in verbose mode (-v) @@ -1469,7 +1469,6 @@ class Logs(object): test_data.heap_space = search_logs("Heap memory usage:", test_data)[0].rstrip().split(": ")[1] ingest_line = search_logs("Ingest (including enqueue)", test_data)[0] test_data.total_ingest_time = get_word_at(ingest_line, 6).rstrip() - message_line_count = find_msg_in_log_set("Ingest messages count:", test_data) test_data.indexed_files = message_line_count From 5cf44c5b5523f99e6ed5f54f1545596b6a74d3f8 Mon Sep 17 00:00:00 2001 From: Ann Priestman Date: Fri, 9 Feb 2018 11:04:44 -0500 Subject: [PATCH 60/62] Fix codacy warnings --- .../datamodel/CentralRepoDatamodelTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java index 644372feab..cce1e807e1 100644 --- a/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java +++ b/Core/test/qa-functional/src/org/sleuthkit/autopsy/centralrepository/datamodel/CentralRepoDatamodelTest.java @@ -792,7 +792,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test adding instance with null path // This will fail in the CorrelationAttributeInstance constructor try { - CorrelationAttributeInstance inst = new CorrelationAttributeInstance(case1, dataSource1fromCase1, null); + new CorrelationAttributeInstance(case1, dataSource1fromCase1, null); Assert.fail("CorrelationAttributeInstance failed to throw exception for null path"); } catch (EamDbException ex) { // This is the expected behavior @@ -821,7 +821,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test null value // This will fail in the CorrelationAttribute constructor try { - CorrelationAttribute attr = new CorrelationAttribute(fileType, null); + new CorrelationAttribute(fileType, null); Assert.fail("addArtifact failed to throw exception for null value"); } catch (EamDbException ex) { // This is the expected behavior @@ -1127,7 +1127,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Test new type with null db name // The constructor should fail in this case try { - CorrelationAttribute.Type temp = new CorrelationAttribute.Type("temp", null, false, false); + new CorrelationAttribute.Type("temp", null, false, false); Assert.fail("CorrelationAttribute.Type failed to throw exception for null db table name"); } catch (EamDbException ex) { // This is the expected behavior @@ -1579,7 +1579,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Since it isn't possible to get a null hash into the EamGlobalFileInstance, skip trying to // call addReferenceInstance and just test the EamGlobalFileInstance constructor try { - EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, null, TskData.FileKnown.BAD, "comment"); + new EamGlobalFileInstance(notableSet1id, null, TskData.FileKnown.BAD, "comment"); Assert.fail("EamGlobalFileInstance failed to throw exception for null hash"); } catch (EamDbException ex) { // This is the expected behavior @@ -1589,7 +1589,7 @@ public class CentralRepoDatamodelTest extends TestCase { // Since it isn't possible to get a null known status into the EamGlobalFileInstance, skip trying to // call addReferenceInstance and just test the EamGlobalFileInstance constructor try { - EamGlobalFileInstance temp = new EamGlobalFileInstance(notableSet1id, inAllSetsHash, null, "comment"); + new EamGlobalFileInstance(notableSet1id, inAllSetsHash, null, "comment"); Assert.fail("EamGlobalFileInstance failed to throw exception for null type"); } catch (EamDbException ex) { // This is the expected behavior From be029b026a5da4f2b6e78b55c48687571a0a159c Mon Sep 17 00:00:00 2001 From: "U-BASIS\\zhaohui" Date: Fri, 9 Feb 2018 14:54:50 -0500 Subject: [PATCH 61/62] Update regresion.py to use the new datetime format in logs. --- test/script/regression.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/script/regression.py b/test/script/regression.py index 53f8810ff8..3e9ee2e585 100644 --- a/test/script/regression.py +++ b/test/script/regression.py @@ -1454,10 +1454,10 @@ class Logs(object): Errors.print_error("Error: Unable to open autopsy.log.0.") Errors.print_error(str(e) + "\n") logging.warning(traceback.format_exc()) - # Start date must look like: "Fri Mar 27 13:27:34 EDT 2015" + # Start date must look like: "" # End date must look like: "Mon Jul 16 13:02:42 2012" # *** If logging time format ever changes this will break *** - start = datetime.datetime.strptime(test_data.start_date, "%a %b %d %H:%M:%S %Z %Y") + start = datetime.datetime.strptime(test_data.start_date, "%Y-%m-%d %H:%M:%S.%f") end = datetime.datetime.strptime(test_data.end_date, "%a %b %d %H:%M:%S %Y") test_data.total_test_time = str(end - start) From dca73677b3208a76158c60a2b86229fe6e3670be Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Fri, 9 Feb 2018 23:35:34 -0500 Subject: [PATCH 62/62] Fixed merge. --- .../modules/filetypeid/FileTypeDetector.java | 12 ++++---- .../filetypeid/FileTypeIdIngestModule.java | 28 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java index f13dd8f223..795afd0838 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java @@ -42,8 +42,8 @@ import org.sleuthkit.datamodel.TskData; */ public class FileTypeDetector { - private static final Logger LOGGER = Logger.getLogger(FileTypeDetector.class.getName()); - private static final Tika TIKA = new Tika(); + private static final Logger logger = Logger.getLogger(FileTypeDetector.class.getName()); + private static final Tika tika = new Tika(); private static final int SLACK_FILE_THRESHOLD = 4096; private final List userDefinedFileTypes; private final List autopsyDefinedFileTypes; @@ -224,7 +224,7 @@ public class FileTypeDetector { ReadContentInputStream stream = new ReadContentInputStream(file); try (TikaInputStream tikaInputStream = TikaInputStream.get(stream)) { - String tikaType = TIKA.detect(tikaInputStream, file.getName()); + String tikaType = tika.detect(tikaInputStream, file.getName()); /* * Remove the Tika suffix from the MIME type name. @@ -367,7 +367,7 @@ public class FileTypeDetector { * * @throws TskCoreException if detection is required and there is a problem * writing the result to the case database. - * @deprecated Use detectMIMEType instead, and call AbstractFile.setMIMEType + * @deprecated Use getMIMEType instead, and call AbstractFile.setMIMEType * and AbstractFile.save to save the result to the file object and the * database. */ @@ -391,7 +391,7 @@ public class FileTypeDetector { * @throws TskCoreException if detection is required and there is a problem * writing the result to the case database. * - * @deprecated Use detectMIMEType instead, and call AbstractFile.setMIMEType + * @deprecated Use getMIMEType instead, and call AbstractFile.setMIMEType * and AbstractFile.save to save the result to the file object and the * database. */ @@ -413,7 +413,7 @@ public class FileTypeDetector { * were uncertain, octet-stream is returned. * * @throws TskCoreException - * @deprecated Use detectMIMEType instead. + * @deprecated Use getMIMEType instead. */ @Deprecated public String detect(AbstractFile file) throws TskCoreException { diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index 13c68cd53f..be0bcdfbb3 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -47,10 +47,10 @@ import org.sleuthkit.datamodel.TskCoreException; }) public class FileTypeIdIngestModule implements FileIngestModule { - private static final Logger LOGGER = Logger.getLogger(FileTypeIdIngestModule.class.getName()); + private static final Logger logger = Logger.getLogger(FileTypeIdIngestModule.class.getName()); private long jobId; - private static final HashMap INGEST_JOB_TOTALS = new HashMap<>(); - private static final IngestModuleReferenceCounter REF_COUNTER = new IngestModuleReferenceCounter(); + private static final HashMap totalsForIngestJobs = new HashMap<>(); + private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter(); private FileTypeDetector fileTypeDetector; /** @@ -67,7 +67,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { try { return new FileTypeDetector().isDetectable(mimeType); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - LOGGER.log(Level.SEVERE, "Failed to create file type detector", ex); //NON-NLS + logger.log(Level.SEVERE, "Failed to create file type detector", ex); //NON-NLS return false; } } @@ -82,7 +82,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { @Override public void startUp(IngestJobContext context) throws IngestModuleException { jobId = context.getJobId(); - REF_COUNTER.incrementAndGet(jobId); + refCounter.incrementAndGet(jobId); try { fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { @@ -99,7 +99,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { */ try { long startTime = System.currentTimeMillis(); - String mimeType = fileTypeDetector.detectMIMEType(file); + String mimeType = fileTypeDetector.getMIMEType(file); file.setMIMEType(mimeType); FileType fileType = detectUserDefinedFileType(file); if (fileType != null && fileType.createInterestingFileHit()) { @@ -108,7 +108,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { addToTotals(jobId, (System.currentTimeMillis() - startTime)); return ProcessResult.OK; } catch (Exception e) { - LOGGER.log(Level.WARNING, String.format("Error while attempting to determine file type of file %d", file.getId()), e); //NON-NLS + logger.log(Level.WARNING, String.format("Error while attempting to determine file type of file %d", file.getId()), e); //NON-NLS return ProcessResult.ERROR; } } @@ -157,10 +157,10 @@ public class FileTypeIdIngestModule implements FileIngestModule { try { Case.getCurrentCase().getServices().getBlackboard().indexArtifact(artifact); } catch (Blackboard.BlackboardException ex) { - LOGGER.log(Level.SEVERE, String.format("Unable to index TSK_INTERESTING_FILE_HIT blackboard artifact %d (file obj_id=%d)", artifact.getArtifactID(), file.getId()), ex); //NON-NLS + logger.log(Level.SEVERE, String.format("Unable to index TSK_INTERESTING_FILE_HIT blackboard artifact %d (file obj_id=%d)", artifact.getArtifactID(), file.getId()), ex); //NON-NLS } } catch (TskCoreException ex) { - LOGGER.log(Level.SEVERE, String.format("Unable to create TSK_INTERESTING_FILE_HIT artifact for file (obj_id=%d)", file.getId()), ex); //NON-NLS + logger.log(Level.SEVERE, String.format("Unable to create TSK_INTERESTING_FILE_HIT artifact for file (obj_id=%d)", file.getId()), ex); //NON-NLS } } @@ -170,10 +170,10 @@ public class FileTypeIdIngestModule implements FileIngestModule { * If this is the instance of this module for this ingest job, post a * summary message to the ingest messages box. */ - if (REF_COUNTER.decrementAndGet(jobId) == 0) { + if (refCounter.decrementAndGet(jobId) == 0) { IngestJobTotals jobTotals; synchronized (this) { - jobTotals = INGEST_JOB_TOTALS.remove(jobId); + jobTotals = totalsForIngestJobs.remove(jobId); } if (jobTotals != null) { StringBuilder detailsSb = new StringBuilder(); @@ -202,15 +202,15 @@ public class FileTypeIdIngestModule implements FileIngestModule { * @param matchTimeInc Amount of time to add. */ private static synchronized void addToTotals(long jobId, long matchTimeInc) { - IngestJobTotals ingestJobTotals = INGEST_JOB_TOTALS.get(jobId); + IngestJobTotals ingestJobTotals = totalsForIngestJobs.get(jobId); if (ingestJobTotals == null) { ingestJobTotals = new IngestJobTotals(); - INGEST_JOB_TOTALS.put(jobId, ingestJobTotals); + totalsForIngestJobs.put(jobId, ingestJobTotals); } ingestJobTotals.matchTime += matchTimeInc; ingestJobTotals.numFiles++; - INGEST_JOB_TOTALS.put(jobId, ingestJobTotals); + totalsForIngestJobs.put(jobId, ingestJobTotals); } private static class IngestJobTotals {