Skip to content
Permalink
Browse files

updated to junit 5, with commensurate changes to unit tests to avoid …

…inherited tests
  • Loading branch information
IanEmmons committed Jul 31, 2018
1 parent fb5b9c3 commit 163489c7517613432bc078d576c4af4f2f12a904
Showing with 7,799 additions and 8,074 deletions.
  1. +4 −0 .gitattributes
  2. +4 −0 .gitignore
  3. +9 −5 Parliament/KbCore/.cproject
  4. +13 −0 Parliament/KbCore/.settings/org.eclipse.cdt.managedbuilder.core.prefs
  5. +18 −1 Parliament/KbCore/Config.cpp
  6. +5 −4 Parliament/KbCore/JNIHelper.cpp
  7. +2 −0 Parliament/KbCore/parliament/Config.h
  8. +1 −18 Parliament/KbCore/parliament/JNIHelper.h
  9. +1 −1 Parliament/KbCore/parliament/KbInstanceImpl.h
  10. +5 −1 Parliament/ivy.xml
  11. +21 −13 Parliament/javaTest/com/bbn/parliament/jni/JniTest.java
  12. +69 −19 Parliament/javaTest/com/bbn/parliament/queryoptimization/ReificationTest.java
  13. +12 −5 Parliament/javaTest/com/bbn/parliament/queryoptimization/TreeWidthEstimatorTest.java
  14. +12 −5 Parliament/javaTest/com/bbn/parliament/queryoptimization/TreeWidthQueryOptimizerTest.java
  15. +3 −0 build-common.xml
  16. +8 −8 build.xml
  17. +18 −14 jena/JenaGraph/build.xml
  18. +5 −1 jena/JenaGraph/ivy.xml
  19. +47 −89 jena/JenaGraph/src/com/bbn/parliament/jena/graph/KbGraphFactory.java
  20. +3 −3 jena/JenaGraph/src/com/bbn/parliament/jena/graph/KbGraphStore.java
  21. +172 −0 jena/JenaGraph/test/com/bbn/parliament/jena/NodeCreateUtils.java
  22. +67 −0 jena/JenaGraph/test/com/bbn/parliament/jena/TestingDataset.java
  23. +0 −246 jena/JenaGraph/test/com/bbn/parliament/jena/from_jena_test/AbstractTestGraph.java
  24. +0 −434 jena/JenaGraph/test/com/bbn/parliament/jena/from_jena_test/GraphTestBase.java
  25. +0 −220 jena/JenaGraph/test/com/bbn/parliament/jena/from_jena_test/JenaTestBase.java
  26. +0 −175 jena/JenaGraph/test/com/bbn/parliament/jena/from_jena_test/NodeCreateUtils.java
  27. +0 −128 jena/JenaGraph/test/com/bbn/parliament/jena/from_jena_test/RecordingListener.java
  28. +20 −32 jena/JenaGraph/test/com/bbn/parliament/jena/graph/DumpKbAsNTriplesTest.java
  29. +175 −29 jena/JenaGraph/test/com/bbn/parliament/jena/graph/KbGraphTest.java
  30. +39 −74 jena/JenaGraph/test/com/bbn/parliament/jena/graph/union/KbUnionGraphTest.java
  31. +1 −1 ...raph/test/com/bbn/parliament/jena/graph/union/{UnionGraphTest.java → UnionGraphTestNotJUnit.java}
  32. +0 −364 jena/JenaGraph/test/com/bbn/parliament/jena/query/AbstractDAWGTestCase.java
  33. +0 −155 jena/JenaGraph/test/com/bbn/parliament/jena/query/AbstractKbTestCase.java
  34. +110 −0 jena/JenaGraph/test/com/bbn/parliament/jena/query/DAWGManifestEntry.java
  35. +264 −34 jena/JenaGraph/test/com/bbn/parliament/jena/query/KbOpExecutorDAWGTest.java
  36. +39 −17 jena/JenaGraph/test/com/bbn/parliament/jena/query/KbOpExecutorTest.java
  37. +61 −60 jena/JenaGraph/test/com/bbn/parliament/jena/query/QueryTestUtil.java
  38. +34 −15 jena/JenaGraph/test/com/bbn/parliament/jena/query/ReificationTest.java
  39. +35 −22 jena/JenaGraph/test/com/bbn/parliament/jena/query/index/IndexExecutionTest.java
  40. +41 −34 jena/JenaGraph/test/com/bbn/parliament/jena/query/index/IndexTest.java
  41. +125 −120 jena/JenaGraph/test/com/bbn/parliament/jena/query/index/{IndexTestBase.java → IndexTestMethods.java}
  42. +9 −18 ...om/bbn/parliament/jena/query/index/{QueryableIndexTestBase.java → QueryableIndexTestMethods.java}
  43. +152 −180 jena/JenaGraph/test/com/bbn/parliament/jena/query/index/mock/MockIndex.java
  44. +13 −17 jena/JenaGraph/test/com/bbn/parliament/jena/query/index/mock/MockIndexFactory.java
  45. +4 −6 jena/JenaGraph/test/com/bbn/parliament/jena/query/index/mock/MockIndexedObject.java
  46. +75 −85 jena/JenaGraph/test/com/bbn/parliament/jena/query/index/mock/MockPatternQuerier.java
  47. +12 −14 jena/JenaGraph/test/com/bbn/parliament/jena/query/index/mock/MockRecordFactory.java
  48. +1 −0 jena/JenaGraph/test/com/bbn/parliament/jena/query/index/mock/mockdata.ttl
  49. +0 −86 jena/JenaGraph/test/com/bbn/parliament/jena/query/optimize/AbstractTransformTestCase.java
  50. +0 −12 jena/JenaGraph/test/com/bbn/parliament/jena/query/optimize/DefaultTransformationTestCase.java
  51. +0 −12 jena/JenaGraph/test/com/bbn/parliament/jena/query/optimize/DynamicTransformationTestCase.java
  52. +23 −14 ...aph/test/com/bbn/parliament/jena/query/optimize/{KbOptimizerTestCase.java → KbOptimizerTest.java}
  53. +110 −0 jena/JenaGraph/test/com/bbn/parliament/jena/query/optimize/TransformationTest.java
  54. +5 −1 jena/JosekiExtensions/ivy.xml
  55. +2 −4 jena/JosekiExtensions/src/com/bbn/parliament/jena/joseki/bridge/ParliamentBridgeConfiguration.java
  56. +17 −0 jena/JosekiExtensions/src/com/bbn/parliament/jena/joseki/bridge/servlet/ParliamentServlet.java
  57. +30 −40 jena/JosekiExtensions/test/com/bbn/parliament/jena/joseki/bridge/ParliamentServerTestCase.java
  58. +12 −22 ...est/com/bbn/parliament/jena/joseki/bridge/{ParliamentServerBase.java → ParliamentTestServer.java}
  59. +13 −15 jena/JosekiExtensions/test/com/bbn/parliament/jena/joseki/bridge/tracker/Suspend.java
  60. +22 −25 jena/JosekiExtensions/test/com/bbn/parliament/jena/joseki/bridge/tracker/TrackerTestCase.java
  61. +13 −16 jena/JosekiExtensions/test/com/bbn/parliament/jena/joseki/josekibridge/ParliamentServerTestCase.java
  62. +7 −3 jena/JosekiParliamentClient/ivy.xml
  63. +52 −0 jena/JosekiParliamentClient/src/com/bbn/parliament/jena/joseki/client/CloseableQueryExec.java
  64. +0 −5 jena/JosekiParliamentClient/src/com/bbn/parliament/jena/joseki/client/HttpClientUtil.java
  65. +40 −0 jena/JosekiParliamentClient/src/com/bbn/parliament/jena/joseki/client/StreamUtil.java
  66. +11 −8 jena/JosekiParliamentClient/test/com/bbn/parliament/jena/joseki/client/RDFFormatTest.java
  67. +5 −1 jena/NumericIndex/ivy.xml
  68. +96 −288 jena/NumericIndex/test/com/bbn/parliament/jena/graph/index/numeric/NumericIndexTest.java
  69. +252 −0 jena/NumericIndex/test/com/bbn/parliament/jena/graph/index/numeric/NumericIndexTestMethods.java
  70. +82 −94 ...icIndex/test/com/bbn/parliament/jena/graph/index/numeric/composite/CompositeNumericIndexTest.java
  71. +103 −0 .../test/com/bbn/parliament/jena/graph/index/numeric/composite/CompositeNumericIndexTestMethods.java
  72. +5 −1 jena/SpatialIndexProcessor/ivy.xml
  73. +21 −28 jena/SpatialIndexProcessor/src/com/bbn/parliament/jena/graph/index/spatial/Constants.java
  74. +0 −13 jena/SpatialIndexProcessor/src/com/bbn/parliament/jena/graph/index/spatial/geosparql/Constants.java
  75. +16 −25 ...ocessor/src/com/bbn/parliament/jena/graph/index/spatial/geosparql/datatypes/GeoSPARQLLiteral.java
  76. +56 −63 ...rc/com/bbn/parliament/jena/graph/index/spatial/geosparql/function/util/LiteralToGeometryType.java
  77. +9 −13 ...c/com/bbn/parliament/jena/graph/index/spatial/sql/postgres/PostgreSQLPropertyFunctionFactory.java
  78. +0 −92 jena/SpatialIndexProcessor/src/com/bbn/parliament/jena/graph/index/spatial/standard/Constants.java
  79. +217 −223 ...dexProcessor/src/com/bbn/parliament/jena/graph/index/spatial/standard/SpatialGeometryFactory.java
  80. +34 −41 ...ndexProcessor/src/com/bbn/parliament/jena/graph/index/spatial/standard/SpatialOperandFactory.java
  81. +33 −33 ...xProcessor/src/com/bbn/parliament/jena/graph/index/spatial/standard/StandardOperationFactory.java
  82. +7 −7 ...atialIndexProcessor/src/com/bbn/parliament/jena/graph/index/spatial/standard/StandardProfile.java
  83. +141 −153 ...ndexProcessor/src/com/bbn/parliament/jena/graph/index/spatial/standard/StandardRecordFactory.java
  84. +87 −0 .../SpatialIndexProcessor/src/com/bbn/parliament/jena/graph/index/spatial/standard/StdConstants.java
  85. +189 −207 ...ndexProcessor/src/com/bbn/parliament/jena/graph/index/spatial/standard/data/BufferedGeometry.java
  86. +0 −252 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/AbstractBuffersTest.java
  87. +0 −469 ...lIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/AbstractFloatingExtentsTest.java
  88. +0 −385 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/AbstractQueryTest.java
  89. +0 −244 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/AbstractSpatialTest.java
  90. +0 −223 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/AbstractThreadTest.java
  91. +235 −0 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/BuffersTestMethods.java
  92. +492 −0 ...alIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/FloatingExtentsTestMethods.java
  93. +409 −0 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/QueryTestMethods.java
  94. +25 −46 ...m/bbn/parliament/jena/graph/index/spatial/{AbstractIndexTest.java → SpatialIndexTestMethods.java}
  95. +214 −0 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/SpatialTestDataset.java
  96. +210 −0 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/ThreadTestMethods.java
  97. +38 −43 ...atialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/geosparql/DataGenerator.java
  98. +0 −199 ...IndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/geosparql/GeoSPARQLGraphTest.java
  99. +78 −26 ...atialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/geosparql/GeoSPARQLTest.java
  100. +28 −27 ...rocessor/test/com/bbn/parliament/jena/graph/index/spatial/geosparql/datatypes/GMLLiteralTest.java
  101. +5 −9 ...ocessor/test/com/bbn/parliament/jena/graph/index/spatial/geosparql/datatypes/LiteralTestCase.java
  102. +29 −26 ...rocessor/test/com/bbn/parliament/jena/graph/index/spatial/geosparql/datatypes/WKTLiteralTest.java
  103. +74 −17 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/jts/JTSBuffersTest.java
  104. +93 −7 ...alIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/jts/JTSFloatingExtentsTest.java
  105. +111 −14 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/jts/JTSIndexTest.java
  106. +16 −0 ...atialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/jts/JTSIndexTestMethods.java
  107. +5 −6 ...patialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/jts/JTSPropertyFactory.java
  108. +124 −17 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/jts/JTSQueryTest.java
  109. +51 −17 jena/SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/jts/JTSThreadTest.java
  110. +6 −4 ...SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/operands/OperandsTest.java
  111. +74 −17 ...patialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/rtree/RTreeBuffersTest.java
  112. +93 −7 ...dexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/rtree/RTreeFloatingExtentsTest.java
  113. +111 −14 .../SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/rtree/RTreeIndexTest.java
  114. +16 −0 ...lIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/rtree/RTreeIndexTestMethods.java
  115. +5 −6 ...alIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/rtree/RTreePropertyFactory.java
  116. +124 −17 .../SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/rtree/RTreeQueryTest.java
  117. +48 −17 ...SpatialIndexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/rtree/RTreeThreadTest.java
  118. +0 −13 ...Processor/test/com/bbn/parliament/jena/graph/index/spatial/sql/postgres/AbstractPostgresTest.java
  119. +0 −1,108 ...cessor/test/com/bbn/parliament/jena/graph/index/spatial/sql/postgres/EstimateSelectivityTest.java
  120. +75 −19 ...xProcessor/test/com/bbn/parliament/jena/graph/index/spatial/sql/postgres/PostgresBuffersTest.java
  121. +93 −9 ...or/test/com/bbn/parliament/jena/graph/index/spatial/sql/postgres/PostgresFloatingExtentsTest.java
  122. +106 −51 ...dexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/sql/postgres/PostgresIndexTest.java
  123. +54 −0 ...essor/test/com/bbn/parliament/jena/graph/index/spatial/sql/postgres/PostgresIndexTestMethods.java
  124. +9 −10 ...cessor/test/com/bbn/parliament/jena/graph/index/spatial/sql/postgres/PostgresPropertyFactory.java
  125. +124 −19 ...dexProcessor/test/com/bbn/parliament/jena/graph/index/spatial/sql/postgres/PostgresQueryTest.java
  126. +52 −14 ...exProcessor/test/com/bbn/parliament/jena/graph/index/spatial/sql/postgres/PostgresThreadTest.java
  127. +1 −0 jena/TemporalIndexProcessor/.classpath
  128. +4 −2 jena/TemporalIndexProcessor/build.xml
  129. +5 −1 jena/TemporalIndexProcessor/ivy.xml
  130. +20 −20 ...lIndexProcessor/src/com/bbn/parliament/jena/graph/index/temporal/bdb/PersistentTemporalIndex.java
  131. +0 −109 ...alIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/AbstractTemporalTestClass.java
  132. +5 −12 jena/TemporalIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/MockTemporalIndex.java
  133. +56 −39 ...lIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/TemporalIndexProcessorTest.java
  134. +102 −0 jena/TemporalIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/TemporalIndexTest.java
  135. +45 −0 ...ralIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/TemporalIndexTestMethods.java
  136. +109 −0 .../TemporalIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/TemporalTestServer.java
  137. +9 −6 ...essor/test/com/bbn/parliament/jena/graph/index/temporal/intervals/IntervalRepresentationTest.java
  138. +14 −12 ...exProcessor/test/com/bbn/parliament/jena/graph/index/temporal/intervals/IntervalValidityTest.java
  139. +38 −15 .../TemporalIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/AfterTest.java
  140. +22 −25 ...dexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/BaseOperandTestClass.java
  141. +38 −14 ...TemporalIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/BeforeTest.java
  142. +27 −13 ...alIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/HasBeginningTest.java
  143. +31 −12 ...TemporalIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/HasEndTest.java
  144. +30 −9 ...TemporalIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/InsideTest.java
  145. +30 −8 ...lIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/InstantEqualsTest.java
  146. +31 −8 ...lIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalAfterTest.java
  147. +31 −8 ...IndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalBeforeTest.java
  148. +36 −12 ...dexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalContainsTest.java
  149. +35 −13 ...IndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalDuringTest.java
  150. +36 −12 ...IndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalEqualsTest.java
  151. +34 −10 ...xProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalFinishedByTest.java
  152. +33 −10 ...dexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalFinishesTest.java
  153. +34 −10 ...lIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalMeetsTest.java
  154. +34 −12 ...lIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalMetByTest.java
  155. +36 −14 ...rocessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalOverlappedByTest.java
  156. +35 −12 ...dexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalOverlapsTest.java
  157. +34 −13 ...exProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalStartedByTest.java
  158. +34 −14 ...IndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/operands/IntervalStartsTest.java
  159. +43 −19 ...lIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/query/DuplicateEntriesTest.java
  160. +73 −41 ...oralIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/query/QueryEdgeCaseTest.java
  161. +2 −1 ...poralIndexProcessor/test/com/bbn/parliament/jena/graph/index/temporal/query/TestIndexFactory.java
  162. +6 −4 log4j.junit.properties
