Statistics
| Revision:

root / tmp / org.txm.core.tests / src / org / txm / scripts / macro / tests / DeleteTestMacro.groovy @ 1626

History | View | Annotate | Download (609 Bytes)

1 1626 mdecorde
package org.txm.scripts.macro.tests
2 1626 mdecorde
3 1626 mdecorde
import java.io.File
4 1626 mdecorde
import org.kohsuke.args4j.*
5 1626 mdecorde
import groovy.transform.Field
6 1626 mdecorde
import org.txm.rcp.swt.widget.parameters.*
7 1626 mdecorde
import org.txm.Toolbox
8 1626 mdecorde
import org.txm.rcp.commands.tests.*
9 1626 mdecorde
10 1626 mdecorde
@Field @Option(name="name", usage="The test name to delete", widget="String", required=true, def="test1")
11 1626 mdecorde
String name
12 1626 mdecorde
13 1626 mdecorde
// Open the parameters input dialog box
14 1626 mdecorde
if (!ParametersDialog.open(this)) return;
15 1626 mdecorde
16 1626 mdecorde
TestBench bench = GroovyTestBench.getTests();
17 1626 mdecorde
Test test = bench.getTest(name)
18 1626 mdecorde
19 1626 mdecorde
if (test != null) {
20 1626 mdecorde
        bench.deleteTest(test.getName())
21 1626 mdecorde
} else {
22 1626 mdecorde
        println "No test with name=$name to delete."
23 1626 mdecorde
}