From c37678a3eb62685d32a1581729e2a4e26002bffc Mon Sep 17 00:00:00 2001 From: ToineSiebelink Date: Thu, 20 May 2021 16:44:21 +0100 Subject: Introducing Antlr4 for cpsPath parsing -created new module for cpPathParser -added antlr rule for cpsPathWithSingleLeafCondition -added antlr rule for cpsPathWithDescendant (and with leaf conditions) -added antlr rule for ancestor axis -added unit test (copied from existing CpsPathQuerySpec) -udpated cps-ri to use new cpPathQuery from parser module -'imported' lexer rules from publix xPath grammar -Re-used existing CpsPathException but conversion happens in cps-ri to prevent additional dependency in cps-path-parser module Issue-ID: CPS-376 Change-Id: I2c5df98969402cbf69f6573c52705879450ce606 Signed-off-by: ToineSiebelink --- .../org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'cps-service/src/test') diff --git a/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy index 8592af908..b0bd62905 100755 --- a/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy +++ b/cps-service/src/test/groovy/org/onap/cps/spi/exceptions/CpsExceptionsSpec.groovy @@ -115,8 +115,8 @@ class CpsExceptionsSpec extends Specification { def 'Creating an exception that the schema set being used and cannot be deleted.'() { expect: 'the exception details contains the correct message with dataspace and schema set names' (new SchemaSetInUseException(dataspaceName, schemaSetName)).details - == ("Schema Set with name ${schemaSetName} in dataspace ${dataspaceName} is having " - + "Anchor records associated.") + == ("Schema Set with name ${schemaSetName} in dataspace ${dataspaceName} is having" + + " Anchor records associated.") } def 'Creating a exception that a datanode with a specified xpath does not exist.'() { @@ -157,10 +157,8 @@ class CpsExceptionsSpec extends Specification { def 'Creating a cps path exception.'() { given: 'a cps path exception is created' - def exception = new CpsPathException(providedMessage, providedDetails) - expect: 'the exception has the provided message' - exception.message == providedMessage - and: 'the exception has the provided details' + def exception = new CpsPathException(providedDetails) + expect: 'the exception has the provided details' exception.details == providedDetails } -} \ No newline at end of file +} -- cgit 1.2.3-korg