March 7, 2017

Eclipse error | EcoreEMap$DelegateEObjectContainmentEList

Eclipse error

An internal error occurred during: "Loading Web Service DOM..."
.org.eclipse.emf.ecore.util.EcoreEMap$DelegateEObjectContainmentEList

Above error I faced while working with one of my eclipse project. After this if I do Ok and continue with eclipse I am getting error with eclipse import project for existing work space and svn checkout.

I tried out many thing and found it is related to Java version. Not sure it is right way to resolve this issue or not, But it worked for me. Java version in eclipse is degraded to 1.5.I don’t know how it took place. So I updated my java version to 1.7 again and this error is solved.
Share:

February 27, 2017

Testing Pyramid

While searching theory behind integration tests, I landed into testing pyramid concept and found it good to be share.
Basically, tests are used as a feedback loop. They are responsible to inform developer whether the application is working or not.

With respect to the testing pyramid, three types of test cases are described.
·        Unit test cases are focused on the single unit of responsibility at a time. All the dependencies of that single unit will be mocked.
·        Integration tests are to ensure that more than one unit working together should work fine without mocking other units.
·        End to end tests or acceptance tests is used to test the application by simulating end user scenarios.

Testing Pyramid

In testing pyramid concept, it always focuses on to write more and more unit test case and business should be tested in form smallest unit.

Integration tests to test integration between units without mocking the units. It will make sure communication between units is working fine as the business logic already tested in unit tests.

With testing pyramid concept, it always discourages to write more end to end test cases as they are slow to run as running against a live application.
Also, it’s not easy to identify which unit is failing. Single change or enhancement in one feature may lead to failure of most of the end to end test like if login feature is changed in an application then the further features test will start failing.
Only advantages of the end to end tests are they are able to simulate end user behavior.

Also from one of google blog, it is also suggested to have 70 (Unit) / 20 (Integration) / 10 (End to end) ratio for tests.
Share:

January 2, 2017

Maven | How To Set Specific Java Version

This article is to learn how to set specific java version for maven in windows. As this might be required where java home set to one version and developer want to run maven command with specific another java version.4-l
To run maven with specific java, one need to update file mvn.bat file in bin folder. In mvn.bat file set java home explicitly as below.

@REM ==== START VALIDATION ====
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25\jre
if not "%JAVA_HOME%" == "" goto OkJHome

After saving mvn.bat, maven will run with respect to java home set in file.
One can verify this by firing command mvn command as below.
After setting up Java version in mvn.bat file, maven java version can be verified in command prompt.

C:\Users\e050125>java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

C:\Users\e050125>mvn -version
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21:28+0530)
Maven home: C:\software\Maven\apache-maven-3.0.5
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_25\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Share:

January 1, 2017

Cygwin | How To Get C Drive Location

I came across to Cygwin with one of the requirements of my project. Basically, I want to perform some Linux command on windows. After googling out I landed to Cygwin as a solution and found it good to share.
Here below is the command to navigate to C drive of your windows system using Cygwin.

$ cd cygdrive/c 

Here below is the screenshot of what prior command require to execute.
Share:

October 7, 2016

Maven | M2_HOME Is Set To An Invalid Directory

I have followed couple of online article to set maven home path. Even after setting right path I was facing below issue.

ERROR: M2_HOME is set to an invalid directory.
M2_HOME = "C:\software\Maven\apache-maven-3.3.9"
Please set the M2_HOME variable in your environment to match the location of the Maven installation

Above issue is because of another version of maven installation at parallel location.

C:\software\Maven\apache-maven-3.0.5

Once I removed older version from same location issue got resolved. I am not sure as of now how higher version installation having problems with older version existence. 
Share: