Skip to content

Commit

Permalink
Removed test relying on external data which didn't really test proper…
Browse files Browse the repository at this point in the history
…ly anyway.
  • Loading branch information
tuh8888 committed Aug 24, 2020
1 parent 9bd36df commit e9ddd31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 50 deletions.
29 changes: 12 additions & 17 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -27,43 +27,11 @@
import edu.ucdenver.ccp.knowtator.TestingHelpers;
import edu.ucdenver.ccp.knowtator.model.KnowtatorModel;
import edu.ucdenver.ccp.knowtator.view.actions.ActionUnperformable;
import java.io.File;
import java.io.IOException;
import org.junit.jupiter.api.Test;

class IAAOptionsDialogTest {

@Test
void mergeProjectsTest() throws IOException {
File project1 = new File("/home/harrisonpl/Downloads/concepts+assertions_3_2 batch 1/CRAFT_assertions.knowtator");
File project2 = new File("/home/harrisonpl/Downloads/CRAFT high-level concept annotation project/CRAFT_assertions.knowtator");

KnowtatorModel model2 = new KnowtatorModel(project2, null);
model2.load(model2.getProjectLocation());

TestingHelpers.ProjectCounts model2Counts = new TestingHelpers.ProjectCounts(97, 740, 740, 412, 2, 0, 381, 96, 0);
TestingHelpers.countCollections(model2, model2Counts);

KnowtatorModel model1 = new KnowtatorModel(project1, null);
model1.load(model1.getProjectLocation());
TestingHelpers.ProjectCounts model1Counts = new TestingHelpers.ProjectCounts(97, 718, 718, 412, 1, 18, 381, 96, 0);
TestingHelpers.countCollections(model1, model1Counts);

KnowtatorModel mergeModel = IAAOptionsDialog.mergeProjects(project1, model2, null, true, null);
TestingHelpers.ProjectCounts overlapCounts = new TestingHelpers.ProjectCounts(97, 718, 718, 412, 0, 0, 0, 0, 0);
TestingHelpers.ProjectCounts mergeModelCounts = model1Counts.add(model2Counts, overlapCounts);
TestingHelpers.countCollections(mergeModel, mergeModelCounts);
// 97,
// 1458,
// 1458,
// 412,
// 3,
// 18,
// 381,
// 96,
// 0
}

private void checkMerge(String projectName1, TestingHelpers.ProjectCounts project1Counts, String projectName2, TestingHelpers.ProjectCounts project2Counts, TestingHelpers.ProjectCounts overlapCounts) throws IOException {
KnowtatorModel model1 = TestingHelpers.getLoadedModel(projectName1);
TestingHelpers.countCollections(model1, project1Counts);
Expand All @@ -78,7 +46,7 @@ private void checkMerge(String projectName1, TestingHelpers.ProjectCounts projec
}

@Test
public void mergeProjectsTest2() throws ActionUnperformable, IOException {
public void mergeProjectsTest() throws ActionUnperformable, IOException {
String projectName1 = "import_test_project1";

TestingHelpers.ProjectCounts model1Counts = new TestingHelpers.ProjectCounts(1, 1, 1, 0 , 1, 0 , 0, 0, 0);
Expand Down

0 comments on commit e9ddd31

Please sign in to comment.