NetBeans Rich Client Platform Simpletests. Anton Epple Eppleton IT Consulting

Similar documents
Test Patterns in Java

MemoryLint. Petr Nejedlý, Radim Kubacki SUN Microsystems, BOF-9066

mvn package -Dmaven.test.skip=false //builds DSpace and runs tests

Advanced Java Testing. What s next?

Java GUI Testing Tools

Important Points to Note

Testing with Soap UI. Tomaš Maconko

designed to enable you to create a foundation for your own plugin project.

Module Road Map. 7. Version Control with Subversion Introduction Terminology

Achieving Continuous Delivery - Micro Services. - Vikram Gadang

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question)

ULC Test Framework Guide. Canoo RIA-Suite 2014 Update 4

Local MapReduce debugging

IntelliJ IDEA Static Code Analysis Hamlet D'Arcy

CS211 Computers and Programming Matthew Harris and Alexa Sharp July 9, Boggle

ASSIGNMENT 5 Objects, Files, and More Garage Management

CS201 - Assignment 3, Part 1 Due: Friday February 28, at the beginning of class

White box testing. White-box testing. Types of WBT 24/03/15. Advanced Programming

CISC370: Inheritance

print statements, debugger expressions, test scripts. Writing expressions in a debugger only that t a program works now. An application typically

Eclipse on Cell phones?

15CS45 : OBJECT ORIENTED CONCEPTS

PART 1. Eclipse IDE Tutorial. 1. What is Eclipse? Eclipse Java IDE

Continuous Integration & Code Quality MINDS-ON NUNO 11 APRIL 2017

TestingofScout Application. Ludwigsburg,

Unit Test on Windows. Summary. Contents. hudson.util.ioexception2: Failed to clean up temp dirs

In this lab we will practice creating, throwing and handling exceptions.

Modular Applications and the Lookup API. Tim Boudreau Senior Staff Engineer Sun Microsystems

AOR Tutorial. Prerequisites For Using the AOR Utility

Simplifying Development and Testing of GUIs with SAF (JSR 296) and FEST. Michael Hüttermann Training & Consulting Alex Ruiz Oracle Corporation

AOR Tutorial. Prerequisites For Using the AOR Utility

CSCI 200 Lab 3 Using and implementing sets

Thinking Functionally

Object Oriented Software Design - I

Google Wave Client: Powered by GWT. Adam Schuck 28 May, 2009

A Guided Tour of Test Automation

TARGETPROCESS PLUGIN DEVELOPMENT GUIDE

Modular Applications and the Lookup API. David Štrupl Sun Microsystems

CSE 403 Lecture 16. Continuous Integration; Integration Testing. Reading:

JAVA MOCK TEST JAVA MOCK TEST III

1 Shyam sir JAVA Notes

ApplicationComposer. The TomEE Swiss Knife

ASSIGNMENT 5 Objects, Files, and a Music Player

DarkRift Server Plugin Tutorial

Tutorials for Struts, EJB, xdoclet and eclipse.

PASS4TEST IT 인증시험덤프전문사이트

NetBeans IDE Field Guide

wcm.io Context-Aware Configuration

SHIFTLEFT OCULAR THE CODE PROPERTY GRAPH

CSCI Lab 9 Implementing and Using a Binary Search Tree (BST)

Eclipse as a Web 2.0 Application Position Paper

Distributed Systems Project 4 Assigned: Friday March 20 Due: Friday April 3, 11:59pm

Oracle JDeveloper/Oracle ADF 11g Production Project Experience

3 Continuous Integration 3. Automated system finding bugs is better than people

Porting Pleso framework Demo to Netbeans and MySQL

Mobiliser CODE GENERATION - DAO-2-Service

How we reached 0 technical debt in our Eclipse project

Principles of Software Construction: Testing: One, Two, Three

Super Charge Your Continuous Integration Deployments. Nikola Gotsev April 26, 2016

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

This checklist tells you how to create accounts and obtain permissions needed by Hive contributors. See the Hive website for additional information.

JAVA MOCK TEST JAVA MOCK TEST II

Beyond JUnit: Introducing TestNG The Next Generation in Testing

Modeling Network Integrity Release 7.3.1

CSC207 Week 4. Larry Zhang

Getting Started with Web Services

MAVEN MOCK TEST MAVEN MOCK TEST IV

Testing Stragegies. Black Box Testing. Test case

Integration Unit Testing on SAP NetWeaver Application Server

Paradoxes of API Design. Jaroslav Tulach NetBeans Platform Architect

TestPartner. Active Object Recognition (AOR) Training Guide

Minimalist Testing Techniques for Enterprise Java Technologybased

Java Programming Fundamentals

Java Fundamentals (II)

What is Maven? Apache Maven is a software project management and comprehension tool (build, test, packaging, reporting, site, deploy).

Getting Started with Web Services

MEDIA COMPUTATION DRJAVA. Lecture 11.3 November 7, 2008

GUITAR AMP (AutoMatic jfcunit test case Producer)

Good Luck! CSC207, Fall 2012: Quiz 3 Duration 25 minutes Aids allowed: none. Student Number: Lecture Section: L0101. Instructor: Horton

