app dev maven

Random EAR Projects

I had a similar experience and ran across .

m2e-wtp can also be disabled via the m2e.wtp.activation>false in the Maven section of your project pom;xml.

I create a new workspace and cloned a fresh copy of my code in a temp directory. I then updated the parent pom.xml with the following:


I then imported Existing Maven Projects and no extra EAR projects.

The  JAX-RS, JPA and JSF configurators can be enabled or disabled at a workspace level from Window > Preferences > Maven > Java EE Integration.

app dev

Behavior Driven Development using Cucumber and Test NG

I have started playing with Test NG and Behavior Driven Development using Cucumber. Here are my notes from playing with Cucumber and Test NG.

In Eclipse, Click Help > Eclipse Marketplace

Enter into the Find Box – Cucumber

Click Go

You should see Eclipse plugin.

Click Install

When presented with the Review License dialog, click I Accept

Click Finish

Click Install anyway

Note, I personally clicked details and found they are the Eclipse Cucumber features

/Applications/ /Applications/



You can always click on the job to see the status.  In the lower right, you are going to see the install progress

Click Restart Now

Be sure to save your work.

Once Eclipse has restarted, click Create > Maven Project

Click Create a simple project

Click Next

Click Advanced

Enter Group Id – cucumber

Enter Artifact Id – test

Enter Version – 99-SNAPSHOT

Click Finish

Right Click the Project – test

Select Configure -> Convert to Cucumber Project

Open the pom.xml and add a dependency for Cucumber and Test NG




























While in the pom.xml, make sure the version of the project is Java 1.8.





Click File > Save

Right Click New > Class

Enter Name – RunCucumberTest

Click Browse

Find AbstractTestNGCucumberTests

Click OK

Click OK

Annotate the class with

@CucumberOptions(plugin = "pretty", features = "src/test/resources/TestMe.feature")

It’s a good reminder of where you can go to modify Cucumber.

Right Click the Project > New > Other

Select Cucumber Step Definition File

Enter the Package Name – cucumber

Enter the Class Name – TestMe

Select a few of the annotations@Given @Then @And

Click Finish

Note, I changed the packageio.cucumber.” to the newest approaches.

Replace the content of

package cucumber;

import org.testng.Assert;




public class TestMe {

     private int value;

     private int percentage;

     @Given("^I have \"([^\"]*)\"$")

     public void given(String start) throws Throwable {

          this.value = Integer.parseInt(start);


     @And("^I want to add a \"([^\"]*)\"$")

     public void and(String increase) throws Throwable {

          this.percentage = Integer.parseInt(increase);


     @Then("^I should have \"([^\"]*)\"$")

     public void then(String target) throws Throwable {

          Assert.assertEquals(value * percentage, Integer.parseInt(target));



The class tests the given, and, then predicates with a simple Assert.  You can always use the TestNG Assert.

Right Click on the TestMe file > Run Configuration

Select Cucumber Feature

Enter Name – TestMe.feature

Replace the Contents with the following:

Feature: TestMe

  Scenario Outline: use the API

    Given I have "<start>"

    And I want to add a "<increase>"

    Then I should have "<total>"


    | start | increase | total |

    |    100 |   100 |    10000 |

Right Click on the Project

Select Run As

Select maven test

You should see

[INFO] Scanning for projects...
[INFO] ---------------------------< cucumber:test>----------------------------
[INFO] Building test 99-SNAPSHOT
[INFO] --------------------------------[ jar]---------------------------------
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ test ---
[INFO] Nothing to compile - all classes are up to date
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ test ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ test ---
[INFO] Nothing to compile - all classes are up to date
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ test ---
[INFO] Surefire report directory: /Users/paulbastide/eclipse-workspace/test/target/surefire-reports

 T E S T S

Running TestSuite

Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@123772c4

Feature: TestMe
  Scenario Outline: use the API with Java7 style # src/test/resources/TestMe.feature:2

    Given I have "<start>"
    And I want to add a "<increase>"
    Then I should have "<total>"


  Scenario Outline: use the API with Java7 style # src/test/resources/TestMe.feature:9
    Given I have "100"                           # TestMe.given(String)
    And I want to add a "100"                    # TestMe.and(String)
    Then I should have "10000"                   # TestMe.then(String)

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.336 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.644 s
[INFO] Finished at: 2019-08-04T13:03:15-04:00
[INFO] ------------------------------------------------------------------------

This is the scenario which you can use, mix and match with other inputs to drive an optimal testing experience.


Next step, to figure out how I can use this approach in my healthcare API projects and increase efficacy of my products.


Cucumber Eclipse

Cucumber Test NG –

Auto Populated Feature file –

Step Definition

Maven Standard Directory Layout

Test NG and Cucumber –



raspberry pi

Raspberry Pi – Part III – Setting up Jetty

The Raspberry Pi is a device that has so many options open: You can extend the hardware. You can extend the software. I choose to tackle extending the software to start, so I can get the experience that I want setup, and running on the device.  The experience I am after is the web interface to control my Raspberry Pi.

For a Java developer, I conclude that a lightweight interface hosted on a Jetty server is probably easiest.  The Jetty server is a 12.9M download and 30M expanded. It’s also used frequently in devices, and why reinvent the wheel, use the approach that Industry is using.  Jetty is designed for a small memory footprint.   (I did consider using Tomcat Embedded, and came to the conclusion I’d probably want to many features.)

I downloaded the Jetty archive to my local user’s directory. Note, since I want to just use I’m renaming the output file with wget -O.

wget -O

I make a directory for the application server, and move over to that directory.

sudo mkdir -p /opt/jetty
sudo mv /opt/jetty

Next I launched into the sudoers root shell, and extract the Jetty archive.  I decided to move it into the runtime folder, so I can have an easy place to backup from.  (Remove the extra space from the .zip)

sudo -s 
cd /opt/jetty
mv jetty-distribution-9.2.10.v20150310/ runtime

Next, I wanted to setup Jetty as a service, and check that Jetty starts

cp runtime/bin/ /etc/init.d/jetty
echo JETTY_HOME=`pwd`/runtime > /etc/default/jetty
service jetty start
Starting Jetty: . . . OK Sun Apr 12 15:38:40 UTC 2015
service jetty stop
Stopping Jetty: OK

Next, I want to automatically start Jetty with the right runlevels

update-rc.d jetty defaults

I want to configure Jetty to run with a set user jetty.

mkdir -p /opt/jetty/web/bbq
mkdir -p /opt/jetty/temp
useradd --user-group --shell /bin/false --home-dir /opt/jetty/temp jetty

There is a base configuration that needs to be setup the base site.

cd /opt/jetty/web/bbq
java -jar /opt/jetty/runtime/start.jar --add-to-start=deploy,http,logging

Next, edit the default port value.

vi start.ini

## HTTP port to listen on

Finally, I wrap the configuration of the jetty service and app.

chown -R jetty:jetty /opt/jetty
echo "JETTY_HOME=/opt/jetty/runtime" > /etc/default/jetty
echo "JETTY_BASE=/opt/jetty/web/bbq" >> /etc/default/jetty
echo "TMPDIR=/opt/jetty/temp" >> /etc/default/jetty

A good check is to look at service jetty status, and confirm the settings, and then restart your Raspberry Pi. I did find that the startup time was significantly effected by the additional service.  ( +25 seconds from the original 15)

Navigate to (or whatever IP you have used) and confirm the page loads Jetty.  If you see a 404, you’re off and ready for the next phase. (as am I) 🙂

Jetty Starting Point
Jetty Starting Point