Sunday, November 17, 2019

Docker Compose Getting Started with JAVA RocketMQ


Just want to try Docker Compose...


Install Docker Compose on Ubuntu 18.04

JAVA JMS: RocketMQ NameServer Broker Cluster

Simple Note

Go to Dockerfile folder,

Add the docker-compose.yml below into it

then run docker-compose up

Docker Compose will build image and run container with specified config value

Testing Video


Dockerfile define "how to create the container"

docker-compose.yml describe "how to config/run containers"


Get started with Docker Compose

Compose file version 3 reference

Thursday, November 14, 2019

Install Docker Compose on Ubuntu 18.04

Simple Note

Just several lines of commands

# Run this command to download the current stable release of Docker Compose
# To install a different version of Compose, substitute 1.24.1 with the version of Compose you want to use.
sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

# Apply executable permissions to the binary:
sudo chmod +x /usr/local/bin/docker-compose

# Test the installation.
docker-compose --version

# done


Install Docker Compose

Tuesday, November 12, 2019

JAVA Selenium Visual Testing


Visual Testing is convenient, let you find any change of a web page in one line.


You probably will want to view the articles in this blog below before reading this article

JAVA Selenium Browser Automation Getting Started

JAVA Selenium Commands Testing

JAVA Image Basic Operations

Java Diff Image and Highlight Differences

Simple Note

Testing file

Visual Testing Implementation

After the testing file is executed, you should find some images in the folder selenium/visualTesting/123456 under your project folder.


Converting BufferedImage to ByteBuffer

How to make a hashcode(integer value) positive

How to take Re-entrant lock on String value?

Thursday, November 7, 2019

Java Diff Image and Highlight Differences


I want to implement visual testing with Selenium.

There is already a library romankh3/image-comparison

but it says "with the same sizes" so probably not suitable in some cases.

Simple Note

Test file

Diff implementation

Assume expected image aa.png and actual image cc.png
the diff result will be output_image.png


How do you clone a BufferedImage

calculating distance between a point and a rectangular box

Filling a Multidimensional Array using a Stream

Sunday, November 3, 2019

JAVA Image Basic Operations


I want to implement visual testing with Selenium screenshot so need to know basic operations of Image in JAVA.

Simple Note

Testing file
Including read image file, get information of each pixel, draw rectangle on loaded image then save it.

Pixel class
for store information of each pixel


Java - get pixel array from image

Java 8: Replace traditional for loops with IntStreams

Thursday, October 17, 2019