title: How to get report on how many assertEquals statement passed/failed in junit test
body: <p>I am trying to trying to test a set of result generated by a service class with some defined <code>expected</code> result. The service produce the <code>actual</code> result.</p>
  
  <p>The service is feed with values from a json file which contain some values and expected result. The output of <code>service</code> is compared with <code>expected</code> result using <code>AssertEquals</code> and the test is passing only when they are equal.</p>
  
  <p>Is it possible to continue test even if some <code>AssertEquals</code> fails and generate a report of how many <code>AssertEquals</code> have passed or failed.</p>
  
  <p>I explored <code>maven surefire</code> but I am not able to get expected result.</p>
  
  <p>Note: There is only one <code>@Test</code> method.Inside this method only I am calling the service with multiple times with different parameters and comparing <code>expected</code> &amp; <code>actual</code> result</p>
  
  <pre><code>@Test
      public void createTest() throws Exception {
          try {
              // some other code to read the file
              JSONParser parser = new JSONParser();
              // ruleValidationResourcePath is location of the file
              JSONArray array = (JSONArray) parser.parse(new FileReader(ruleValidationResourcePath));
              //looping this json and passing each object values to a service
              for(Object o:array){
                  JSONObject rulesValidation = (JSONObject) o;
                  String ruleAdExpr = (String) rulesValidation.get("ruleA");
                  String _result = (String)rulesValidation.get("result");
                  PatObj patObj= new PatObj ();
                  patObj.setRule(ruleAdExpr.trim());
                  //service is an instance of class which hold props method
                  PatObj pat = service.props(patObj);
                  if(patObj.getRule() != null){
                      String _machineRule =pat .getMachine_rule().toLowerCase().trim();
                      String expResult = _result.toLowerCase().trim();
                      // here some _machineRule &amp; expResult may be different
                      // currently test is failing if they are not equal
                      // will like to continue test even if they are not equal 
                      // and create report of how many failed/passed
  
                      Assert.assertEquals(_machineRule,expResult);
                  }
              }
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          }
      }
  </code></pre>