Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored import statements to use org.junit.Assert #1167

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
----------------------------------------------------------------------------*/
package org.deegree.geometry.gml.validation;

import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertEquals;
import static org.deegree.gml.GMLVersion.GML_31;

import java.io.IOException;
Expand All @@ -45,7 +45,7 @@
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLStreamException;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.cs.exceptions.UnknownCRSException;
import org.deegree.geometry.validation.event.CurveDiscontinuity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLStreamException;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.commons.xml.XMLParsingException;
import org.deegree.cs.coordinatesystems.ICRS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
----------------------------------------------------------------------------*/
package org.deegree.geometry.wkbadapter;

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

import java.io.InputStream;
import java.io.StringWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

package org.deegree.gml;

import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertEquals;
import static org.deegree.gml.GMLVersion.fromMimeType;

import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
----------------------------------------------------------------------------*/
package org.deegree.gml.dictionary;

import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertEquals;
import static org.deegree.gml.GMLVersion.GML_30;

import java.io.IOException;
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.commons.xml.XMLParsingException;
import org.deegree.commons.xml.stax.XMLStreamReaderWrapper;
Expand Down Expand Up @@ -71,10 +71,10 @@ public void parsePolygonPatch() throws XMLStreamException, FactoryConfigurationE
XMLStreamReaderWrapper parser = getParser("PolygonPatch.gml");
PolygonPatch patch = (PolygonPatch) getPatchParser().parseSurfacePatch(parser,
CRSManager.getCRSRef("EPSG:4326"));
Assert.assertEquals(2.0, patch.getExteriorRing().getStartPoint().get0());
Assert.assertEquals(0.0, patch.getExteriorRing().getStartPoint().get1());
Assert.assertEquals(2.0, patch.getExteriorRing().getEndPoint().get0());
Assert.assertEquals(0.0, patch.getExteriorRing().getEndPoint().get1());
Assert.assertEquals(2.0, patch.getExteriorRing().getStartPoint().get0(), 0.01d);
Assert.assertEquals(0.0, patch.getExteriorRing().getStartPoint().get1(), 0.01d);
Assert.assertEquals(2.0, patch.getExteriorRing().getEndPoint().get0(), 0.01d);
Assert.assertEquals(0.0, patch.getExteriorRing().getEndPoint().get1(), 0.01d);
Assert.assertEquals(2, patch.getInteriorRings().size());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
----------------------------------------------------------------------------*/
package org.deegree.gml.schema;

import junit.framework.Assert;
import org.junit.Assert;
import org.apache.xerces.xs.XSElementDeclaration;
import org.apache.xerces.xs.XSTypeDefinition;
import org.deegree.commons.xml.stax.IndentingXMLStreamWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;

import junit.framework.Assert;
import org.junit.Assert;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
import static java.util.Calendar.MONTH;
import static java.util.Calendar.SECOND;
import static java.util.Calendar.YEAR;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.deegree.commons.tom.datetime.ISO8601Converter.formatDate;
import static org.deegree.commons.tom.datetime.ISO8601Converter.formatDateTime;
import static org.deegree.commons.tom.datetime.ISO8601Converter.formatDuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.io.IOException;
import java.io.InputStream;

import junit.framework.Assert;
import org.junit.Assert;

import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
----------------------------------------------------------------------------*/
package org.deegree.commons.xml;

import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertEquals;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Expand All @@ -50,7 +50,6 @@
import javax.xml.stream.XMLStreamWriter;

import junit.framework.AssertionFailedError;

import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

import javax.xml.namespace.QName;

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

import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Occam Labs UG (haftungsbeschränkt)

package org.deegree.commons.xml.stax;

import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertEquals;

import java.io.IOException;
import java.net.URL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import java.util.ArrayList;
import java.util.List;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.coverage.filter.raster.RasterFilter;
import org.deegree.coverage.rangeset.AxisSubset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
----------------------------------------------------------------------------*/
package org.deegree.coverage.raster;