MarkLogic Server. Reference Application Architecture Guide. MarkLogic 9 May, Copyright 2017 MarkLogic Corporation. All rights reserved.

Introduction to JUnit. Data Structures and Algorithms for Language Processing

Full Control and Transparency Advanced Troubleshooting and Testing. Josh West & Andrew Dinn

What is the Selendroid?

StarTeam File Federation 1.0. User Guide

Class definition. complete definition. public public class abstract no instance can be created final class cannot be extended

Unit Testing Activity

Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7

ASSIGNMENT 5 Data Structures, Files, Exceptions, and To-Do Lists

The Art of Unit Testing

PROGRAMMING FUNDAMENTALS

How to Hadoop effortlessly with Waterline Data Inventory

Selected Java Topics

[ANALYSIS ASSIGNMENT 10]

Subroutine to ILE Procedure

Google Cloud. Tomislav Čoh, Calyx d.o.o.

OOP Lab Factory Method, Singleton, and Properties Page 1

National Aeronautics and Space and Administration Space Administration. cfe Release 6.6

Continuous Integration using Cruise Control

CS/B.TECH/CSE(OLD)/SEM-6/CS-605/2012 OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

COE318 Lecture Notes Week 8 (Oct 24, 2011)

Transcription:

Simpletests NetBeans Rich Client Platform Simpletests Anton Epple Eppleton IT Consulting

Unit tests for RCP Applications Introduced in 6.5 Before: Xtest infrastructure Unit & Functional Tests hard to set up for custom RCP projects Modifications: SimpleTest is based on Modules itself => Easy setup

Unit tests for RCP Applications JUnit 4 NetBeans Extensions to Junit (NBJUnit): compare files via assertfile create working directories for testcases write to log files compare log files against reference (golden) files, etc. Jemmy for functional Tests NetBeans Extensions for Jemmy: Jelly

Unit tests for RCP Applications Pattern for Dependency Injection with lookups: abstract class DialogDisplayer { public abstract void notify(string msg); public static DialogDisplayer getdefault() { return Lookup.getDefault().lookup(DialogDisplayer.class); In Test: public class MyTest extends NbTestCase { public MyTest(String name) { super(name); protected void setup() throws Exception { super.setup(); org.netbeans.junit.mockservices.setservices(mockdd.class);

private Lkp(org.openide.util.lookup.InstanceContent ic) { super(ic); ic.add(new DD()); NetBeans Rich Client Platform Setting up more than one service: Unit tests for RCP Applications public class MyTest extends NbTestCase { static { System.setProperty("org.openide.util.Lookup", Lkp.class.getName()); public MyTest(String name) { super(name); public static final class Lkp extends org.openide.util.lookup.abstractlookup { public Lkp() { this(new org.openide.util.lookup.instancecontent());

Unit Test Dependencies Unit Tests can have dependencies on other Modules:

...and their Test Classes (Demo NurEinTest): Unit Test Dependencies

Unit Test Dependencies Considerations for adding Test Mock & Helper classes to modules: API Design: Programming against Interfaces just for testing problematic in terms of API evolution Can't add new methods in Interface without breaking compatibility Alternatively: Testability part of the API Testable binary modules (Platform Chaining)

Unit Test in AWT Thread NBTestCase supports running in AWT Dispatch Thread: public class MyTest extends NbTestCase { @override protected boolean runineq () { return true; More Tips: http://openide.netbeans.org/tutorial/test patterns.html

Functional UI Tests: Jelly NetBeans supports Jemmy for automated ui testing: https://jemmy.dev.java.net/ Independent of test harness Jelly is a set of Extensions to Jemmy specifically to test NB Platform applications Jelly Tests are based on JUnit JellyTestCase extends NBTestCase Setup in project is simple but not straightforward...

Functional UI Tests: Jelly Required Modules: Cluster harness, MultiView Windows + Visual Library from platform9 In Modules test dir: folder qa functional/src IDE restart adds 2 Nodes to Module: Functional Test Packages Functional Test Libraries Required Functional Test Libraries: jemmy, nbjunit, jellytools platform and junit4

Functional UI Tests: Jelly In project.xml (Project Metadata) add the recursive tag to the nbjunit dependency: <test dependency> <code name base>org.netbeans.modules.nbjunit</code name base> <compile dependency/> <recursive/> </test dependency>

Functional Tests: JellyTestCase 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();

Functional Testing Demo

Functional UI Tests Considerations: Possible to run automated UI test with Jemmy Downside: Not easy to write & maintain May cause false alarms (e.g. renamed Menu Items aren't necessarily Bugs) Manual Testing with test scripts

Practical Tips for Testing & CI commit validation Small Test suite runs before every commit (5 minutes) Large test suite runs on CI server Example: http://www.netbeans.org/community/guidelines/commit.html

Functional UI Tests Besides 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)

Links & Resources http://wiki.netbeans.org/devfaqusingsimpletests http://wiki.netbeans.org/fitnesstestswithoutx http://wiki.netbeans.org/xtestreplacementcookbook

Thank you! Q & A