Throwing Complexity Over the Wall: Throwing Complexity Over the Wall: Rapid Development for Enterprise Java Rapid Development for Enterprise Java Dan Allen Dan Allen JBoss, by Red Hat JBoss, by Red Hat mojavelinux mojavelinux Andrew Rubinger Andrew Rubinger JBoss, by Red Hat JBoss, by Red Hat ALRubinger ALRubinger
47
Embed
Throwing complexity over the wall: Rapid development for enterprise Java (JavaOne 2010)
For many, development of enterprise Java has long been an arduous undertaking. We're of the opinion that application programmers should be free to focus on their business logic only.
In this session, we'll cover:
• What makes us most productive? • What tasks should we be programming; more importantly, what shouldn't we? • What is a component model, and what does it buy us? • How is this stuff usable in the real world?
We'll discuss how testing relates to the features of the Java EE 6 stack. By the end, we'll have introduced a pair of simple and powerful frameworks that render the testing of real enterprise components as natural as calling "add" on a CS101 Calculator.java.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Throwing Complexity Over the Wall:Throwing Complexity Over the Wall: Rapid Development for Enterprise JavaRapid Development for Enterprise Java
Dan AllenDan AllenJBoss, by Red HatJBoss, by Red Hat mojavelinuxmojavelinux
Andrew RubingerAndrew RubingerJBoss, by Red HatJBoss, by Red Hat ALRubingerALRubinger
2
Agenda
● Enterprise software development challenges
● Component models as a solution
● Tools that help you develop & test with confidence● ShrinkWrap - Skip the build● Arquillian - Test in-container
● Demo, demo, demo
● Arquillian's interchangeable parts
● Q & A (or more demos)
#arquillian
3
General categorization of software
● Core concerns
● Cross-cutting concerns
● Plumbing
4
What should you code?
● Core concerns● Business logic● Domain-specific
● Why?● Nothing can do this for you● It's what you are paid to do● It's a good investment of time● You get to 100% done sooner
n. a container-oriented testing framework that enablesdevelopers to create portable integration tests for enterpriseapplications; manages the lifecycle of a container and enriches,deploys and runs tests against it
Project lead: Aslak Knutsen
http://jboss.org/arquillian
28
Make integration testing a breeze!
Arquillian project mission
29
Prove it.
@RunWith(Arquillian.class)public class GreeterTestCase {
● Looks like a unit test, but you're in a real environment!● Easily lookup component to test● No hesitation when you need a resource
● Run same test in multiple containers
● It's a learning environment
33
34
Supported unit testing frameworks
JUnit TestNG>= 4.6 >= 5.10
35
Test run modes
● In-container● Test bundled with @Deployment archive● Archive deployed to container● Test runs inside container alongside application code● Invoke application code directly (same JVM)
● As client● @Deployment archive is test archive (unmodified)● Archive deployed to the container● Test stays back, runs in original test runner● Interact as a remote client (e.g., HTTP client)
36
Container modes
● Embedded● Same JVM as test runner● Test protocol either local or remote● Lifecycle controlled by Arquillian
● Remote● Separate JVM from test runner● Arquillian connects to running container● Tests executed over remote protocol