java - JUnit exluding base class from tests in Spring context -


all unit tests have same header spring annotations:

@runwith(springjunit4classrunner.class) @contextconfiguration(locations = { "classpath:spring/spring-master.xml"}) @transactionconfiguration(transactionmanager = "transactionmanager", defaultrollback = false) @transactional() 

i moved them base class , tests extend it:

@runwith(springjunit4classrunner.class) @contextconfiguration(locations = { "classpath:spring/spring-master.xml"}) @transactionconfiguration(transactionmanager = "transactionmanager", defaultrollback = false) @transactional() public class domainobjectbasetest { ... public class sometest extends domainobjectbasetest { 

now when i'm running tests i'm getting domainobjectbasetest:

java.lang.exception: no runnable methods 

my question how can avoid it? can remove @runwith, in case, i'll have apply annotation other tests. many code,don't it.

probably, alternative, can somehow in spring group annotations, name it, , refere group tests, please tell me if possible. in case i'll remove base class @ all.

and there way tell class should not tested. i'm using junit4.

make base class abstract. problem believe not abstract, test runner tries run , fails (imho stupid) reason. ignores abstract classes.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -