jueves, 21 de noviembre de 2019

JUnit5 Jupiter (3) ConsoleLauncher

JUnit5 Jupiter (3) ConsoleLauncher

D:\proy\labJUnit5>java -cp C:\java\jars\junit\junit-platform-console-standalone-1.5.2.jar
 org.junit.platform.console.ConsoleLauncher @junit5args.txt

Thanks for using JUnit! Support its development at https://junit.org/sponsoring

.
'-- JUnit Jupiter [OK]
  +-- FirstJUnitJupiterTests [OK]
  | '-- addition() [OK]
  +-- AssumptionsTest [OK]
  | +-- testOnlyOnDeveloperWorkstation() [A] Assumption failed: test abortada: no en estaci¾n de desarrollo.
  | +-- testInSpecificEnvironments() [OK]
  | '-- testOnlyOnContinuousIntegrationServer() [S] Test para mÚtodo deshabilitada hasta pasar bug #15
  +-- DisplayNamesTest [OK]
  | +-- ® ººÁ╝¥¢??? [OK]
  | +-- Evaluation @DisplayName [OK]
  | '-- ? [OK]
  +-- ScriptBasedConditionsTest [OK]
  | +-- onlyOnCiServer() [OK]
  | +-- disabledOn32BitArchitectures() [OK]
  | +-- mightNotBeExecuted() [OK]
  | | +-- repetition 1 of 10 [S] Script `Math.random() < 0.314159` evaluated to: true
  | | +-- repetition 2 of 10 [S] Script `Math.random() < 0.314159` evaluated to: true
  | | +-- repetition 3 of 10 [OK]
  | | +-- repetition 4 of 10 [OK]
  | | +-- repetition 5 of 10 [S] Script `Math.random() < 0.314159` evaluated to: true
  | | +-- repetition 6 of 10 [S] Script `Math.random() < 0.314159` evaluated to: true
  | | +-- repetition 7 of 10 [OK]
  | | +-- repetition 8 of 10 [OK]
  | | +-- repetition 9 of 10 [OK]
  | | '-- repetition 10 of 10 [OK]
  | +-- willBeExecuted() [OK]
  | '-- theDayAfterTomorrow() [OK]
  +-- SystemPropertyConditionsTest [OK]
  | +-- notOnCiServer() [OK]
  | '-- onlyOn64BitArchitectures() [OK]
  +-- DisplayNameGeneratorTest [OK]
  | +-- A year is a leap year [OK]
  | | +-- .... [OK]
  | | | +-- A±o 2016 es a±o bisiesto. [OK]
  | | | +-- A±o 2020 es a±o bisiesto. [OK]
  | | | '-- A±o 2048 es a±o bisiesto. [OK]
  | | '-- if it is divisible by 4 but not by 100 [OK]
  | '-- A year is not supported [OK]
  |   +-- if it is zero [OK]
  |   '-- Un valor negativo para el a±o no es soportado por el computo de a±o bisiesto. [OK]
  |     +-- Ejemplo, a±o -1 no es soportado. [OK]
  |     '-- Ejemplo, a±o -4 no es soportado. [OK]
  +-- JavaRunTimeEnvironmentConditionsTest [OK]
  | +-- onJava9Or10() [S] Disabled on JRE version: 1.8.0_112
  | +-- onlyOnJava8() [OK]
  | '-- notOnJava9() [OK]
  +-- OperativeSystemConditionsTest [OK]
  | +-- onlyOnWindowsOs() [OK]
  | +-- notOnWindows() [S] Disabled on operating system: Windows 10
  | +-- testOnMac() [S] Disabled on operating system: Windows 10
  | +-- onlyOnMacOs() [S] Disabled on operating system: Windows 10
  | '-- onLinuxOrMac() [S] Disabled on operating system: Windows 10
  +-- StandardTest [OK]
  | +-- failingTest() [X] una prueba fallida
  | +-- skippedTest() [S] this test is disabled
  | +-- abortedTest() [A] Assumption failed: assumption is not true
  | '-- succedingTest() [OK]
  +-- AssertionsTest [X] Lorg/apache/logging/log4j/Logger;
  '-- EnvironmentVariableConditionTest [OK]
    +-- notOnDeveloperWorkstation() [OK]
    '-- onlyOnStagingServer() [S] Environment variable [ENV] with value [CI] does not match regular expression [staging-server]

Failures (2):
  JUnit Jupiter:StandardTest:failingTest()
    MethodSource [className = 'StandardTest', methodName = 'failingTest', methodParameterTypes = '']
    => org.opentest4j.AssertionFailedError: una prueba fallida
       org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:39)
       org.junit.jupiter.api.Assertions.fail(Assertions.java:109)
       StandardTest.failingTest(StandardTest.java:23)
       sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       java.lang.reflect.Method.invoke(Unknown Source)
       org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:675)
       org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
       org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:125)
       [...]
  JUnit Jupiter:AssertionsTest
    ClassSource [className = 'AssertionsTest', filePosition = null]
    => java.lang.NoClassDefFoundError: Lorg/apache/logging/log4j/Logger;
       java.lang.Class.getDeclaredFields0(Native Method)
       java.lang.Class.privateGetDeclaredFields(Unknown Source)
       java.lang.Class.getDeclaredFields(Unknown Source)
       org.junit.platform.commons.util.ReflectionUtils.getDeclaredFields(ReflectionUtils.java:1334)
       org.junit.platform.commons.util.ReflectionUtils.findAllFieldsInHierarchy(ReflectionUtils.java:1092)
       [...]
     Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.Logger
       java.net.URLClassLoader.findClass(Unknown Source)
       java.lang.ClassLoader.loadClass(Unknown Source)
       java.net.FactoryURLClassLoader.loadClass(Unknown Source)
       java.lang.ClassLoader.loadClass(Unknown Source)
       [...]

Test run finished after 1013 ms
[        17 containers found      ]
[         0 containers skipped    ]
[        17 containers started    ]
[         0 containers aborted    ]
[        16 containers successful ]
[         1 containers failed     ]
[        55 tests found           ]
[        12 tests skipped         ]
[        32 tests started         ]
[         2 tests aborted         ]
[        29 tests successful      ]
[         1 tests failed          ]

Where file junit5args.txt has the other parameters needed by ConsoleLauncher, and specific for our environment.

--include-engine=junit-jupiter
--exclude-engine=junit-vintage
--disable-ansi-colors
--details=tree
--details-theme=ascii
--fail-if-no-tests
--reports-dir=D:/junit5/reports
--class-path=D:\proy\labJUnit5\target\test-classes;D:\proy\labJUnit5\target\classes
--scan-classpath=D:\proy\labJUnit5\target\test-classes

No hay comentarios:

Publicar un comentario