-1

I am testing html error codes for some RESTful and server side event services. We currently only have MOCK services, when I kill the services, or start/stop the service I am supposed to get the associated HTML error codes on the browser. The way I am thinking of testing this is using our existing test framework JAVA/testNG/Selenium Grid2/ + other stuff to programmatically kill and start these MOCK services and then do the necessary asserts to make sure all is well. We currently have shell scripts for these functions but not sure how to implement via Java code or hook into .sh script...

.sh script:

'#!/bin/bash
set -x

cd /mock_services/push
pkill -f mockserver || true'
tebel
  • 23
  • 1
  • 8

1 Answers1

0

You can execute shell commands through the use of a ProcessBuilder.

Have a look at

Community
  • 1
  • 1
MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
  • Depends on what you searched for, I just looked for `[java] shell command` and ran down the list - but this is the second time I've answered a question like this today ;) – MadProgrammer Aug 10 '12 at 00:53
  • yeah I guess I am a nub at this site... Can not post anymore either, lame. – tebel Aug 10 '12 at 03:27