/*
 * Copyright 2015 the original author or authors.
 *
 * 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 org.opentestalliance;

import org.junit.Assert;
import org.junit.Test;

public class MultipleFailuresExceptionTest {

	@Test
	public void exceptionWithNoFailures() {
		MultipleFailuresException exception = new MultipleFailuresException("a name");
		Assert.assertTrue(exception.getFailures().isEmpty());
		Assert.assertFalse(exception.hasFailures());
		Assert.assertEquals("a name", exception.getMessage());
	}

	@Test
	public void exceptionWithFailures() {
		MultipleFailuresException exception = new MultipleFailuresException("a name");
		exception.addFailure(new AssertionError("failure 1"));
		exception.addFailure(new AssertionError("failure 2"));
		Assert.assertEquals(2, exception.getFailures().size());
		Assert.assertTrue(exception.hasFailures());
		Assert.assertEquals(String.format("%s%n\t%s%n\t%s", "a name", "failure 1", "failure 2"),
			exception.getMessage());
	}
}

@@ -640,32 +640,39 @@
 liance;%0A%0Aimport 
+static 
 org.junit.Assert
@@ -671,17 +671,118 @@
 t.Assert
-;
+.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0A
 %0Aimport 
@@ -973,25 +973,19 @@
 name%22);%0A
+%0A
 %09%09
-Assert.
 assertTr
@@ -1021,31 +1021,24 @@
 Empty());%0A%09%09
-Assert.
 assertFalse(
@@ -1057,39 +1057,32 @@
 sFailures());%0A%09%09
-Assert.
 assertEquals(%22a 
@@ -1354,33 +1354,27 @@
 ilure 2%22));%0A
+%0A
 %09%09
-Assert.
 assertEquals
@@ -1408,31 +1408,24 @@
 .size());%0A%09%09
-Assert.
 assertTrue(e
@@ -1451,23 +1451,16 @@
 s());%0A%09%09
-Assert.
 assertEq
@@ -1536,12 +1536,9 @@
 2%22),
-%0A%09%09%09
+ 
 exce

Use static imports for assertions