use of org.eclipse.che.maven.server.MavenServerResult in project che by eclipse.
the class MavenServerManagerTest method testResolveBadProject.
@Test
public void testResolveBadProject() throws Exception {
MavenServerResult resolveProject = mavenServer.resolveProject(new File(MavenServerManagerTest.class.getResource("/BadProject/pom.xml").getFile()), Collections.emptyList(), Collections.emptyList());
assertNotNull(resolveProject);
assertNotNull(resolveProject.getProblems());
assertEquals(1, resolveProject.getProblems().size());
}
use of org.eclipse.che.maven.server.MavenServerResult in project che by eclipse.
the class MavenServerManagerTest method testMultimoduleProjectModuleHasDependencyOnAnotherModule.
@Test
public void testMultimoduleProjectModuleHasDependencyOnAnotherModule() throws Exception {
MavenServerResult resolveProject = mavenServer.resolveProject(new File(MavenServerManagerTest.class.getResource("/multimoduleProject/test/pom.xml").getFile()), Collections.emptyList(), Collections.emptyList());
assertNotNull(resolveProject);
MavenProjectInfo projectInfo = resolveProject.getProjectInfo();
assertNotNull(projectInfo);
MavenModel mavenModel = projectInfo.getMavenModel();
assertNotNull(mavenModel);
assertThat(mavenModel.getPackaging()).isEqualTo("jar");
assertThat(mavenModel.getModules()).isEmpty();
assertThat(mavenModel.getDependencies()).isNotEmpty().hasSize(6);
mavenModel.getDependencies().forEach(mavenArtifact -> System.out.println(mavenArtifact.getFile().getAbsolutePath()));
}
use of org.eclipse.che.maven.server.MavenServerResult in project che by eclipse.
the class MavenServerManagerTest method testResolveMultimoduleProjectModulePom.
@Test
public void testResolveMultimoduleProjectModulePom() throws Exception {
MavenServerResult resolveProject = mavenServer.resolveProject(new File(MavenServerManagerTest.class.getResource("/multimoduleProject/subModule/pom.xml").getFile()), Collections.emptyList(), Collections.emptyList());
assertNotNull(resolveProject);
MavenProjectInfo projectInfo = resolveProject.getProjectInfo();
assertNotNull(projectInfo);
MavenModel mavenModel = projectInfo.getMavenModel();
assertNotNull(mavenModel);
assertThat(mavenModel.getPackaging()).isEqualTo("jar");
assertThat(mavenModel.getModules()).isEmpty();
assertThat(mavenModel.getDependencies()).isNotEmpty().hasSize(3);
}
use of org.eclipse.che.maven.server.MavenServerResult in project che by eclipse.
the class MavenServerManagerTest method testResolveProject.
@Test
public void testResolveProject() throws Exception {
MavenServerResult resolveProject = mavenServer.resolveProject(new File(MavenServerManagerTest.class.getResource("/FirstProject/pom.xml").getFile()), Collections.emptyList(), Collections.emptyList());
assertNotNull(resolveProject);
assertNotNull(resolveProject.getProjectInfo());
}
use of org.eclipse.che.maven.server.MavenServerResult in project che by eclipse.
the class MavenServerManagerTest method testProjectHasDependencies.
@Test
public void testProjectHasDependencies() throws Exception {
MavenServerResult resolveProject = mavenServer.resolveProject(new File(MavenServerManagerTest.class.getResource("/FirstProject/pom.xml").getFile()), Collections.emptyList(), Collections.emptyList());
assertNotNull(resolveProject);
MavenProjectInfo projectInfo = resolveProject.getProjectInfo();
assertNotNull(projectInfo);
MavenModel mavenModel = projectInfo.getMavenModel();
assertNotNull(mavenModel);
List<MavenArtifact> dependencies = mavenModel.getDependencies();
assertFalse(dependencies.isEmpty());
assertEquals(26, dependencies.size());
}
Aggregations