diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java index 6c245954d9..b4daf83988 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java @@ -42,6 +42,7 @@ import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.BlackBoardArtifactTagDeletedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagAddedEvent; import org.sleuthkit.autopsy.casemodule.events.ContentTagDeletedEvent; +import static org.sleuthkit.autopsy.datamodel.DisplayableItemNode.findLinked; import org.sleuthkit.autopsy.timeline.actions.ViewArtifactInTimelineAction; import org.sleuthkit.autopsy.timeline.actions.ViewFileInTimelineAction; import org.sleuthkit.datamodel.AbstractFile; @@ -100,7 +101,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { } } else if (eventType.equals(Case.Events.CONTENT_TAG_DELETED.toString())) { ContentTagDeletedEvent event = (ContentTagDeletedEvent) evt; - if (event.getDeletedTagInfo().getContentID()== associated.getId()) { + if (event.getDeletedTagInfo().getContentID() == associated.getId()) { updateSheet(); } } else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) { @@ -194,6 +195,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { return actionsList.toArray(new Action[actionsList.size()]); } + @NbBundle.Messages({"# {0} - artifactDisplayName", "BlackboardArtifactNode.displayName.artifact={0} Artifact"}) /** * Set the filter node display name. The value will either be the file name * or something along the lines of e.g. "Messages Artifact" for keyword hits @@ -208,15 +210,19 @@ public class BlackboardArtifactNode extends DisplayableItemNode { // If this is a node for a keyword hit on an artifact, we set the // display name to be the artifact type name followed by " Artifact" // e.g. "Messages Artifact". - if (artifact != null && - (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() || - artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID())) { + if (artifact != null + && (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() + || artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID())) { try { for (BlackboardAttribute attribute : artifact.getAttributes()) { if (attribute.getAttributeType().getTypeID() == ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT.getTypeID()) { BlackboardArtifact associatedArtifact = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong()); if (associatedArtifact != null) { - displayName = associatedArtifact.getDisplayName() + " Artifact"; + if (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()) { + artifact.getDisplayName(); + } else { + displayName = NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.displayName.artifact", associatedArtifact.getDisplayName()); + } } } } @@ -227,6 +233,13 @@ public class BlackboardArtifactNode extends DisplayableItemNode { this.setDisplayName(displayName); } + @NbBundle.Messages({ + "BlackboardArtifactNode.createSheet.artifactType.displayName=Artifact Type", + "BlackboardArtifactNode.createSheet.artifactType.name=Artifact Type", + "BlackboardArtifactNode.createSheet.artifactDetails.displayName=Artifact Details", + "BlackboardArtifactNode.createSheet.artifactDetails.name=Artifact Details", + "BlackboardArtifactNode.artifact.displayName=Artifact"}) + @Override protected Sheet createSheet() { Sheet s = super.createSheet(); @@ -244,6 +257,24 @@ public class BlackboardArtifactNode extends DisplayableItemNode { NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.srcFile.displayName"), NO_DESCR, this.getDisplayName())); + if (artifact.getArtifactTypeID() == ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()) { + try { + BlackboardAttribute attribute = artifact.getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_ASSOCIATED_ARTIFACT)); + if (attribute != null) { + BlackboardArtifact associatedArtifact = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifact(attribute.getValueLong()); + ss.put(new NodeProperty<>(NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactType.name"), + NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactType.displayName"), + NO_DESCR, + associatedArtifact.getDisplayName() + " " + NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.artifact.displayName"))); + ss.put(new NodeProperty<>(NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactDetails.name"), + NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.createSheet.artifactDetails.displayName"), + NO_DESCR, + associatedArtifact.getShortDescription())); + } + } catch (TskCoreException ex) { + // Do nothing since the display name will be set to the file name. + } + } for (Map.Entry entry : map.entrySet()) { ss.put(new NodeProperty<>(entry.getKey(), @@ -354,7 +385,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { LOGGER.log(Level.SEVERE, "Failed to get tags for artifact " + artifact.getDisplayName(), ex); } ss.put(new NodeProperty<>("Tags", NbBundle.getMessage(AbstractAbstractFileNode.class, "BlackboardArtifactNode.createSheet.tags.displayName"), - NO_DESCR, tags.stream().map(t -> t.getName().getDisplayName()).collect(Collectors.joining(", ")))); + NO_DESCR, tags.stream().map(t -> t.getName().getDisplayName()).collect(Collectors.joining(", ")))); return s; } @@ -469,7 +500,6 @@ public class BlackboardArtifactNode extends DisplayableItemNode { NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.getAssocCont.exception.msg")); } - @Override public boolean isLeafTypeNode() { return true; diff --git a/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java b/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java index b95112232e..236c9afecd 100755 --- a/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java +++ b/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java @@ -39,7 +39,9 @@ import javax.swing.text.JTextComponent; import org.netbeans.jellytools.MainWindowOperator; import org.netbeans.jellytools.NbDialogOperator; import org.netbeans.jellytools.WizardOperator; +import org.netbeans.jemmy.JemmyProperties; import org.netbeans.jemmy.Timeout; +import org.netbeans.jemmy.Timeouts; import org.netbeans.jemmy.operators.JButtonOperator; import org.netbeans.jemmy.operators.JCheckBoxOperator; import org.netbeans.jemmy.operators.JComboBoxOperator; @@ -57,7 +59,7 @@ public class AutopsyTestCases { private static final Logger logger = Logger.getLogger(AutopsyTestCases.class.getName()); private long start; - + /** * Escapes the slashes in a file or directory path. * @@ -104,8 +106,13 @@ public class AutopsyTestCases { } public void testStartAddImageFileDataSource() { + /* + * This time out is to give time for creating case database and opening solr index + */ + new Timeout("pausing", 120000).sleep(); logger.info("Starting Add Image process"); WizardOperator wo = new WizardOperator("Add Data Source"); + wo.setTimeouts(resetTimeouts("WindowWaiter.WaitWindowTimeOut", 240000)); while(!wo.btNext().isEnabled()){ new Timeout("pausing", 1000).sleep(); // give it a second till the Add Data Source dialog enabled } @@ -123,8 +130,13 @@ public class AutopsyTestCases { } public void testStartAddLogicalFilesDataSource() { + /* + * This time out is to give time for creating case database and opening solr index + */ + new Timeout("pausing", 120000).sleep(); logger.info("Starting Add Logical Files process"); WizardOperator wo = new WizardOperator("Add Data Source"); + wo.setTimeouts(resetTimeouts("WindowWaiter.WaitWindowTimeOut", 240000)); while(!wo.btNext().isEnabled()){ new Timeout("pausing", 1000).sleep(); // give it a second till the Add Data Source dialog enabled } @@ -317,4 +329,15 @@ public class AutopsyTestCases { } } + + /* + * Nightly test failed at WindowWaiter.WaitWindowTimeOut because of TimeoutExpiredException. So we + * use this conveninent method to override the default Jemmy Timeouts value. + */ + + private Timeouts resetTimeouts(String name, int value) { + Timeouts timeouts = JemmyProperties.getCurrentTimeouts(); + timeouts.setTimeout(name, value); + return timeouts; + } }