/*
 * Copyright 2015 www.seleniumtests.com
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.seleniumtests.tests;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;

import static com.seleniumtests.core.CustomAssertion.assertThat;

import org.testng.annotations.Test;

import com.seleniumtests.core.SeleniumTestPlan;

/**
 * Using Matchers.
 */
public class RetryTest extends SeleniumTestPlan {

    /**
     * Will not retry as test would never fail.
     */
    @Test(groups = "retryTest2", description = "Will retry failed assertions in this test")
    public void retryFailedTest() {
        assertThat("1 is always equal to 1", 1 == 1);            // This won't fail
        assertThat("1 can not be equal to 2", 1, is(2));
        assertThat("2 is always equal to 2", 2, equalTo(2));     // This won't fail
        assertThat("2 is always equal to 2", 2, is(equalTo(2))); // Same as previous statement
        assertThat("2 can not be equal to 3", 2, is(3));
    }
}

@@ -631,102 +631,55 @@
 ort 
-static org.hamcrest.CoreMatchers.equalTo;%0Aimport static org.hamcrest.CoreMatchers.is;%0A
+com.seleniumtests.core.CustomAssertion;
 %0Aimport 
 stat
@@ -678,15 +678,8 @@
 ort 
-static 
 com.
@@ -701,36 +701,25 @@
 ore.
-CustomAssertion.assertThat;%0A
+SeleniumTestPlan;
 %0Aimp
@@ -737,73 +737,50 @@
 tng.
-annotations.Tes
+Asser
 t;%0A
-%0A
 import 
-com.seleniumtests.core.SeleniumTestPlan
+org.testng.annotations.Test
 ;%0A%0A/
@@ -864,204 +864,288 @@
     
-/**%0A     * Will not retry as test would never fail.%0A     */%0A    @Test(groups = %22retryTest2%22, description = %22Will retry failed assertions in this test%22)%0A    public void retryFailedTest() %7B%0A        
+@Test%0A    public void retryFailedTest() %7B%0A        CustomAssertion.assertThat(%22Soft failure%22, false);%0A        CustomAssertion.assertThat(%22Soft failure 2, executed despite first failure%22, false);%0A        CustomAssertion.assertThat(%22This never fails%22, true);%0A        CustomAssertion.
 asse
@@ -1156,49 +1156,43 @@
 at(%22
-1 is always equal to 1%22, 1 == 1
+This fails again%22, false
 );
+%0A
         
     
@@ -1191,275 +1191,290 @@
     
-    // This won't fail%0A        assertThat(%221 can not be equal to 2%22, 1, is(2))
+// with out assertion check, soft failures would not be caught%0A        assert CustomAssertion.getVerificationFailures().isEmpty():%22Verification Errors%22
 ;%0A    
+%7D%0A%0A
     
-assertThat(%222 is always equal to 2%22, 2, equalTo(2));     // This won't fail%0A        assertThat(%222 is always equal to 2%22, 2, is(equalTo(2))); // Same as previous statement%0A
+private int count = 0;%0A%0A    @Test%0A    public void test() %7B%0A        count++;%0A        if (count %25 3 != 0) %7B%0A    
         
 asse
@@ -1473,55 +1473,68 @@
     
-a
+A
 ssert
-That(%222 can not be equal to 3%22, 2, is(3))
+.fail(%22Injected Failure%22);%0A        %7D%0A        count = 0
 ;%0A  

add test classes