Exercise 07 week 7, test timeout

50 views
Skip to first unread message

Gianni Turatta

unread,
Oct 25, 2016, 5:36:28 PM10/25/16
to mooc.fi
Hi,

I'm having problems with week 7 exercise 07 on course Programming with java part 2.

I'm stuck at 70% and when i run tests locally it takes about 2 minutes to end. The first fail test is:
FAIL: TextUserInterfaceTest startMethod
timeout

Also, it's strange because if i add to the main class this code
String input = "add\n"  + "cheese\n" + "juusto\n" +
                       "add\n"  + "bier\n" + "olut\n" +
                       "add\n"  + "book\n" + "kirja\n" +
                       "add\n"  + "computer\n" + "tietokone\n" +
                       "add\n"  + "auto\n" + "car\n" +
                       "quit\n";

        Scanner reader = new Scanner(input);

and the run the execution the output is

Statement:
  add - adds a word pair to the dictionary
  translate - asks a word and prints its translation
  quit - quits the text user interface

Statement: 

and it wait for my input

The link to my work is here: https://tmc.mooc.fi/mooc/submissions/1606787

Best regards

Gianni Turatta

unread,
Oct 25, 2016, 5:38:54 PM10/25/16
to mooc.fi
I think there is a problem with the scanner

Gianni Turatta

unread,
Oct 26, 2016, 3:13:56 AM10/26/16
to mooc.fi
Yeah it was the scanner i was givin the scanner as parameter in the methods but then i did not use it but instead i create a new one
Now it works
Reply all
Reply to author
Forward
0 new messages