@@ -5,10 +5,14 @@
*.bat text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.doc binary
*.docx binary
*.jpg binary
*.jpeg binary
*.pdf binary
*.png binary
*.ppt binary
*.pptx binary
*.xls binary
*.xlsx binary
*.zip binary
@@ -2,13 +2,17 @@ bin/
lib/
log/

/build.properties
/dependencies/
/doc/UserGuide/acronyms.tex
/doc/UserGuide/references.bib
/jena/JosekiExtensions/src/com/bbn/parliament/jena/joseki/bridge/configuration/vocab/
/Parliament/AdminClient/.settings/language.settings.xml
/Parliament/AdminClient/Debug_with_MacOSX GCC/
/Parliament/KbCore/.settings/language.settings.xml
/Parliament/KbCore/Debug_with_MacOSX GCC/
/Parliament/KbCore/parliament/generated/
/Parliament/Test/.settings/language.settings.xml
/Parliament/Test/Debug_with_MacOSX GCC/
/Parliament/Test/ParliamentConfig.txt
/target/
@@ -31,11 +31,12 @@
<option id="gnu.cpp.compiler.option.include.paths.1984221352" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${env_var:BOOST_ROOT}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include/darwin&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include/win32&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:BDB_HOME}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/KbCore}&quot;"/>
</option>
<option id="gnu.cpp.compiler.option.dialect.std.381369236" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.dialect.std.381369236" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1085406704" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.so.debug.1018997986" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.so.debug">
@@ -94,11 +95,12 @@
<option id="gnu.cpp.compiler.option.include.paths.586469638" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${env_var:BOOST_ROOT}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include/darwin&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include/win32&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:BDB_HOME}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/KbCore}&quot;"/>
</option>
<option id="gnu.cpp.compiler.option.dialect.std.1943560140" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.dialect.std.1943560140" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1584831094" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.so.release.1178839962" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.so.release">
@@ -143,7 +145,7 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="dylib" artifactName="KbCore" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.macosx.so.debug.16651820" name="Debug_with_MacOSX GCC" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=" parent="cdt.managedbuild.config.macosx.so.debug">
<configuration artifactExtension="dylib" artifactName="KbCore" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.macosx.so.debug.16651820" name="Debug_with_MacOSX GCC" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="cdt.managedbuild.config.macosx.so.debug">
<folderInfo id="cdt.managedbuild.config.macosx.so.debug.16651820." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.macosx.so.debug.287026338" name="MacOSX GCC" nonInternalBuilderId="cdt.managedbuild.target.gnu.builder.macosx.so.debug" superClass="cdt.managedbuild.toolchain.gnu.macosx.so.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.macosx.so.debug.2004167267" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.macosx.so.debug"/>
@@ -170,11 +172,12 @@
<option id="gnu.cpp.compiler.option.include.paths.199426699" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${env_var:BOOST_ROOT}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include/darwin&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include/win32&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:BDB_HOME}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/KbCore}&quot;"/>
</option>
<option id="gnu.cpp.compiler.option.dialect.std.928054476" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.dialect.std.928054476" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2065061947" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.macosx.so.debug.474079925" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.macosx.so.debug">
@@ -235,11 +238,12 @@
<option id="gnu.cpp.compiler.option.include.paths.1232408036" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${env_var:BOOST_ROOT}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include/darwin&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:JAVA_HOME}/include/win32&quot;"/>
<listOptionValue builtIn="false" value="&quot;${env_var:BDB_HOME}/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/KbCore}&quot;"/>
</option>
<option id="gnu.cpp.compiler.option.dialect.std.36262296" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.dialect.std.36262296" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.c++1y" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1406874206" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.macosx.so.release.618083876" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.macosx.so.release">
@@ -0,0 +1,13 @@
eclipse.preferences.version=1
environment/buildEnvironmentInclude/cdt.managedbuild.config.macosx.so.debug.16651820/CPATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.macosx.so.debug.16651820/CPATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.macosx.so.debug.16651820/CPLUS_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.macosx.so.debug.16651820/CPLUS_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.macosx.so.debug.16651820/C_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.macosx.so.debug.16651820/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.macosx.so.debug.16651820/append=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.macosx.so.debug.16651820/appendContributed=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.macosx.so.debug.16651820/LIBRARY_PATH/delimiter=\:
environment/buildEnvironmentLibrary/cdt.managedbuild.config.macosx.so.debug.16651820/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/cdt.managedbuild.config.macosx.so.debug.16651820/append=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.macosx.so.debug.16651820/appendContributed=true
@@ -42,7 +42,7 @@ static const char*const k_trueBoolValues[] = { "true", "t", "yes", "y", "on", "1
static const char*const k_falseBoolValues[] = { "false", "f", "no", "n", "off", "0" };
const pmnt::TChar pmnt::Config::k_defaultConfigFileName[] = _T("ParliamentConfig.txt");

static auto g_log(pmnt::Log::getSource("Config"));
static auto g_log = pmnt::Log::getSource("Config");



@@ -556,3 +556,20 @@ void pmnt::Config::disableAllRules()
m_inferRdfsResource = false;
m_inferOwlThing = false;
}

const pmnt::Config& pmnt::Config::ensureKbDirExists() const
{
if (!exists(m_kbDirectoryPath))
{
create_directory(m_kbDirectoryPath);
PMNT_LOG(g_log, LogLevel::info) << "XYZZY Created KB directory '"
<< pathAsUtf8(m_kbDirectoryPath) << "'.";
}
else if (!is_directory(m_kbDirectoryPath))
{
throw Exception(format(
"Configuration entry kbDirectoryPath is not a directory: '%1%'")
% m_kbDirectoryPath.generic_string());
}
return *this;
}
@@ -12,6 +12,7 @@
namespace pmnt = ::bbn::parliament;

using ::std::basic_string;
using ::std::exception;
using ::std::ostringstream;
using ::std::size_t;
using ::std::string;
@@ -168,12 +169,12 @@ void pmnt::JNIHelper::setStaticShortFld(JNIEnv* pEnv, jclass cls,
pEnv->SetStaticShortField(cls, fid, value);
}

void pmnt::JNIHelper::throwException(JNIEnv* pEnv, const char* pExType,
const char* pMsg, const char* pSrcFile, uint32 srcLineNum)
void pmnt::JNIHelper::throwException(JNIEnv* pEnv, const exception& ex,
const char* pSrcFile, uint32 srcLineNum)
{
ostringstream s;
s << pExType << " thrown from " << pSrcFile << " at line "
<< srcLineNum << ": " << pMsg;
s << typeid(ex).name() << " thrown from " << pSrcFile << " at line "
<< srcLineNum << ": " << ex.what();
throwJavaException(pEnv, "com/bbn/parliament/jni/NativeCodeException",
s.str().c_str());
}
@@ -305,6 +305,8 @@ class Config

