java - Debugging at evaluation -
is possible, when evaluating arbitrary expression, in ide evaluation dialog, have execution stopped on breakpoints?
say evaluate myclass.mymethod(), have breakpoint set in, , breakpoint hit.
if it's possible @ all, guess it's jvm matter, not ide. ideas?
assuming you're using spring. you've bought whole martin fowler et al layering pattern.
i'm using intellij , junit, adapt needs.
i have base class @ root of each of intellij modules (layers) test roots:
/** * abstract base class other tests can inherit * spring functionality. */ @runwith(springjunit4classrunner.class) @contextconfiguration(locations={"/spring-config-domain.xml"}) public abstract class springawaretest { }
your tests can extend "context aware".
public class navigationservicetest extends springawaretest { @autowired private navigationservice service; @test public void folders() throws ioexception { list<folder> folders = service.getfolders(testconstants.user_id); assert.assertnotnull("folders null", folders); }
build each of layers (modules) higher level tests, example @ service layer:
@runwith(springjunit4classrunner.class) @contextconfiguration(locations={"/spring-config-service.xml"}) public abstract class springawaretest { }
and import lower level layers in spring config files (which need in app real anyway):
<import resource="spring-config-dal.xml"/> <import resource="spring-config-security.xml"/> ...
now can set break points , step through hearts content; full context.
if want test (or step through) piece of code doesn't require context. test per normal (don't extend springawaretest). faster doesn't need lag of bringing context. starts matter when move continuous integration aka jenkins etc.
Comments
Post a Comment