Launch Context

Q7, 11.07.2013 by Ulyana Skorokhodova View Comments


Sometimes for our testing we need to specificly configure AUT launches. Launch Context can manage it. Launch Context serves the following porposes:
  • Add Launch Configurations and/or run the required ones
  • Add breakpoints and pause a required launch at a breakpoint
  • Terminate existing launches (optional)
  • Clear launch configurations (optional)
  • Clear breakpoints (optional)
Thus you may flexibly adjust your AUT Launch Configuration state to make everything ready for test creation.

 Terminate Existing Launches.

Once you create a new Lauch Context you can see that “Terminate existing launches” option is enabled by default: Launch1 That means the following: when the context is executed all running launches in your AUT will be terminated. You can exclude any desired launches to avoid their termination – just list them in a “Do not terminate…” field: Launch2 When the context above is executed all launches are terminated except “HelloWorld” and “ByeWorld”. If you uncheck “Terminate existing launches” option – no running launches will be terminated during context execution.

Clear Launch Configurations.

This option should be used if you wish to clear a list of existing Launch Configurations (disabled by default): Launch3   By analogy with the termination described above you may want to leave some Run Configurations. Just list them in “Do not delete following configrations” field.

Capture running launches state into a Launch Context.

Let’s say you have 2 Launch Configurations –  HelloWorld and ByeWorld –  and to do your test you need both of them running and suspending at breakpoints. Once you have this state in your AUT you can press “Capture” button and all your AUT launches state will be captured as a context: Launch4 which will have all information about:
  • Existing launch configurations
  • Exising running launches (and their running modes – “run” or “debug”)
  • Existing breakpoins
Now you can use this context in your test case – it will add corresponding configurations, run the required launches in a debug mode and suspend them at their breakpoints. Once you captured launch configurations – you can always edit it manually by removing any of the configuration with “X” button (“Add” button is always disabled for now): Launch5 You may also manually change the attribute values: Launch6

Test Example: verify variable value during a debug process.

Let’s imagine that you need to create a test case which verifies that variables are correctly updated during a debug process. To get this you need to create your Java class file, set a breakpoint, run this class in a debug mode, switch to debug perspective with variables view and (finally!) make a verification. But in fact all actions before a verification – is AUT state and not the test itself.  Using Q7 Contexts you may make your test elegant and easy-maintaining. So you need the following contexts: 1) Workspace context – to put Java Project on AUT workspace: WsContext 2) Workbench context – to switch to Debug Perspective; WbContext 3)  Launch context – to set a breakpoint and run java class in a debug mode. LaunchContext   Place these contexts into your test case: Test   …and record your test which shrinks to a few lines of code: TestScript   You may note “Stop all launches” context marked as a Default context. It terminates all active launches before a workspace context will try to delete all files. This hint helps us to avoid the situation when some files could be locked. It’s a good practice to use this context as a Default Context for AUT with launches.            

blog comments powered by Disqus

Functional and UI Testing for Eclipse-based Applications

Test automation solution, handcrafted for Eclipse. Modern and easy to learn IDE.

Product Health Analytics and Support Automation Platform

End-user and product analytics solution that gives you rich insights into your application health & performance.

Eclipse-based IDE for the Fantom Programming Language

Full-featured Integrated Development Environment for emerging Fantom programming language.