Tuesday, 24 March 2015

How to skip integration test in maven build ?

Its not so easy when I was trying with all the possible and lost my 3 hours of valuable time. Its really very pathetic when you are trying to do something and its not happening within your time period....

This happens me when I was trying to build without the integration tests only. My scenario was to skip only integration tests ,but it must execute the unit test cases. I gooooogle almost many links but no luck , but finally the luck clicks and it works for me with below pom.xml configuration.


Add the below tag into you pom.xml


<build>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>



Here you can use <exclude> tag and mentioned any test class you want to skip.If your java class name contains *ITest.java (i.e. MyMethodITest.java)

<exclude>**/*IT*.java</exclude>

or 

<exclude>**/*AnyTestClasses.java</exclude>



Not only integration test you can skip any classes over here, but you need to configure the pom.xml properly.And in the maven command you can use below command as normal (i.e. mvn clean install)


Note - Be careful about the version, because it may not work for all version.

I hope it will help you all.



Monday, 23 March 2015

How to find Number of RAM in you Machine (Linux)?

How to find the number of RAM in Linux Machine (i.e. Mint OS). Its working for Mint OS and tested. 
sudo lshw -short


Example -
dev@developer-desktop $ sudo lshw -short
[sudo] password for dev:

H/W path Device Class Description

=========================================================
system 4518B8M (To be filled by O.E.M.)
/0 bus Motherboard
/0/0 memory 64KiB BIOS
/0/4 processor Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz
/0/4/5 memory 128KiB L1 cache
/0/4/6 memory 1MiB L2 cache
/0/4/7 memory 6MiB L3 cache
/0/1b memory 4GiB System Memory
/0/1b/0 memory DIMMProject-Id-Version: lshwReport-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>POT-Creation-Date: 2009-10-08 14:02+0200PO-Revision-Date: 2012-02-02 13:04+0000Last-T
/0/1b/1 memory 2GiB DIMM DDR3 Synchronous 1333 MHz (0.8 ns)
/0/1b/2 memory DIMMProject-Id-Version: lshwReport-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>POT-Creation-Date: 2009-10-08 14:02+0200PO-Revision-Date: 2012-02-02 13:04+0000Last-T
/0/1b/3 memory 2GiB DIMM DDR3 Synchronous 1333 MHz (0.8 ns)
/0/100 bridge 2nd Generation Core Processor Family DRAM Controller
/0/100/2 display 2nd Generation Core Processor Family Integrated Graphics Controller
/0/100/16 communication 6 Series/C200 Series Chipset Family MEI Controller #1
/0/100/16.3 communication 6 Series/C200 Series Chipset Family KT Controller
/0/100/19 eth0 network 82579LM Gigabit Network Connection
/0/100/1a bus 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2
/0/100/1b multimedia 6 Series/C200 Series Chipset Family High Definition Audio Controller
/0/100/1d bus 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1
/0/100/1e bridge 82801 PCI Bridge
/0/100/1f bridge Q67 Express Chipset Family LPC Controller
/0/100/1f.2 scsi0 storage 6 Series/C200 Series Chipset Family SATA AHCI Controller
/0/100/1f.2/0 /dev/sda disk 250GB WDC WD2500AAKX-0
/0/100/1f.2/0/1 /dev/sda1 volume 96GiB EXT4 volume
/0/100/1f.2/0/2 /dev/sda2 volume 52GiB Extended partition
/0/100/1f.2/0/2/5 /dev/sda5 volume 51GiB Linux filesystem partition
/0/100/1f.2/0/2/6 /dev/sda6 volume 1469MiB Linux filesystem partition
/0/100/1f.2/1 /dev/cdrom disk DVD RW AD-7250H
/0/100/1f.3 bus 6 Series/C200 Series Chipset Family SMBus Controller
/1 power To Be Filled By O.E.M.
/2 power To Be Filled By O.E.M.


Above I have highlighted with red color , it shows 2 slots is reserved for 2 RAM. Hope it will help you.


Hope it will help you.

Follow for more details on Google+ and @Facebook!!!

Find More :-