Skip to content

Commit

Permalink
switch to Junit 5 @tag() instead of Junit 4 @category for filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Dec 17, 2023
1 parent 80b9812 commit a637efd
Show file tree
Hide file tree
Showing 107 changed files with 196 additions and 160 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
run: |
mvn -version
java -version
mvn --batch-mode clean install dependency:copy-dependencies -Dgroups="org.vcell.test.${{ matrix.test-group }}"
mvn --batch-mode clean install dependency:copy-dependencies -Dgroups="${{ matrix.test-group }}"
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:
run: |
mvn -version
java -version
mvn --batch-mode clean install dependency:copy-dependencies -Dgroups="org.vcell.test.Fast"
mvn --batch-mode clean install dependency:copy-dependencies -Dgroups="Fast"
- name: Build Docker image and push with latest tag
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ poetry install

#### Test Java and Python
```bash
mvn test -Dgroups=org.vcell.test.Fast
mvn test -Dgroups="Fast"

INSTALL_DIR=$(pwd)
cd ${INSTALL_DIR}/pythonCopasiOpt/vcell-opt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static cbit.vcell.client.task.AsynchClientTask.TASKTYPE_NONSWING_BLOCKING;
import static cbit.vcell.client.task.AsynchClientTask.TASKTYPE_SWING_BLOCKING;
import static cbit.vcell.client.task.AsynchClientTask.TASKTYPE_SWING_NONBLOCKING;
import org.junit.jupiter.api.Tag;

import java.awt.Component;
import java.awt.Label;
Expand All @@ -18,7 +19,7 @@
import org.vcell.test.Fast;

@Ignore
@Category(Fast.class)
@Tag("Fast")
public class ClientTaskDispatcherTest {
private Hashtable<String,Object> ht = new Hashtable<>();
private Component cmpt = new Label() ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
import org.junit.jupiter.api.Tag;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
Expand All @@ -27,7 +27,7 @@
import cbit.vcell.util.AmplistorUtils.AmplistorCredential;

@Ignore
@Category(Fast.class)
@Tag("Fast")
public class AmplistorUtilsTest {

private static final int NUMFILES = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import cbit.vcell.mongodb.VCMongoMessage;
import cbit.vcell.resource.NativeLib;
import cbit.vcell.resource.PropertyLoader;
import org.junit.jupiter.api.Tag;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -31,7 +32,7 @@
import org.vcell.test.BSTS_IT;
import org.vcell.util.VCellUtilityHub;

@RunWith(Parameterized.class)
@Tag("BSTS_IT")
@Category(BSTS_IT.class)
public class BSTSBasedOmexExecTest {
private final String testCaseFilename;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.vcell.cli.run;

import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Tag;
import org.junit.experimental.categories.Category;
import org.vcell.test.Fast;

Expand All @@ -11,7 +11,7 @@
import java.util.function.Predicate;


@Category(Fast.class)
@Tag("Fast")
public class BSTSBasedTestSuiteFiles {

private final static String[] allTestFiles = new String[]{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.Tag;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand All @@ -32,6 +32,7 @@

@RunWith(Parameterized.class)
@Category(BSTS_IT.class)
@Tag("BSTS_IT")
public class BiosimulationsExecTest {
private final String testCaseProjectID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import org.junit.Assert;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.Tag;
import org.vcell.test.Fast;

import java.io.InputStream;
import java.util.Arrays;
import java.util.function.Predicate;


@Category(Fast.class)
@Tag("Fast")
public class BiosimulationsFiles {

private final static String[] allProjectIDs = new String[]{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import cbit.vcell.mongodb.VCMongoMessage;
import cbit.vcell.resource.NativeLib;
import cbit.vcell.resource.PropertyLoader;
import org.junit.Test;
import org.junit.jupiter.api.Tag;
import org.junit.experimental.categories.Category;
import org.vcell.cli.CLIPythonManager;
import org.vcell.cli.CLIRecorder;
Expand All @@ -18,7 +18,7 @@

import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;

@Category(Fast.class)
@Tag("Fast")
public class ExecuteImplTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.vcell.cli.run;

import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Tag;
import org.junit.experimental.categories.Category;
import org.vcell.test.Fast;

Expand All @@ -11,6 +11,7 @@
import java.util.function.Predicate;

@Category(Fast.class)
@Tag("Fast")
public class SpatialArchiveFiles {
private final static String[] allTestFiles = new String[]{
"TinySpatialProject.omex",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.apache.commons.io.FileUtils;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.jupiter.api.Tag;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand All @@ -28,6 +28,7 @@

@RunWith(Parameterized.class)
@Category(Spatial_IT.class)
@Tag("Spatial_IT")
public class SpatialExecTest {
private final String testCaseFilename;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.common.io.Files;
import ncsa.hdf.hdf5lib.exceptions.HDF5Exception;
import org.jlibsedml.DataSet;
import cbit.vcell.resource.NativeLib;
import org.junit.jupiter.api.Tag;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.vcell.test.Fast;
Expand All @@ -18,7 +18,7 @@
import java.util.LinkedHashMap;
import java.util.List;

@Category(Fast.class)
@Tag("Fast")
public class Hdf5WriterTest {

public static Hdf5DataContainer createExampleData() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.vcell.util.gui;

import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Tag;
import org.junit.experimental.categories.Category;
import org.vcell.test.Fast;

Expand All @@ -12,7 +12,7 @@
import static org.junit.Assert.*;


@Category(Fast.class)
@Tag("Fast")
public class GeneralGuiUtilsTest {

private void aTest(BiFunction<Class<?>, Component, Container> method){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package org.vcell.util.gui;

import java.awt.Component;
import org.junit.jupiter.api.Tag;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.prefs.BackingStoreException;

import javax.swing.JFrame;

@Tag("Fast")
import org.junit.Ignore;

import cbit.vcell.resource.ResourceUtil;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.vcell.util.gui;

import org.junit.jupiter.api.Tag;
import java.net.URL;
import java.util.Map.Entry;

Expand All @@ -8,7 +9,7 @@
import org.junit.experimental.categories.Category;
import org.vcell.test.Fast;

@Category(Fast.class)
@Tag("Fast")
public class VCellIconsTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import cbit.vcell.solver.SimulationSymbolTable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.vcell.test.Fast;


/**
* Insert the type's description here.
Expand Down
4 changes: 2 additions & 2 deletions vcell-core/src/test/java/cbit/image/VCImageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import cbit.vcell.xml.XmlHelper;
import cbit.vcell.xml.XmlParseException;
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Tag;
import org.junit.experimental.categories.Category;
import org.vcell.sbml.vcell.SBMLExporter;
import org.vcell.sbml.vcell.SBMLImporter;
Expand All @@ -20,7 +20,7 @@
import java.io.StringBufferInputStream;
import java.util.Random;

@Category(Fast.class)
@Tag("Fast")
public class VCImageTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import cbit.vcell.xml.XmlParseException;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.jupiter.api.Tag;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
Expand All @@ -25,6 +25,7 @@

@Category(MathGen_IT.class)
@RunWith(Parameterized.class)
@Tag("MathGen_IT")
public class MathOverrideApplyTest {

private String filename_colon_appname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.Tag;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand All @@ -34,6 +34,7 @@

@Category(Fast.class)
@RunWith(Parameterized.class)
@Tag("Fast")
public class MathOverrideRoundTipTest {

private final String filename;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import cbit.vcell.xml.XmlHelper;
import cbit.vcell.xml.XmlParseException;
import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.jupiter.api.Tag;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.vcell.test.Fast;
Expand All @@ -29,6 +29,7 @@
import java.nio.charset.StandardCharsets;

@Category(Fast.class)
@Tag("Fast")
public class ModelCountAndConcentrationTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import cbit.vcell.xml.XmlHelper;
import cbit.vcell.xml.XmlParseException;
import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.jupiter.api.Tag;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.vcell.test.Fast;
Expand All @@ -38,6 +38,7 @@
import java.util.Map;

@Category(Fast.class)
@Tag("Fast")
public class ModelUnitConverterTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.commons.io.IOUtils;
import org.junit.*;
import org.junit.experimental.categories.Category;
import org.junit.jupiter.api.Tag;
import org.vcell.model.rbm.MolecularComponentPattern;
import org.vcell.solver.langevin.LangevinLngvWriter;
import org.vcell.solver.langevin.LangevinSolver;
Expand All @@ -40,6 +41,7 @@
import java.util.*;

@Category(Fast.class)
@Tag("Fast")
public class SpringSaLaDGoodReactionsTest {

private static final String reactionTestString = "'r0' :: 'MT0' : 'Site1' : 'state0' --> 'state1' Rate 50.0 Condition Free";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import cbit.vcell.solver.AnnotatedFunction;
import cbit.vcell.solver.VCSimulationDataIdentifier;
import org.janelia.saalfeldlab.n5.*;
import org.junit.After;
import org.junit.jupiter.api.*;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -35,6 +35,7 @@
import java.util.Random;

@Category(Fast.class)
@Tag("Fast")
public class N5ExporterTest {

private N5Reader n5Reader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.junit.*;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.jupiter.api.Tag;
import org.vcell.sbml.VcmlTestSuiteFiles;
import org.vcell.test.MathGen_IT;
import org.vcell.util.document.Version;
Expand All @@ -26,6 +26,7 @@

@Category(MathGen_IT.class)
@RunWith(Parameterized.class)
@Tag("MathGen_IT")
public class MathGenCompareTest {

private String filename_colon_appname;
Expand Down
Loading

0 comments on commit a637efd

Please sign in to comment.