i change standard System.in
to pass my test cases cause the code reads input from System.in. In multi-thread environment like servlet changing the standard System.in will give problems. Is there any other way to pass test cases to System.in without using System.setIn()
?
My servlet get's a Java code as string and i compile and load class in-memory for logical testing that java code. so i will pass my test cases to check the output.
That test code read inputs from System.in so i change the System.in into custom ByteArrayInputStream
with my custom input and process the java code.
while processing, if servlet get a concurrent another request (request B) that will use System.in
set by request A so it conflicts with test cases. if any another way to pass my test cases into System.in
??
Thanks in advance