1 package org.apache.maven.lifecycle.internal;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 import static org.hamcrest.Matchers.greaterThanOrEqualTo;
19 import static org.hamcrest.Matchers.is;
20 import static org.junit.Assert.assertEquals;
21 import static org.junit.Assert.assertThat;
22
23 import org.apache.maven.execution.MavenSession;
24 import org.apache.maven.lifecycle.internal.stub.ProjectDependencyGraphStub;
25 import org.junit.Test;
26
27
28
29
30 public class ProjectBuildListTest
31 {
32 @Test
33 public void testGetByTaskSegment()
34 throws Exception
35 {
36 final MavenSession session = ProjectDependencyGraphStub.getMavenSession();
37 ProjectBuildList projectBuildList = ProjectDependencyGraphStub.getProjectBuildList( session );
38 TaskSegment taskSegment = projectBuildList.get( 0 ).getTaskSegment();
39 assertThat( "This test assumes there are at least 6 elements in projectBuilds",
40 projectBuildList.size(), is( greaterThanOrEqualTo( 6 ) ) );
41
42 final ProjectBuildList byTaskSegment = projectBuildList.getByTaskSegment( taskSegment );
43 assertEquals( projectBuildList.size(),
44 byTaskSegment.size() );
45 }
46
47 }