JavaOne – Community Keynote

“Community Keynote”

For more blog posts from JavaOne, see the table of contents


IBM

  • This year, open sourced IBM JDK 9 (OpenJ9)and LIberty Server
  • Demo: microservices, error handling, live code update, Docker
  • Expecting coding in the cloud will become more common
  • More innovation needed: cloud dynamics, containers, hardware
  • Container Kindergarten – play will with others; don’t steal resources/toys from other containers
  • Competition around best JVM
  • Guarded storage – physical hardware that can run GC in parallel by adjusting to memory moves
  • “Server doesn’t even mean the same as it used to”
  • Java EE got reputation for being monolithic. Hasn’t been true in a long time. Now have lighweight runtimes Ex: TomEE, Liberty
  • Even with Kubernetes, need runtime so app can run in portable way
  • Open Liberty – supports Java EE 7, Microprofile, Docker. Uses Eclipse upgrade. Biggest open source contribution IBM ever made. Can get production support as paid upgrade. Designed to be run for microservices and cloud native apps.
  • Microprofie -optimized enterprise capabiities for micro services. Looking at contributing to Java EE or moving under EE4J umbrella.

Oracle

  • Cute skit about this being a rehersal for the Matrix. Callouts to Brazil and the Netherlands. Callout to Star Wars. Callout to Java’s new 6 month release schedule
  • [The lights are green which makes for an interesting reflection on my iPad keyboard]
  • Simulated [I think] tech failures
  • Used underscore variable and changed to double unerscore when didn’t compile
  • Counting: “8, 9 , 18.3, 18.9, whaaat”
  • Follow the white duke (to the JCP party
  • Scene 2: Juggie (a puppet), a bunch of JUG leaders in costumes and two artists
  • The blue J2EE bill taes you back and the red EE4J pill… YOur improvements will be faster now.
  • The agents are spreading fear saying Java EE is dead. The JUG Leaders are the first line of defense
  • Each JUG leader said something about upgrading or a new feature
  • RV carries more and has couch/bathroom. But motorcyce more agile an can go anywhere
  • Scene 3: green screen on motorcycle
  • Scene 4: Went to Japan to learn how to fight agents. Taught spirit of Jigsaw. Used the machine with the 60 Raspberry Pi devices in a circle to check punch. Creates video to see from all angles.
  • Scene 5: Virtual User Group – in 3 weeks, doing 24 hours of vjug. And a bunch of people from the vjug went up
  • Fun references to Java and EE from the matrix in the background as they did dialog
  • Matrix is killing processes as they start up. Deployed 6 instances of programming using Kubernetes to Google, IBM and Oracle clouds. Had visual as killed instances and they came back up. Scaled it 400 and watched the isul grow. Lots of references to the cost. . Google hangout session into VJUG
  • Scene 6: Meet architect of Matrix and our hero defeats the agents.. The agents make up and turn back into dev

My take: I was thinking of not going to the keynote to get some extra sleep and then getting ready for my session. Glad I woke up at 6:30 to get ready and attended to whole keynote. IBM’s was interestng and well put together. And Oracle’s “movie” was awesome! And the more people you recognized, the better it was. Lots of references to various news to such as Angular not having a migration path.

JavaOne – Java Test Automation for REST, Web and Mobile

“Java Test Automation for REST, Web and Mobile”

Speaker: Edson Yanaga & Elias Nogueira

Code had https://github.com/eliasnogueira/javaone-testing-automation

For more blog posts from JavaOne, see the table of contents


Toolbox for testing

  1. Test real REST Service – intermediate validation between back and front end
  2. Test mock REST service – so can guarantee stability during test cycles
  3. Test mobile UI – functional and acceptance tests
  4. Test Web UI – functional and acceptance tests

Test REST web service

  • Just as important as UI
  • Swagger – REST API documentation
  • Use curl or PostMan to manually validate before trying to automate. Postman provides a UI for running REST calls.

Mock REST web service

  • Spark – microframework for Java 8
  • Good discussion of why record/replay shouldn’t be the only tool for testers
  • Spark is a call to get (or the appropriate verb) method taking params for the URL and then a lambda for request/response logic
  • Rest Assured for testing – can integrate with Spark. Fluent API style

Test Web UI

  • Selenium for in browser testing.
  • Nobody in the room is using Selenium IDE. [good that everyone using it is on RC!]
  • Selenium uses a browser specific executable file
  • Workflow – Navigation, Integration (find a web element), Manipulation (click/update text), Synchronization (wait for dynamic elements/async request)
  • Chrome gives a warning that automated software opened the window [that’s awesome! you know it isn’t malicious if you did it and you know which isn’t your interactive session]

Test mobile UI

  • Appium uses same API/DSL as Selenium.
  • Can run Appium test on real device or emulator
  • Workflow – Desired Capabilities (ex: size), Session (start session), Interrogation/Manipulation, Synchronization

Best practices

  • Test against server, not just your machine
  • Use software to change the internet speed
  • Use page objects so test scripts are modular
  • Avoid XPATH
  • For mobile, have scripts for both fresh and pre-installed apps

My take: Good end to the day. It was nice to see a bunch of tools in a short time both on slides and with demos/live coding of each. The presenters were one tester and one developer creating a bunch of jokes back and forth.

 

JavaOne – Building and Testing Java 9 Applications with Gradle

“Building and Testing Java 9 Applications with Gradle”

Speaker: Cédric Champeau
Deck on GitHub

For more blog posts from JavaOne, see the table of contents


General

  • First version of Java that is not backward compatible
  • Did review of Java 9 modules
  • Gradle can run on Java 8 or 9.
  • No built in support for module path
  • Some plugins don’t work – ex: FindBugs. Will be hard to figure out if plugin or Gradle’s fault. Some mocking frameworks will require upgrade as well.
  • Gradle 3.4 introduce a Java library plugin so can separate API and implementations dependencies. Just like modules!

Migrating to Java 9

  • Sample app with 6 modules
  • Uses reflection and service loader code so non trivial
  • implementation (requires) vs api (transitive ok) – paves way for Java 9
  • Replace META-INF/services with “provides” in module-info

Testing

  • want to compile main and tests separately. is that one or two modules? if two modules, prevent from seeing each other.
  • hack the java compiler task to give it the classpath as module path
  • use a patch module so main and test code are one module and the tests can access the package private classes. Also gives JUnit the right to read the classes.
  • so still compile separately but create one module

Automatic modules

  • “How many of you have a jar named util.jar?”
  • Reserve automatic module name now by setting Automatic-Module-Name in the manifest
  • They when upgrade to Java 9, use that name

Multi-Release Jars

  • Said multi-release jars are a bad idea because odds are low the dependencies are the same
  • Old way was to use reflection to determine which version available
  • /src/main/java – shared sources
  • /src/main/java9 – java 9 specific sources
  • Tell gradle which versions of Java to compile each with and differences in dependencies
  • ex: java9Implementation for dependencies – points it to shared sources

Future

  • Working on experimental jigsaw plugin which takes care of various tweaks demoed today. org.gradle.java.experimental-jigsaw

My take: This was interesting. I was a little distracted because I realized I needed to figure out a few presentation things for a larger room. So I was doing a little setup on my computer for tomorrow. It was hard to multi-task though. Cédric’s presentation was good and kept pulling me in :). Also the story teller app was cute. So I wasn’t satisfied in my level of paying attention or my level of getting ready for tomorrow. Oh well. I proved the downsides of “multi-tasking”.