mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-11 23:46:15 +00:00
3180: Move unit test to qa-functional test and adding Case creation and deletion
This commit is contained in:
parent
2bc4a03f0a
commit
a8648cdbb1
@ -244,6 +244,46 @@
|
|||||||
<code-name-base>org.netbeans.libs.junit4</code-name-base>
|
<code-name-base>org.netbeans.libs.junit4</code-name-base>
|
||||||
<compile-dependency/>
|
<compile-dependency/>
|
||||||
</test-dependency>
|
</test-dependency>
|
||||||
|
<test-dependency>
|
||||||
|
<code-name-base>org.netbeans.modules.jellytools.java</code-name-base>
|
||||||
|
<compile-dependency/>
|
||||||
|
</test-dependency>
|
||||||
|
<test-dependency>
|
||||||
|
<code-name-base>org.netbeans.modules.jellytools.platform</code-name-base>
|
||||||
|
<compile-dependency/>
|
||||||
|
</test-dependency>
|
||||||
|
<test-dependency>
|
||||||
|
<code-name-base>org.netbeans.modules.jemmy</code-name-base>
|
||||||
|
<compile-dependency/>
|
||||||
|
</test-dependency>
|
||||||
|
<test-dependency>
|
||||||
|
<code-name-base>org.netbeans.modules.nbjunit</code-name-base>
|
||||||
|
<compile-dependency/>
|
||||||
|
</test-dependency>
|
||||||
|
</test-type>
|
||||||
|
<test-type>
|
||||||
|
<name>qa-functional</name>
|
||||||
|
<test-dependency>
|
||||||
|
<code-name-base>org.netbeans.libs.junit4</code-name-base>
|
||||||
|
<compile-dependency/>
|
||||||
|
</test-dependency>
|
||||||
|
<test-dependency>
|
||||||
|
<code-name-base>org.netbeans.modules.jellytools.java</code-name-base>
|
||||||
|
<compile-dependency/>
|
||||||
|
</test-dependency>
|
||||||
|
<test-dependency>
|
||||||
|
<code-name-base>org.netbeans.modules.jellytools.platform</code-name-base>
|
||||||
|
<compile-dependency/>
|
||||||
|
</test-dependency>
|
||||||
|
<test-dependency>
|
||||||
|
<code-name-base>org.netbeans.modules.jemmy</code-name-base>
|
||||||
|
<compile-dependency/>
|
||||||
|
</test-dependency>
|
||||||
|
<test-dependency>
|
||||||
|
<code-name-base>org.netbeans.modules.nbjunit</code-name-base>
|
||||||
|
<recursive/>
|
||||||
|
<compile-dependency/>
|
||||||
|
</test-dependency>
|
||||||
</test-type>
|
</test-type>
|
||||||
</test-dependencies>
|
</test-dependencies>
|
||||||
<public-packages>
|
<public-packages>
|
||||||
|
@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2011-2017 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> 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.ingest;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertTrue;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
import org.netbeans.junit.NbModuleSuite;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.CaseActionException;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.CaseDetails;
|
||||||
|
import junit.framework.Test;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.openide.util.Exceptions;
|
||||||
|
|
||||||
|
public class IngestFileFiltersTest extends TestCase {
|
||||||
|
|
||||||
|
private static final Path caseDirectoryPath = Paths.get(System.getProperty("java.io.tmpdir"), "IngestFileFiltersTest");
|
||||||
|
private static final File CASE_DIR = new File(caseDirectoryPath.toString());
|
||||||
|
|
||||||
|
public static Test suite() {
|
||||||
|
NbModuleSuite.Configuration conf = NbModuleSuite.createConfiguration(IngestFileFiltersTest.class).
|
||||||
|
clusters(".*").
|
||||||
|
enableModules(".*");
|
||||||
|
return conf.suite();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setUp() {
|
||||||
|
try {
|
||||||
|
Case.createAsCurrentCase(Case.CaseType.SINGLE_USER_CASE, caseDirectoryPath.toString(), new CaseDetails("IngestFiltersTest"));
|
||||||
|
} catch (CaseActionException ex) {
|
||||||
|
Exceptions.printStackTrace(ex);
|
||||||
|
}
|
||||||
|
assertTrue(CASE_DIR.exists());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void tearDown() {
|
||||||
|
try {
|
||||||
|
Case.closeCurrentCase();
|
||||||
|
FileUtils.deleteDirectory(CASE_DIR);
|
||||||
|
|
||||||
|
} catch (CaseActionException | IOException ex) {
|
||||||
|
Exceptions.printStackTrace(ex);
|
||||||
|
}
|
||||||
|
assertFalse(CASE_DIR.exists());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testFilter() {
|
||||||
|
System.out.println("testFilter");
|
||||||
|
}
|
||||||
|
}
|
@ -31,7 +31,7 @@ import org.sleuthkit.datamodel.Content;
|
|||||||
* thread.
|
* thread.
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
public class UnitTestDspCallback extends DataSourceProcessorCallback {
|
public class FunctionalTestDspCallback extends DataSourceProcessorCallback {
|
||||||
|
|
||||||
private final Object monitor;
|
private final Object monitor;
|
||||||
private final List<String> errorMessages = new ArrayList<>();
|
private final List<String> errorMessages = new ArrayList<>();
|
||||||
@ -46,7 +46,7 @@ public class UnitTestDspCallback extends DataSourceProcessorCallback {
|
|||||||
* @param monitor A monitor for the callback to signal when the data source
|
* @param monitor A monitor for the callback to signal when the data source
|
||||||
* processor completes its processing.
|
* processor completes its processing.
|
||||||
*/
|
*/
|
||||||
UnitTestDspCallback(Object monitor) {
|
FunctionalTestDspCallback(Object monitor) {
|
||||||
this.monitor = monitor;
|
this.monitor = monitor;
|
||||||
}
|
}
|
||||||
|
|
@ -25,7 +25,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgress
|
|||||||
* A data source processor progress monitor for unit testing.
|
* A data source processor progress monitor for unit testing.
|
||||||
*/
|
*/
|
||||||
@Immutable
|
@Immutable
|
||||||
public class UnitTestDspProgressMonitor implements DataSourceProcessorProgressMonitor {
|
public class FunctionalTestDspProgressMonitor implements DataSourceProcessorProgressMonitor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switches the progress indicator to indeterminate mode (the total number
|
* Switches the progress indicator to indeterminate mode (the total number
|
@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* Autopsy Forensic Browser
|
|
||||||
*
|
|
||||||
* Copyright 2011-2017 Basis Technology Corp.
|
|
||||||
* Contact: carrier <at> sleuthkit <dot> 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.ingest;
|
|
||||||
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.AfterClass;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.openide.modules.Places;
|
|
||||||
|
|
||||||
public class IngestFileFiltersTest {
|
|
||||||
|
|
||||||
public IngestFileFiltersTest() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void setUpClass() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterClass
|
|
||||||
public static void tearDownClass() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void setUp() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@After
|
|
||||||
public void tearDown() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testFilters() {
|
|
||||||
Places.getUserDirectory().getAbsoluteFile();
|
|
||||||
System.out.println("Test filter");
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user