import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.io.IOException;
import java.net.URL;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.coverage.raster.geom.RasterGeoReference;
import org.deegree.coverage.raster.geom.RasterGeoReference.OriginLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import javax.media.jai.ParameterBlockJAI;
import javax.media.jai.RenderedOp;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.commons.utils.FileUtils;
import org.deegree.coverage.raster.data.info.BandType;
Expand Down Expand Up @@ -117,7 +117,7 @@ public void testFloatRaster() throws IOException {
converter.putInt(0, val);
float realVal = converter.getFloat(0);
float compareVal = pird.getFloatSample(bx, by, 0);
Assert.assertEquals(compareVal, realVal);
Assert.assertEquals(compareVal, realVal, 0.01d);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import java.util.Map;
import java.util.UUID;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.commons.utils.FileUtils;
import org.deegree.commons.utils.TunableParameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@

package org.deegree.coverage.raster.geom;

import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertEquals;
import static org.deegree.coverage.raster.geom.RasterGeoReference.OriginLocation.CENTER;
import static org.deegree.coverage.raster.geom.RasterGeoReference.OriginLocation.OUTER;
import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.coverage.raster.geom.RasterGeoReference.OriginLocation;
import org.deegree.cs.coordinatesystems.ICRS;
Expand Down Expand Up @@ -81,12 +81,12 @@ public class RasterGeoRefTest {
@Test
public void relocatedOrigin() {
double[] origin = REF_CENTER.getOrigin(OUTER);
Assert.assertEquals(995., origin[0]);
Assert.assertEquals(1005., origin[1]);
Assert.assertEquals(995., origin[0], 0.01d);
Assert.assertEquals(1005., origin[1], 0.01d);

origin = REF_OUTER.getOrigin(CENTER);
Assert.assertEquals(1005., origin[0]);
Assert.assertEquals(995., origin[1]);
Assert.assertEquals(1005., origin[0], 0.01d);
Assert.assertEquals(995., origin[1], 0.01d);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

package org.deegree.coverage.raster.geom;

import junit.framework.Assert;
import org.junit.Assert;

import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import java.math.BigInteger;
import java.net.URISyntaxException;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.commons.utils.FileUtils;
import org.deegree.coverage.raster.AbstractRaster;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

package org.deegree.coverage.raster.integration;

import static junit.framework.Assert.assertNotNull;
import static org.junit.Assert.assertNotNull;
import static org.slf4j.LoggerFactory.getLogger;

import java.awt.image.BufferedImage;
Expand All @@ -47,7 +47,7 @@
import java.math.BigInteger;
import java.net.URISyntaxException;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.commons.utils.PixelCounter;
import org.deegree.coverage.raster.SimpleRaster;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import java.net.URISyntaxException;
import java.net.URL;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.coverage.raster.AbstractRaster;
import org.deegree.coverage.raster.SimpleRaster;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import java.io.IOException;
import java.io.InputStream;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.coverage.raster.AbstractRaster;
import org.deegree.coverage.raster.SimpleRaster;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import java.io.IOException;
import java.io.InputStream;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.coverage.raster.AbstractRaster;
import org.deegree.coverage.raster.SimpleRaster;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

package org.deegree.cs.configuration;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.util.ArrayList;
import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

import java.io.IOException;

import junit.framework.Assert;
import org.junit.Assert;

import org.deegree.cs.components.GeodeticDatum;
import org.deegree.cs.components.IDatum;
Expand Down Expand Up @@ -135,25 +135,25 @@ public void testProjectedCS() throws IOException {
IEllipsoid ellipsoid = ((GeodeticDatum) datum).getEllipsoid();
Assert.assertEquals(ellipsoidName, ellipsoid.getName());
Assert.assertEquals(ellipsoidName + ":" + ellipsoidCode, ellipsoid.getCode().getOriginal());
Assert.assertEquals(semiMajorAxis, ellipsoid.getSemiMajorAxis());
Assert.assertEquals(inverseFlattening, ellipsoid.getInverseFlattening());
Assert.assertEquals(semiMajorAxis, ellipsoid.getSemiMajorAxis(), 0.01d);
Assert.assertEquals(inverseFlattening, ellipsoid.getInverseFlattening(), 0.01d);

IPrimeMeridian pm = ((GeodeticDatum) datum).getPrimeMeridian();
Assert.assertEquals(pmName, pm.getName());
Assert.assertEquals(pmName + ":" + pmCode, pm.getCode().getOriginal());
Assert.assertEquals(Unit.DEGREE, pm.getAngularUnit());
Assert.assertEquals(pmLongitude, pm.getLongitude());
Assert.assertEquals(pmLongitude, pm.getLongitude(), 0.01d);
IProjection proj = projCRS.getProjection();
Assert.assertTrue(proj instanceof LambertConformalConic);

LambertConformalConic lcc = (LambertConformalConic) proj;
Assert.assertEquals(falseEasting, lcc.getFalseEasting());
Assert.assertEquals(falseNorthing, lcc.getFalseNorthing());
Assert.assertEquals(falseEasting, lcc.getFalseEasting(), 0.01d);
Assert.assertEquals(falseNorthing, lcc.getFalseNorthing(), 0.01d);
Assert.assertEquals(DTR * stdParallel1, lcc.getFirstParallelLatitude(), 1e-12);
Assert.assertEquals(DTR * stdParallel2, lcc.getSecondParallelLatitude(), 1e-12);
Assert.assertEquals(DTR * lonNatOrigin, lcc.getNaturalOrigin().x);
Assert.assertEquals(DTR * latNatOrigin, lcc.getNaturalOrigin().y);
Assert.assertEquals(scaleFactor, lcc.getScale());
Assert.assertEquals(DTR * lonNatOrigin, lcc.getNaturalOrigin().x, 0.01d);
Assert.assertEquals(DTR * latNatOrigin, lcc.getNaturalOrigin().y, 0.01d);
Assert.assertEquals(scaleFactor, lcc.getScale(), 0.01d);
}

private String buildPROJCS(String name, String code, String unitName, double unitConversion) {
Expand Down
Loading