void disableAllRules();

const Config& ensureKbDirExists() const;

#if defined(PARLIAMENT_UNIT_TEST)
static ::boost::filesystem::path testGetConfigFilePath()
{ return getConfigFilePath(); }
@@ -201,18 +201,8 @@ class JNIHelper
static void setStaticShortFld(JNIEnv* pEnv, jclass cls,
const char* pFldName, int16 value);

static void throwException(JNIEnv* pEnv, const Exception& ex,
const char* pSrcFile, uint32 srcLineNum)
{
throwException(pEnv, "::bbn::parliament::Exception", ex.what(),
pSrcFile, srcLineNum);
}
static void throwException(JNIEnv* pEnv, const ::std::exception& ex,
const char* pSrcFile, uint32 srcLineNum)
{
throwException(pEnv, "::std::exception", ex.what(),
pSrcFile, srcLineNum);
}
const char* pSrcFile, uint32 srcLineNum);
static void throwJavaException(JNIEnv* pEnv, const char* pClassName, const char* pMsg);

static jobject newObject(JNIEnv* pEnv, jclass cls, const char* pCtorSignature, ...);
@@ -223,9 +213,6 @@ class JNIHelper
// This method is defined via template specialization below:
template<typename t_char>
static jstring newString(JNIEnv* pEnv, const t_char* pStr);

