View Javadoc
1   package net.avcompris.base.testutil.processes;
2   
3   import static org.junit.Assert.assertTrue;
4   
5   import java.util.Arrays;
6   import java.util.Collection;
7   
8   import org.junit.Test;
9   
10  public abstract class AllScmIgnoresXXXTest extends TestsWithProcessesBefore {
11  
12  	private static final String[] MANDATORY_IGNORES = new String[] { "target",
13  			".project", ".classpath", ".settings" };
14  
15  	private static final Collection<String> RESTRICT_TO_IGNORES = Arrays
16  			.asList("target", ".project", ".classpath", ".settings", "bin");
17  
18  	@Test
19  	@WhileProcessing
20  	public final void testAllScmIgnoresHaveTargetEtc() throws Exception {
21  
22  		final ScmIgnore ignore = getProcessCurrentOfType(ScmIgnore.class);
23  
24  		for (final String a : MANDATORY_IGNORES) {
25  
26  			assertTrue(ignore.projectDirName + ":ignore should contain " + a,
27  					ignore.ignores.contains(a));
28  		}
29  	}
30  
31  	@Test
32  	@WhileProcessing
33  	public final void testAllScmIgnoresHaveOnlyTargetEtc() throws Exception {
34  
35  		final ScmIgnore ignore = getProcessCurrentOfType(ScmIgnore.class);
36  
37  		for (final String a : ignore.ignores) {
38  
39  			assertTrue(ignore.projectDirName + ":ignore should not contain "
40  					+ a, RESTRICT_TO_IGNORES.contains(a));
41  		}
42  	}
43  
44  	@Test
45  	@WillReportAfterProcesses
46  	public final void testTestsOnAllIgnores() throws Exception {
47  
48  		final ScmIgnore[] ignores = getProcessResultOfType(ScmIgnore[].class);
49  	}
50  }