java - console input not working for netbeans ide 7.4 with scanner class -


i have netbeans project test classes junit-4.1 , want read in numbers console using scanner class. system.out.println... works fine but, when input in netbeans console, code execution stops scanner reads in. waiting forever...

here code

private int controllerbytetowhitecell() {       scanner scanner = new scanner(system.in);      system.out.println("please choose 1 of following options 1,2,3,4,5,10,11,12,13,14,15");      string cmd = scanner.nextline();     system.out.println("cmd = " + cmd);  return integer.parseint(cmd); } 

running test/file on test file calls upper code lines, output in netbeans ide 7.4 console

t e s t s ------------------------------------------ running deltaanalytics.ftir.hardware.jueke.controller.juekecommandservicetest getbytesarraytowhitecell  please choose 1 of following options 1,2,3,4,5,10,11,12,13,14,15  11 

after entering number 11 + carriage return, execution of code stops, no otuput next system.out.println appears

if run code outside netbeans ide works! (without use of junit tests). have redirect system.in somehow? how can check ide console waits system.in input?


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -