java - Infinitest fails but Maven works -
i have sprint tool suite 3.3 , latest version of infinitest installed. according infinitest, many of classes have errors, yet maven builds fine. here example of errors problems tab in sts show:
invaliddataaccessresourceusageexception (table "addresstyperef" not found; sql statement:...seedaddresstypes.java /... line 34 infinitest test failureassertionfailure (null id in com..model.base.menu entry (don't flush session after exception occurs)) in testmenubuilderit.sortbytopmenu testmenubuilderit.java
all tests show error integration use java config embeddeddatabase:
public class testmenubuilderit extends baseitegration { @autowired private menurepository menurepository; @test public void sortbytopmenu() { list<menu> testmenu = menurepository.findall(); <== offending line ... } and configuration class:
@runwith( springjunit4classrunner.class ) @contextconfiguration( loader = annotationconfigcontextloader.class, classes = { jpaconfig.class } ) public abstract class baseitegration { .. } @configuration @enabletransactionmanagement @componentscan( basepackages = { ...} ) @importresource( { "classpath:applicationcontext.xml"} ) public class jpaconfig { @bean public datasource datasource() { return new embeddeddatabasebuilder().settype( embeddeddatabasetype.h2 ).setname( "testdb" ) .addscript( "classpath:embeddeddatabase.sql" ).build(); } i don't see why work fine in maven, infinitest has these db related errors. not find documentation saying javaconfig wouldn't work infinitest. able right click , run each test "as unit test" successfully.
does know might cause this?
Comments
Post a Comment