Changing a Keystore and Key’s Password

Create a list of keystores cat << EOF > keystore-list.txttestTruststore.jkstestKeystore.jksEOF Iterate over the list to check status and process for KEYSTORE in `cat keystore-list.txt`do echo $KEYSTORE[ ! -f $KEYSTORE ] && echo NOT VAL=”`cat $KEYSTORE | wc -l`”[ ${VAL} -eq “1” ] && echo NOT_RIGHT# show the private key / trust key keytool -keystore $KEYSTORE […]

EAR Projects Generated for JavaEE Import

Importing my project into Eclipse, I found so many additional EAR projects were being generated. To stop this feature, I went to Eclipse > Preference > Maven > Java EE Integration and unchecked Enable Java EE Configuration. I removed the cached EAR projects (deleting from disk) and removed the regular projects, and imported again.  Voila…. […]

Maven Surefire runs out of memory

I’m running a complicated integration test, and needed to allocate memory appropriately – MAVEN_OPTS was used to increase memory, and I still ran into an issue with MAVEN out-of-memory.  To fix the issue, I had to use the Surefire argsline:  <plugins>   <plugin>      <groupId>org.apache.maven.plugins</groupId>      <artifactId>maven-surefire-plugin</artifactId>      <configuration>         <argLine>-Xms2G -Xmx2G</argLine>      </configuration>   </plugin></plugins>

Async JAX-RS: Quick Tips…

This article outlines the use of Jetty with JAX-RS Async. Use the webapp archetype and create the webapp in the specific archetype version. mvn archetype:generate -DgroupId=org.bastide -DartifactId=webapp -DarchetypeArtifactId=maven-archetype-webapp -DarchetypeVersion=1.4 When prompted, confirm details: [INFO] Using property: groupId = org.bastide [INFO] Using property: artifactId = webapp Define value for property ‘version’ 1.0-SNAPSHOT: : 1.0-SNAPSHOT [INFO] Using […]

Code Graph showing the Layout of the Code base

I’ve been mixing data analysis and Java programming recently.  I wrote a tool to do the analysis (Maven/Python). Here is the obfuscated output of the analysis, showing the hotspots.  I opted to show a thumbnail of the image here to protect the confidentiality of the project.  The generated image was also 78 Megabytes.  (a bit […]

Dynamic Test-NG Tests

In my last few projects, I have used Test-NG.  Uniquely in my current project, I had to generate tests programmatically.  Instead of writing one test for each element in the project, I am able to generate a bunch at-will using the following pattern: Factory package test; import org.testng.annotations.Factory; public class DynamicTestFactory { @Factory public Object[] […]

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 […]