use of org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader in project tycho by eclipse.
the class TychoTest method testWithValidExplicitTargetEnvironment.
public void testWithValidExplicitTargetEnvironment() throws Exception {
File basedir = getBasedir("projects/explicitenvironment/valid");
List<MavenProject> projects = getSortedProjects(basedir);
assertEquals(1, projects.size());
assertEquals("valid", projects.get(0).getArtifactId());
DefaultTargetPlatformConfigurationReader resolver = lookup(DefaultTargetPlatformConfigurationReader.class);
MavenSession session = newMavenSession(projects.get(0), projects);
TargetPlatformConfiguration configuration;
List<TargetEnvironment> environments;
configuration = resolver.getTargetPlatformConfiguration(session, session.getCurrentProject());
environments = configuration.getEnvironments();
assertEquals(1, environments.size());
TargetEnvironment env = environments.get(0);
assertEquals("linux", env.getOs());
assertEquals("gtk", env.getWs());
assertEquals("arm", env.getArch());
}
use of org.eclipse.tycho.core.resolver.DefaultTargetPlatformConfigurationReader in project tycho by eclipse.
the class TychoTest method testImplicitTargetEnvironment.
public void testImplicitTargetEnvironment() throws Exception {
File basedir = getBasedir("projects/implicitenvironment/simple");
List<MavenProject> projects = getSortedProjects(basedir);
assertEquals(1, projects.size());
// assertEquals("ambiguous", projects.get(0).getArtifactId());
// assertEquals("none", projects.get(0).getArtifactId());
assertEquals("simple", projects.get(0).getArtifactId());
DefaultTargetPlatformConfigurationReader resolver = lookup(DefaultTargetPlatformConfigurationReader.class);
MavenSession session;
TargetPlatformConfiguration configuration;
List<TargetEnvironment> environments;
// ambiguous
// session = newMavenSession(projects.get(0), projects);
// configuration = resolver.getTargetPlatformConfiguration(session, session.getCurrentProject());
// environments = configuration.getEnvironments();
// assertEquals(0, environments.size());
// none
// session = newMavenSession(projects.get(0), projects);
// configuration = resolver.getTargetPlatformConfiguration(session, session.getCurrentProject());
// environments = configuration.getEnvironments();
// assertEquals(0, environments.size());
// simple
session = newMavenSession(projects.get(0), projects);
configuration = resolver.getTargetPlatformConfiguration(session, session.getCurrentProject());
environments = configuration.getEnvironments();
assertEquals(1, environments.size());
TargetEnvironment env = environments.get(0);
assertEquals("foo", env.getOs());
assertEquals("bar", env.getWs());
assertEquals("munchy", env.getArch());
}
Aggregations