diff options
Diffstat (limited to 'org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java')
-rw-r--r-- | org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java index 29f7742d..9ff3a467 100644 --- a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java +++ b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/AbstractLifecycleMappingTest.java @@ -77,9 +77,9 @@ public abstract class AbstractLifecycleMappingTest extends AbstractMavenProjectT return mavenProjectManager.create(project[0], monitor); } - protected LifecycleMappingMetadataSource loadLifecycleMappingMetadataSource(String metadataFilename) + + private LifecycleMappingMetadataSource loadLifecycleMappingMetadataSourceInternal(File metadataFile) throws IOException, XmlPullParserException { - File metadataFile = new File(metadataFilename); assertTrue("File does not exist:" + metadataFile.getAbsolutePath(), metadataFile.exists()); InputStream in = new FileInputStream(metadataFile); try { @@ -90,6 +90,22 @@ public abstract class AbstractLifecycleMappingTest extends AbstractMavenProjectT IOUtil.close(in); } } + protected LifecycleMappingMetadataSource loadLifecycleMappingMetadataSource(String metadataFilename) + throws IOException, XmlPullParserException { + return loadLifecycleMappingMetadataSourceInternal(new File(metadataFilename)); + } + + protected LifecycleMappingMetadataSource loadWorkspaceLifecycleMappingMetadataSource() + throws IOException, XmlPullParserException { + return loadLifecycleMappingMetadataSourceInternal(new File(MavenPluginActivator.getDefault() + .getMavenConfiguration().getWorkspaceMappingsFile())); + } + + protected void setWorkspaceLifecycleMappingMetadataSource(String newMapping) + throws IOException, XmlPullParserException { + MavenPluginActivator.getDefault() + .getMavenConfiguration().setWorkspaceMappings(newMapping); + } /** * Creates new partially initialised MavenProjectFacade instance |