Testing: 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[] createInstances() { Object[] result = new Object[10]; for (int i = 0; i < 10; i++) { result[i] = new ExampleProcessorTest(Integer.toString(i * 10)+ “A”,Integer.toString(i*10) + “B”); } return result; } } Test Running Code I can also trigger using testng.xml <class name=”DynamicTestFactory” /> Reference https://testng.org/doc/documentation-main.html

Continue Reading →

Gatsby & Carbon: Build with Github Action

As some of you know, I work on the IBM FHIR Server and with my colleagues, I have started automating some of the actions we take – Build, Test, Deploy, Deploy our website. More specific to the “Deploy our website” automation, our website uses technologies, such as Gatsby, Carbon, Gatsby Carbon Theme. Fundamentally, a static site generation technology, like Jekyll, Gatsby uses Node, Yarn and some nice React code.

Continue Reading →

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 much, but you can zoom right in). If you use a smaller set of classes and imports, the Maven plugin generates a reasonable diagram.csv file using mvn example:generate-diagram:99-SNAPSHOT:generate-diagram -f ./myproj/pom.xml You then see the output diagram.csv. To generate the layout dependencies of classes in your…

Continue Reading →

Raspberry Pi: Setting up backup

I have a Raspberry Pi providing household automation and productivity services – WebDav, Backups and Calendar. I always worry about a jolt of power, a failed byte and something that is unrecoverable. Time for a Backup solution. I plugged in a USB stick – 64GB, and immediately checked the file system is there and visible as SDA (unmounted). pi@raspberrypi:~# sudo su – root@raspberrypi:~# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 1 58.2G 1 disk └─sda1 8:1 1 58.2G 1 part mmcblk0 179:0 0 14.9G 0 disk ├─mmcblk0p1 179:1 0 43.9M 0 part /boot └─mmcblk0p2 179:2 0 14.8G…

Continue Reading →

Jupyter Notebook: Email Analysis to a Lotus Notes View

I wanted to do an analysis of my emails since I joined IBM, and see the flow of messages in-and-out of my inbox. With my preferences for Jupyter Notebooks, I built a small notebook for analysis. StepsOpen IBM Lotus Notes Rich Client Open the Notes Database with the View you want to analyze. Select the View you are interested in ‘All Documents’. For instance the All Documents view, like my inbox *obfuscated* with a purpose. Click File > Export Enter a file name – email.csv Select Format “Comma Separate Value” Click Export Upload the Notebook to your Jupyter server The…

Continue Reading →

CURL and LDAPS – How to Search and Debug

I hit an issue where I needed to Search LDAP from a machine I didn’t have access to install new RPMs on. I found this cool article on CURL and LDAP Search. I had to make some minor modifications to get it to work with a secure connection (–insecure ldaps:// and 636). I also added -v to diagnosis some connection problems. curl “ldaps://127.0.0.1:636/DC=IBM.COM?cn,objectClass?sub?(objectClass=)” -u “cn=user1,ou=test_org3,o=dr,DC=IBM.COM” –insecure -v Enter host password for user ‘cn=user1,ou=test_org3,o=dr,DC=IBM.COM’: * Trying 127.0.0.1… * Connected to 127.0.0.1 (127.0.0.1) port 636 (#0) * LDAP local: LDAP Vendor = OpenLDAP ; LDAP Version = 20428 * LDAP local: ldaps://127.0.0.1:636/DC=IBM.COM?cn,objectClass?sub?(objectClass=)…

Continue Reading →