Friday, September 28, 2012

Maven doesn't run all tests but print build success message and quit

When i am writing an end-to-end test to Apache Axis2 JSON support(End-to-end means it up a Axis2 server and deploy a service which is created on a fly, on it and test with that service and stop Axis2 server end of tests). Here i faced a problem that when i run the test using maven(mvn test) it runs isolation test(test particular functions of a class) upto my end-to-end test. it print build success message in terminal console and quit.

OOPs what happened to other isolation tests :( . then i debug the code and see are there any test failure in my end-to-end test but, believe me end-to-end test pass all tests and successfully execute @After method which is tearDown() method too. After that it return build success message and quit. How i can find a error when it says build success :) . Finally i found the solution for that. solution is add <forkMode>pertest</forkMode> to the suirefire maven test plugin. Then every things ok , it runs all test including above end-to-end.

Saturday, August 25, 2012

How to send http post request using apache commons httpclient




Install Netbeans 7.2 in Ubuntu 11.10

When I try to install Netbeans IDE by downloading netbeas*.sh file from the Netbeans website and run it in terminal, it say installation is not completed please find the log file and try again. I tried with serveral netbeans.sh files , even several versions but result is the same. After that i tried by giving path to javahome using "sh netbeans*.sh  --javahome /path/to/JDK/home ". But still i get the same error message.

Somehow I could able to solve this issue using pack which provided by Oracle. In that pack they have bundle JDK and Netbeans 7.2 together. You can find it in JDK 7u6 with Netbeas 7.2 post published by Oracle. You need to do is accept the license agreement and download it. Then you can run it using sh command as usual.

Thanks,
Shameera.

Friday, August 10, 2012

How to Convert JSON object to String in JavaScript

If you have JSON object and you need to convert it to string you just need to use stringify method and pass your JSON object to it as a method parameter. see the example below.
 
var jsonString = JSON.stringify(passJSONobjectHere);


Friday, July 13, 2012

How to read XML Schema File as Apache commons XmlSchema Object


First you need to get the file as InputStream and then get XmlSchemaCollection of that InputStream. Using this XmlSchemaCollection object you can read XmlSchema. You can find Sample code below, Which get sample.xml XSD file to XmlSchema Object.



Now you can use this XmlSchema object to iterate the XSD file. If you need to know how to do it then have a look my previous post "How to process Apache commons XmlSchema"

How to process Apache commons XmlSchema.


Hi all,

Today I'am going to show you how to iterate XmlSchema to print all complex and simple Types elements and identify whether it is an array or not and also the type of the element.



Thursday, July 5, 2012

Add eclipse jdt core dependency and third party repository

Artifact details
Group: org.eclipse.jdt
Artifact id: core
Version: 3.4.2.v_883_R34x
Version type: Unknown
Repository: JBoss Thirdparty Releases
Repository url: https://repository.jboss.org/nexus/content/repositories/thirdparty-releases


Maven dependency



Maven repository



add this maven repository to your pom file as

<project>
.........
  <repositories>
        <repository>
         ......
      </repository>
    </repositories>
</project>

Sample Text

Website counter

Categories