Testing Modular Applications on the NetBeans Platform

kaputmaltwormΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 5 χρόνια και 2 μήνες)

309 εμφανίσεις



Testing Modular Applications
on the NetBeans Platform
Geertjan Wielenga
NetBeans Team
Certified Engineer Course
Agenda

Testing Frameworks

Modules for Testing

Dependencies on Modules for Testing

Typical Test Class

Other Tools

Resources
Certified Engineer Course
Testing Frameworks

Junit >>> NBJunit

Jemmy (https://jemmy.dev.java.net)

Jelly Tools (NetBeans extension to Jemmy)

Xtest >>> Simple Test
Certified Engineer Course
Modules for Testing
Certified Engineer Course
Dependencies on Modules for Testing
Certified Engineer Course
Typical Test Class

public class SampleTest extends JellyTestCase {

public SampleTest(String name) {

super(name);

}

public static Test suite() {

Configuration testConfig = NbModuleSuite.createConfiguration(SampleTest.class);

testConfig.addTest("testSomething");

testConfig.clusters(".*").enableModules(".*");

testConfig.gui(true);

return NbModuleSuite.create(testConfig);

}

public void setUp() {

System.out.println("######## "+getName()+" #######");

}

public void testSomething() {

new Action("File|Some Action", null).perform();

}

}
Certified Engineer Course
Other Tools Relating to Testing

PMD ( PMD scans Java source code for Bugs,
duplications, ... )

FindBugs ( static code analysis )

CheckStyle ( Enforce Coding Standards )

Lint4j ( find Locking & Threading Issues )

SQE (contains all 4) in a NB Plugin (sqe.kenai.org)
Certified Engineer Course
Resources

http://openide.netbeans.org/tutorial/test-patterns.html

http://blogs.sun.com/geertjan/entry/testing_testing_one_two_three

http://wiki.netbeans.org/DevFaqUsingSimpletests

http://wiki.netbeans.org/XTestReplacementCookBook
Certified Engineer Course
Questions & Answers