Skip to content

Commit

Permalink
add more template for setup/teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
missedone committed Jan 30, 2017
1 parent 8a96e3b commit 04cfadd
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
10 changes: 9 additions & 1 deletion testng-eclipse-plugin/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,13 @@ TestNGCommand.shortcut.rerunLast.desc=Rerun the last TestNG Test
TestNGCommand.shortcut.rerunFailed.label=Rerun Failed TestNG Test
TestNGCommand.shortcut.rerunFailed.desc=Rerun the failed TestNG Test

template.testmethod.name=testng
template.testmethod.name=test
template.testmethod.desc=test method (TestNG)
template.setUpClass.name=setup
template.setUpClass.desc=create class level setup stub (TestNG)
template.tearDownClass.name=teardown
template.tearDownClass.desc=create class level teardown stub (TestNG)
template.setUpMethod.name=setup
template.setUpMethod.desc=create method level setup stub (TestNG)
template.tearDownMethod.name=teardown
template.tearDownMethod.desc=create method level teardown stub (TestNG)
52 changes: 52 additions & 0 deletions testng-eclipse-plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,58 @@
@${testType:newType(org.testng.annotations.Test)}
public void ${testName}() throws Exception {
${cursor}
}
</pattern>
</template>
<template
autoinsert="false"
contextTypeId="java-members"
description="%template.setUpClass.desc"
id="org.testng.eclipse.template.setup"
name="%template.setUpClass.name">
<pattern>
@${testType:newType(org.testng.annotations.BeforeClass)}
public void ${setUp}() throws Exception {
${cursor}
}
</pattern>
</template>
<template
autoinsert="false"
contextTypeId="java-members"
description="%template.tearDownClass.desc"
id="org.testng.eclipse.template.teardown"
name="%template.tearDownClass.name">
<pattern>
@${testType:newType(org.testng.annotations.AfterClass)}
public void ${tearDown}() throws Exception {
${cursor}
}
</pattern>
</template>
<template
autoinsert="false"
contextTypeId="java-members"
description="%template.setUpMethod.desc"
id="org.testng.eclipse.template.setupMethod"
name="%template.setUpMethod.name">
<pattern>
@${testType:newType(org.testng.annotations.BeforeMethod)}
public void ${setUpMethod}() throws Exception {
${cursor}
}
</pattern>
</template>
<template
autoinsert="false"
contextTypeId="java-members"
description="%template.tearDownMethod.desc"
id="org.testng.eclipse.template.teardownMethod"
name="%template.tearDownMethod.name">
<pattern>
@${testType:newType(org.testng.annotations.AfterMethod)}
public void ${tearDownMethod}() throws Exception {
${cursor}
}
</pattern>
</template>
Expand Down

0 comments on commit 04cfadd

Please sign in to comment.