File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 */
1919
2020import org.junit.jupiter.api.Test
21- import org.junit.jupiter.api.condition.DisabledOnOs
22- import org.junit.jupiter.api.condition.OS
2321
2422import static groovy.test.GroovyAssert.assertScript
2523
@@ -412,7 +410,6 @@ final class AsyncAwaitSpecTest {
412410 // === JDK Integration ===
413411
414412 @Test
415- @DisabledOnOs (OS .WINDOWS )
416413 void testJdkIntegration () {
417414 assertScript '''
418415 import com.sun.net.httpserver.HttpServer
@@ -436,11 +433,16 @@ final class AsyncAwaitSpecTest {
436433 server.start()
437434 def bankUrl = "http://127.0.0.1:${server.address.port}"
438435
436+ // setup: portable echo command (Windows has no echo executable — it's a cmd built-in)
437+ def echoCmd = System.getProperty('os.name').toLowerCase().startsWith('windows')
438+ ? ['cmd', '/c', 'echo Hello from Groovy']
439+ : ['echo', 'Hello from Groovy']
440+
439441 try {
440442 // tag::jdk_integration[]
441443 // Task 1: Run a process and await its completion
442444 def proc = async {
443- def p = ' echo Hello from Groovy'.execute()
445+ def p = echoCmd.execute() // echo Hello from Groovy
444446 await p.onExit()
445447 p.text.trim()
446448 }
You can’t perform that action at this time.
0 commit comments