static void throwException(JNIEnv* pEnv, const char* pExType,
const char* pMsg, const char* pSrcFile, uint32 srcLineNum);
};

template<>
@@ -314,10 +301,6 @@ PARLIAMENT_NAMESPACE_END

#define END_JNI_EXCEPTION_HANDLER(pEnv) \
} \
catch (const ::bbn::parliament::Exception& ex) \
{ \
JNIHelper::throwException(pEnv, ex, __FILE__, __LINE__); \
} \
catch (const ::std::exception& ex) \
{ \
JNIHelper::throwException(pEnv, ex, __FILE__, __LINE__); \
@@ -49,7 +49,7 @@ struct KbInstance::Impl
using StmtTable = FixRecordTable<KbStmt>;

Impl(const Config& config, KbInstance* pKB) :
m_config(config),
m_config(config.ensureKbDirExists()),
m_dontNeedToRunAddNewRules(),
m_isLogEngineInitialized(Log::init(m_config)),
m_log(Log::getSource("KbInstance")),
@@ -29,7 +29,11 @@
url="https://repo1.maven.org/maven2/commons-daemon/commons-daemon/1.1.0/commons-daemon-1.1.0-src.tar.gz"/>
</dependency>

<dependency org="junit" name="junit" rev="4.12" conf="test->default"/>
<!-- dependency org="junit" name="junit" rev="4.12" conf="test->default"/ -->
<dependency org="org.junit.jupiter" name="junit-jupiter-api" rev="5.1.0" conf="test->default"/>
<dependency org="org.junit.jupiter" name="junit-jupiter-params" rev="5.1.0" conf="test->default"/>
<dependency org="org.junit.jupiter" name="junit-jupiter-engine" rev="5.1.0" conf="test->default"/>
<dependency org="org.junit.platform" name="junit-platform-runner" rev="1.1.0" conf="test->default"/>

<exclude org="commons-logging"/>
<override org="org.apache.httpcomponents" module="httpclient-cache"
@@ -6,15 +6,21 @@

package com.bbn.parliament.jni;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.Set;
import java.util.TreeSet;

import junit.framework.TestCase;
import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;

import com.bbn.parliament.jni.StmtIterator.Statement;

/** @author iemmons */
public class JniTest extends TestCase {
@RunWith(JUnitPlatform.class)
public class JniTest {
private static final String UNICODE_LABEL = "\"\u0056\u004d\u0057\u0430\u0058\u4e8c\u0059\ud800\udf02\u005a\"";

private static final String RDFS_SUB_CLASS = "http://www.w3.org/2000/01/rdf-schema#subClassOf";
@@ -30,6 +36,7 @@
private static final String PUFF_URI = "http://example.org/#Puff";

@SuppressWarnings("static-method")
@Test
public void testUnicodeTransfer() {
Config cfg = buildConfig(false);

@@ -41,16 +48,17 @@ public void testUnicodeTransfer() {
long unicodeLabelRsrcId = kb.uriToRsrcId(UNICODE_LABEL, true, true);
assertEquals(1, kb.rsrcCount());
String unicodeLabel = kb.rsrcIdToUri(unicodeLabelRsrcId);
assertEquals("Unicode string literal", UNICODE_LABEL, unicodeLabel);
assertEquals(UNICODE_LABEL, unicodeLabel, "Unicode string literal");
} catch (Throwable ex) {
ex.printStackTrace();
assertTrue(ex.getMessage(), false);
assertTrue(false, ex.getMessage());
} finally {
KbInstance.deleteKb(cfg, null);
}
}

@SuppressWarnings("static-method")
@Test
public void testByQuickOverview() {
Config cfg = buildConfig(true);

@@ -82,8 +90,8 @@ public void testByQuickOverview() {

// Check that resources are inserted only once:
long rdfTypeRsrcId2 = kb.uriToRsrcId(RDF_TYPE, false, true);
assertEquals(String.format("rdf:type double inserted (rsrc ids %1$d and %2$d)",
rdfTypeRsrcId, rdfTypeRsrcId2), rdfTypeRsrcId, rdfTypeRsrcId2);
assertEquals(rdfTypeRsrcId, rdfTypeRsrcId2, String.format(
"rdf:type double inserted (rsrc ids %1$d and %2$d)", rdfTypeRsrcId, rdfTypeRsrcId2));

// Should be inferred:
// Human subClassOf Animal
@@ -100,10 +108,10 @@ public void testByQuickOverview() {

// Check statement counts:
KbInstance.CountStmtsResult counts = kb.countStmts();
assertEquals("# total statements", 19, counts.getTotal());
assertEquals("# deleted statements", 0, counts.getNumDel());
assertEquals("# inferred statements", 11, counts.getNumInferred());
assertEquals("# del & inf statements", 0, counts.getNumDelAndInferred());
assertEquals(19, counts.getTotal(), "# total statements");
assertEquals(0, counts.getNumDel(), "# deleted statements");
assertEquals(11, counts.getNumInferred(), "# inferred statements");
assertEquals(0, counts.getNumDelAndInferred(), "# del & inf statements");

// Check that we can find instances of human:
try (StmtIterator it = kb.find(KbInstance.NULL_RSRC_ID, rdfTypeRsrcId,
@@ -121,7 +129,7 @@ public void testByQuickOverview() {
System.out.format("Human query result: %1$s%n",
kb.rsrcIdToUri(result.getSubject()));
}
assertEquals("Human query results", expectedResults, results);
assertEquals(expectedResults, results, "Human query results");
}

// Check that we can find instances of animal (inferred):
@@ -142,11 +150,11 @@ public void testByQuickOverview() {
System.out.format("Animal query result: %1$s%n",
kb.rsrcIdToUri(result.getSubject()));
}
assertEquals("Animal query results", expectedResults, results);
assertEquals(expectedResults, results, "Animal query results");
}
} catch (Throwable ex) {
ex.printStackTrace();
assertTrue(ex.getMessage(), false);
assertTrue(false, ex.getMessage());
} finally {
KbInstance.deleteKb(cfg, null);
}

0 comments on commit 163489c

Please sign in to comment.
You can’t perform that action at this time.