Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<p>This page provides <table class="wysiwyg-macro" data-macro-name="excerpt" data-macro-parameters="atlassian-macro-output-type=INLINE" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2V4Y2VycHQ6YXRsYXNzaWFuLW1hY3JvLW91dHB1dC10eXBlPUlOTElORX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>some hints for using the Eclipse TPTP facilities with Groovy</p></td></tr></table>.</p> <p>The Eclipse Testing and Performance Tools Platform (<a href="http://www.eclipse.org/tptp/">TPTP</a>) project addresses the entire test and performance life cycle, from early testing to production application monitoring, including test editing and execution, monitoring, tracing and profiling, and log analysis. It is primarily aimed at the Java-aware tester but can also be used with Groovy.</p> <p>As one example, if you follow the introductory tutorial included in the TPTP documentation called: <a href="http://help.eclipse.org/help31/topic/org.eclipse.hyades.test.doc.user/samples/saccessdp.htm">Creating a datapool driven JUnit test application</a>, you will create a datapool application which lets you invoke data-driven JUnit tests. If you simply replace the Java code with Groovy code you can have data-driven Groovy tests. Here is what your test might look like:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> import org.eclipse.hyades.models.common.datapool.impl.Common_DatapoolFactoryImpl; class Groovy_TPTP extends GroovyTestCase { def dpIterator void setUp() throws Exception { def dpFactory = new Common_DatapoolFactoryImpl() def datapool = dpFactory.load(new java.io.File("GIA_TPTP\\shoppingCartDatapool.datapool"),false) dpIterator = dpFactory.open(datapool,"org.eclipse.hyades.datapool.iterator.DatapoolIteratorSequentialPrivate") dpIterator.dpInitialize(datapool,0) } void testShoppingCartConstructor() { def cart = new MyShoppingCart() while(!dpIterator.dpDone()) { def description = dpIterator.dpCurrent().getCell("Description").stringValue def expectedPrice = dpIterator.dpCurrent().getCell("Price").doubleValue def actualPrice = cart.myFlowers[description] assertNotNull(actualPrice) assertEquals(expectedPrice, actualPrice.doubleValue()) dpIterator.dpNext() } } } </pre></td></tr></table> <p>Here is what your output might look like:</p> <p><img class="confluence-embedded-image" src="/download/attachments/231080081/tptp.jpg?version=1&modificationDate=1369307267876" data-image-src="/download/attachments/231080081/tptp.jpg?version=1&modificationDate=1369307267876" data-linked-resource-id="231375497" data-linked-resource-type="attachment" data-linked-resource-default-alias="tptp.jpg" data-base-url="http://docs.codehaus.org" data-linked-resource-container-id="231080081" title="null > tptp.jpg"></p> <p>In addition to allowing you to write datapool-aware Groovy tests, by making use of GroovyTestSuite and AllTestSuite you can visually select Groovy test cases to run within TPTP using its looping and selection features. This lets non-Groovy aware team members create new test cases from primitives which Groovy-aware team members can create.</p> <p>For more details, see <a href="http://groovy.canoo.com/gina">GINA</a> or the <a href="http://www.eclipse.org/tptp/">TPTP</a> web site.</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced