Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-126

Add support for regexes in the Rendering Test Framework

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.2 M3
    • 3.2 M2
    • None

    Description

      The idea is to add support for the following:

      beginDocument
      beginMacroMarkerStandalone [useravatar] [username=XWiki.UserNotExisting]
      beginGroup [[class]=[xwikirenderingerror]]
      onWord [Failed to execute the [useravatar] macro]
      endGroup [[class]=[xwikirenderingerror]]
      beginGroup [[class]=[xwikirenderingerrordescription hidden]]
      onVerbatim [org.xwiki.rendering.macro.MacroExecutionException: User [XWiki.UserNotExisting] is not registered in this wiki${{{regex:.*}}}] [false]
      endGroup [[class]=[xwikirenderingerrordescription hidden]]
      endMacroMarkerStandalone [useravatar] [username=XWiki.UserNotExisting]
      endDocument
      

      This example will match:

      beginDocument
      beginMacroMarkerStandalone [useravatar] [username=XWiki.UserNotExisting]
      beginGroup [[class]=[xwikirenderingerror]]
      onWord [Failed to execute the [useravatar] macro]
      endGroup [[class]=[xwikirenderingerror]]
      beginGroup [[class]=[xwikirenderingerrordescription hidden]]
      onVerbatim [org.xwiki.rendering.macro.MacroExecutionException: User [XWiki.UserNotExisting] is not registered in this wiki
      	at org.xwiki.rendering.internal.macro.useravatar.UserAvatarMacro.execute(UserAvatarMacro.java:137)
      	at org.xwiki.rendering.internal.macro.useravatar.UserAvatarMacro.execute(UserAvatarMacro.java:56)
      	at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transformOnce(MacroTransformation.java:196)
      	at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:141)
      	at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:81)
      	at org.xwiki.rendering.test.integration.RenderingTest.runTestInternal(RenderingTest.java:133)
      	at org.xwiki.rendering.test.integration.RenderingTest.execute(RenderingTest.java:103)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
      	at org.xwiki.rendering.test.integration.RenderingTestSuite$TestClassRunnerForParameters.runChild(RenderingTestSuite.java:199)
      	at org.xwiki.rendering.test.integration.RenderingTestSuite$TestClassRunnerForParameters.runChild(RenderingTestSuite.java:97)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      	at org.junit.runners.Suite.runChild(Suite.java:128)
      	at org.junit.runners.Suite.runChild(Suite.java:24)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
      ] [false]
      endGroup [[class]=[xwikirenderingerrordescription hidden]]
      endMacroMarkerStandalone [useravatar] [username=XWiki.UserNotExisting]
      endDocument
      

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: