Quantcast
Channel: Active questions tagged servlets - Stack Overflow
Viewing all articles
Browse latest Browse all 717

problem with System.in for logical testing java code in servlet

$
0
0

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


Viewing all articles
Browse latest Browse all 717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>