Files
jaxwsdemo/scripts/simple_test.py
Ken Yasue 0322191af8 Initial commit: JAX-WS Hello World Service
- Complete JAX-WS Hello World implementation
- Docker and Docker Compose support for easy deployment
- Python test scripts for service validation
- Comprehensive README with setup instructions for Windows and Linux
- Maven configuration with JAX-WS dependencies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 09:11:38 +01:00

50 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""
Simple non-interactive test script for JAX-WS Hello World Service
"""
import sys
from test_hello_world import HelloWorldClient
def test_service(name=None):
"""
Simple test function
Args:
name: Optional name to test with. If None, uses "World"
"""
if name is None:
name = "World" if len(sys.argv) < 2 else sys.argv[1]
client = HelloWorldClient()
# Check WSDL
print(f"Checking service availability...")
wsdl_ok, wsdl_msg = client.check_wsdl()
if not wsdl_ok:
print(f"[FAIL] {wsdl_msg}")
sys.exit(1)
print(f"[OK] {wsdl_msg}")
# Call service
print(f"\nCalling service with: '{name}'")
result = client.call_hello_world(name)
print(f"Response: {result}")
# Verify response format
expected_start = f"Hello World, {name}"
if result.startswith(expected_start):
print("\n[PASS] Test PASSED!")
return 0
else:
print(f"\n[FAIL] Test FAILED! Expected response to start with: '{expected_start}'")
return 1
if __name__ == "__main__":
exit_code = test_service()
sys.exit(exit_code)