prmr / Creco

Recommendation System for Consumer Products
Apache License 2.0
6 stars 2 forks source link

Test the Data API #25

Closed prmr closed 10 years ago

prmr commented 10 years ago

Achieve at least line coverage of all the category and product processing in CR data. The tests can be added into TestCRData.

enewe101 commented 10 years ago

I'm having trouble trying to run tests on the master branch. I'm using

right-click in package explorer > Run As > JUnit Test

The problem is that most of the tests are having errors (not failing). Many errors are produced, most of them are BeanCreationException and BeanInstantiationException.

I'll just cover some of the obvious things: I did enable Gradle dependency management and refreshed my dependencies. I also made sure that my .localdatapath is correct, and that I have versions of the .json files having filenames of the form test-.json. In fact, TestDataPath is one of the two only tests that passes for me (the other being TestTypedValue).

Would anyone have any hints based on the kind of exceptions I'm getting?

forgues commented 10 years ago

Could you post a more detailed stack trace of what causes the BeanCreationException?

If there are exceptions in the bean creation, it's almost certainly the CRData constructor that's failing, and this might be because the test files can't be found. Make sure you converted the original .json files into test-.json, and not the json files that were being automatically downloaded at server startup. You should have the file test-category.json, but you shouldn't have test-categories.json.

enewe101 commented 10 years ago

Hey. Thanks for the clues Gabriel. I'm pretty sure that I had the right files, and I had named them as test-.json. But just to be sure I grabbed a fresh copy of data from the original email. Doesn't seem to have changed anything.

I can't attach the stack trace here (they only allow image filetypes) I'll pass it on the class forum. If you do have a spare moment to have a look---I'd be most grateful!

enewe101 commented 10 years ago

Posted under "Technical Stuff"

forgues commented 10 years ago

This is your root exception: java.lang.OutOfMemoryError: Java heap space.

I think you were having this problem before when trying to load all the data in memory. Did you ever try increasing your heap size?

See for example solution 1 here: http://www.mkyong.com/eclipse/eclipse-java-lang-outofmemoryerror-java-heap-space/

enewe101 commented 10 years ago

Ah dang. Sorry you have figured that out! Yup I used that solution, but I hadn't added it to the testing run mode.

Thanks so much!

On Mon, Mar 10, 2014 at 7:45 PM, Gabriel Forgues notifications@github.comwrote:

This is your root exception: java.lang.OutOfMemoryError: Java heap space.

I think you were having this problem before when trying to load all the data in memory. Did you ever try increasing your heap size?

See for example solution 1 here: http://www.mkyong.com/eclipse/eclipse-java-lang-outofmemoryerror-java-heap-space/

Reply to this email directly or view it on GitHubhttps://github.com/prmr/Creco/issues/25#issuecomment-37248624 .

prmr commented 10 years ago

Made obsolete by #44.