Skip to content

Commit

Permalink
Use junit test annotations instead of extending TestCase (#1323)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdrwenski authored Mar 27, 2024
1 parent 1672ba8 commit e4ce852
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
8 changes: 6 additions & 2 deletions opendap/src/test/java/ucar/nc2/dods/TestAxisAttrCombiner.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
*/
package ucar.nc2.dods;

import junit.framework.TestCase;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ucar.nc2.Attribute;
import ucar.nc2.constants._Coordinate;
import java.lang.invoke.MethodHandles;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static ucar.nc2.dods.DODSNetcdfFile.combineAxesAttrs;

public class TestAxisAttrCombiner extends TestCase {
public class TestAxisAttrCombiner {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

@Test
Expand Down Expand Up @@ -47,6 +50,7 @@ public void testAxisAttrCombineOverlap() {
assertEquals(attr3.getStringValue().split("\\s").length, 6);
}

@Test
public void testAxisAttrCombineOverlapMangled() {
Attribute attr1 = new Attribute(_Coordinate.Axes, " abe bec cid dave ");
Attribute attr2 = new Attribute(_Coordinate.Axes, "cid dave ed fin");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
// $Id: TestDODSStructureForSequence.java 51 2006-07-12 17:13:13Z caron $
package ucar.nc2.dods;

import junit.framework.TestCase;
import static org.junit.Assert.assertTrue;

import java.io.IOException;
import java.lang.invoke.MethodHandles;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ucar.nc2.Structure;
Expand All @@ -17,18 +20,11 @@
/**
* Test DODS Sequence access using DODSStructure.
*/
public class TestDODSStructureForSequence extends TestCase {
public class TestDODSStructureForSequence {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

public TestDODSStructureForSequence(String name) {
super(name);
}

// suppress "no test failure warning message */
public void testFake() throws Exception {
assert true;
}

@Ignore("Server dods.jpl.nasa.gov not found")
@Test
public void utestConstrainedAccess() {
// URL for the JPL QuikSCAT DODS File Server (DFS).
String dfsURL = "http://dods.jpl.nasa.gov/dods-bin/nph-dods/catalogs/quikscat/L2B/quikscat_L2.dat";
Expand Down
17 changes: 3 additions & 14 deletions opendap/src/test/java/ucar/nc2/dods/TestSequence.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ucar.nc2.dods;

import junit.framework.TestCase;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ucar.ma2.Array;
Expand All @@ -10,21 +10,10 @@
import java.lang.invoke.MethodHandles;
import ucar.nc2.dataset.NetcdfDatasets;

public class TestSequence extends TestCase {
public class TestSequence {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

final String TITLE = "OpenDAP Sequence Test";

public TestSequence(String name, String testdir) {
super(name);
}

public TestSequence(String name) {
super(name);
}

static String baseline = "";

@Test
public void testSequence() {
// The old url: "http://tsds.net/tsds/test/Scalar" is no longer valid.
// So replaced with an equivalent.
Expand Down

0 comments on commit e4ce852

Please sign in to comment.