1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
From: Ole Streicher <olebole@debian.org>
Date: Wed, 12 Oct 2022 16:20:38 +0200
Subject: Remove build of TFCAT validation harnesses
---
build.xml | 3 ++
src/main/uk/ac/starlink/tfcat/TfcatUtil.java | 55 ++--------------------------
src/main/uk/ac/starlink/tfcat/Validate.java | 5 +--
3 files changed, 8 insertions(+), 55 deletions(-)
diff --git a/build.xml b/build.xml
index ce1da29..5216cdf 100644
--- a/build.xml
+++ b/build.xml
@@ -386,6 +386,7 @@
<!-- Exclude any files in the source tree that should not be
! compiled -->
+ <exclude name="uk/ac/starlink/tfcat/TfcatStatus.java"/>
<exclude name="**/{Retired1.java}"/>
<exclude name="**/{Retired2.java}"/>
<exclude name="**/*.html"/>
@@ -971,6 +972,7 @@
deprecation="${deprecation}" >
<classpath refid="tests-classpath"/>
+ <exclude name="uk/ac/starlink/tfcat/ParseTest.java"/>
</javac>
@@ -1008,6 +1010,7 @@
<batchtest>
<fileset dir="${tests.dir}">
<include name="**/*Test.java"/>
+ <exclude name="uk/ac/starlink/tfcat/ParseTest.java"/>
</fileset>
</batchtest>
diff --git a/src/main/uk/ac/starlink/tfcat/TfcatUtil.java b/src/main/uk/ac/starlink/tfcat/TfcatUtil.java
index 5e5d9aa..830f278 100644
--- a/src/main/uk/ac/starlink/tfcat/TfcatUtil.java
+++ b/src/main/uk/ac/starlink/tfcat/TfcatUtil.java
@@ -1,7 +1,5 @@
package uk.ac.starlink.tfcat;
-import ari.ucidy.UCD;
-import ari.ucidy.UCDParser;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;
@@ -13,11 +11,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.JSONException;
import org.json.JSONObject;
-import uk.me.nxg.unity.OneUnit;
-import uk.me.nxg.unity.Syntax;
-import uk.me.nxg.unity.UnitExpr;
-import uk.me.nxg.unity.UnitParser;
-import uk.me.nxg.unity.UnitParserException;
/**
* Utilities for use with TFCat classes.
@@ -297,19 +290,8 @@ public class TfcatUtil {
* @return new UCD checker
*/
private static WordChecker createUcdChecker() {
- try {
- UCDParser.class.toString();
- }
- catch ( NoClassDefFoundError e ) {
- logger_.warning( "Ucidy library unavailable: no UCD checking" );
- return ucd -> null;
- }
- ucidyLogger_.setLevel( Level.OFF );
- return ucd -> {
- UCD pucd = UCDParser.defaultParser.parse( ucd );
- Iterator<String> errit = pucd.getErrors();
- return errit.hasNext() ? errit.next() : null;
- };
+ logger_.warning( "Ucidy library unavailable: no UCD checking" );
+ return ucd -> null;
}
/**
@@ -318,37 +300,8 @@ public class TfcatUtil {
* @return new unit checker
*/
private static WordChecker createUnitChecker() {
- try {
- UnitParser.class.toString();
- }
- catch ( NoClassDefFoundError e ) {
- logger_.warning( "Unity library unavailable: no unit checking" );
- return unit -> null;
- }
- return unit -> {
- Syntax syntax = Syntax.VOUNITS;
- UnitExpr punit;
- try {
- punit = new UnitParser( syntax, unit ).getParsed();
- }
- catch ( Exception e ) {
- return "bad unit \"" + unit + "\" (" + e.getMessage() + ")";
- }
- if ( punit.isFullyConformant( syntax ) ) {
- return null;
- }
- else {
- for ( OneUnit word : punit ) {
- if ( ! word.isRecognisedUnit( syntax ) ) {
- return "unrecognised unit \"" + word + "\"";
- }
- else if ( ! word.isRecommendedUnit( syntax ) ) {
- return "deprecated unit \"" + word + "\"";
- }
- }
- return "unidentified problem with unit \"" + unit + "\"";
- }
- };
+ logger_.warning( "Unity library unavailable: no unit checking" );
+ return unit -> null;
}
/**
diff --git a/src/main/uk/ac/starlink/tfcat/Validate.java b/src/main/uk/ac/starlink/tfcat/Validate.java
index 5c30a96..7812d95 100644
--- a/src/main/uk/ac/starlink/tfcat/Validate.java
+++ b/src/main/uk/ac/starlink/tfcat/Validate.java
@@ -49,16 +49,13 @@ public class Validate {
? System.in
: new FileInputStream( inFile ) ) {
BasicReporter reporter =
- new BasicReporter( isDebug, TfcatUtil.getUcdChecker(),
- TfcatUtil.getUnitChecker() );
+ new BasicReporter( isDebug );
try {
JSONObject json = new JSONObject( new JSONTokener( IOUtils.toString( in ) ) );
TfcatObject tfcat =
Decoders.TFCAT.decode( reporter, json, null );
if ( tfcat != null ) {
tfcat.purgeJson();
- TfcatUtil.checkBoundingBoxes( reporter, tfcat );
- TfcatUtil.checkCrs( reporter, tfcat );
}
else {
reporter.report( "No TFCat object found at top level" );
|