Create Maven profile to run all tests

- Fix for ONOS-1760
- To execute all tests run:
  $ mvn test -P all-tests

Change-Id: I65fc1ded5242ae59ae9621e98ffd49cade3567fe
diff --git a/README.md b/README.md
index 2eb11b1..cebac86 100644
--- a/README.md
+++ b/README.md
@@ -128,9 +128,30 @@
         ## Confirm the REST API server is running:
         $ ./start-rest.sh status
 
+Running unit tests
+------------------
+Unit tests bundled with ONOS source code, can be executed by using the following:
+
+        $ cd ${ONOS_HOME}/
+        $ mvn test
+
+Some of the unit tests, which take longer time to execute are excluded from the above goal.
+To force running all the unit tests, use the following commands:
+
+        $ cd ${ONOS_HOME}/
+        $ mvn test -P all-tests
+
+To run only a subset of the unit tests, use the following commands:
+
+        $ cd ${ONOS_HOME}/
+        $ mvn test -Dtest=PortNumberTest
+
+Comma and wildcards can be used to specify multiple test cases.
+See [maven-surefire-plugin website](http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html) for details.
+
 
 Developing ONOS in offline environment (Optional)
----------------------------------------------------------------------------
+-------------------------------------------------
 
 Maven need the Internet connection to download required dependencies and plugins,
 when they're used for the first time.
diff --git a/pom.xml b/pom.xml
index 2c5762a..6a07d5a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,6 +47,7 @@
      -->
     <hazelcast.version>3.2.3</hazelcast.version>
     <metrics.version>3.0.1</metrics.version>
+    <maven.surefire.plugin.version>2.16</maven.surefire.plugin.version>
   </properties>
   <build>
     <plugins>
@@ -127,7 +128,7 @@
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.16</version>
+        <version>${maven.surefire.plugin.version}</version>
         <configuration>
           <argLine>-XX:MaxPermSize=256m</argLine>
           <redirectTestOutputToFile>true</redirectTestOutputToFile>
@@ -754,5 +755,20 @@
         </plugins>
       </build>
     </profile>
+    <profile>
+      <id>all-tests</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <version>${maven.surefire.plugin.version}</version>
+            <configuration combine.self="merge">
+              <excludedGroups></excludedGroups>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 </project>