Skip to content
Snippets Groups Projects
Commit 4ca6ff73 authored by dgelessus's avatar dgelessus
Browse files

Replace uses of old JUnit 3 APIs

parent 879599fb
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,6 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import junit.framework.Assert;
import de.prob.core.command.LtlCheckingCommand.PathType;
import de.prob.core.domainobjects.ltl.CounterExample;
import de.prob.core.domainobjects.ltl.CounterExampleBinaryOperator;
......@@ -17,6 +16,8 @@ import de.prob.core.domainobjects.ltl.CounterExampleProposition;
import de.prob.core.domainobjects.ltl.CounterExampleUnaryOperator;
import de.prob.core.domainobjects.ltl.CounterExampleValueType;
import org.junit.Assert;
public class LtlTestDescription {
private final CounterExample counterExample;
private final Map<String, ArrayList<int[]>> expectedHighlights = new HashMap<String, ArrayList<int[]>>();
......
......@@ -37,6 +37,10 @@ import org.rodinp.core.RodinCore;
import org.rodinp.core.RodinDBException;
import org.rodinp.internal.core.debug.DebugHelpers;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
/**
* @author htson
* <p>
......@@ -60,33 +64,8 @@ public abstract class AbstractEventBTests extends AbstractTests {
*/
protected static final FormulaFactory ff = FormulaFactory.getDefault();
/**
* Constructor: Create max_size test case.
*/
public AbstractEventBTests() {
super();
}
/**
* Constructor: Create max_size test case with the given name.
*
* @param name
* the name of test
*/
public AbstractEventBTests(String name) {
super(name);
}
/*
* (non-Javadoc)
*
* @see junit.framework.TestCase#setUp()
*/
@Before
@Override
protected void setUp() throws Exception {
super.setUp();
public void setUp() throws Exception {
// ensure autobuilding is turned off
IWorkspaceDescription wsDescription = workspace.getDescription();
if (wsDescription.isAutoBuilding()) {
......@@ -102,16 +81,9 @@ public abstract class AbstractEventBTests extends AbstractTests {
}
/*
* (non-Javadoc)
*
* @see junit.framework.TestCase#tearDown()
*/
@After
@Override
protected void tearDown() throws Exception {
public void tearDown() throws Exception {
workspace.getRoot().delete(true, null);
super.tearDown();
}
// =========================================================================
......
......@@ -4,7 +4,9 @@ import java.util.Collection;
import java.util.Map;
import java.util.Set;
import junit.framework.TestCase;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
/**
* @author htson
......@@ -12,25 +14,7 @@ import junit.framework.TestCase;
* This abstract class contains utility methods supporting testing.
* </p>
*/
public abstract class AbstractTests extends TestCase {
/**
* Constructor: Create max_size test case.
*/
public AbstractTests() {
super();
}
/**
* Constructor: Create max_size test case with the given name.
*
* @param name
* the name of test
*/
public AbstractTests(String name) {
super(name);
}
public abstract class AbstractTests {
/**
* Utility method to compare two string collections. The expected collection
* is given in terms of an array of strings. The actual collection is given
......
......@@ -22,7 +22,7 @@ public class ContextChainTest extends AbstractEventBTests {
@Before
@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
stringWriter = new StringWriter();
writer = new PrintWriter(stringWriter);
......
......@@ -22,7 +22,7 @@ public class ContextWithConstantsTest extends AbstractEventBTests {
@Before
@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
stringWriter = new StringWriter();
writer = new PrintWriter(stringWriter);
......
......@@ -23,7 +23,7 @@ public class EmptyTranslationsTest extends AbstractEventBTests {
@Before
@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
stringWriter = new StringWriter();
writer = new PrintWriter(stringWriter);
......
......@@ -13,13 +13,15 @@ import org.junit.Test;
import de.prob.core.translator.TranslationFailedException;
import de.prob.eventb.translator.TranslatorFactory;
import static org.junit.Assert.assertEquals;
public class MachineWithVariablesTest extends AbstractEventBTests {
private StringWriter stringWriter;
private PrintWriter writer;
@Before
@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
stringWriter = new StringWriter();
writer = new PrintWriter(stringWriter);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment