forked from tesla/m2e-core-tests
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew Eisenberg
committed
May 22, 2012
1 parent
acdd35c
commit 22feff4
Showing
3 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
org.eclipse.m2e.tests/src/org/eclipse/m2e/tests/lifecycle/WorkspaceMappingsFileTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012 VMware, Inc | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Andrew Eisenberg - Work on Bug 350414 | ||
*******************************************************************************/ | ||
|
||
package org.eclipse.m2e.tests.lifecycle; | ||
|
||
import org.eclipse.m2e.tests.common.AbstractLifecycleMappingTest; | ||
|
||
|
||
/** | ||
* Tests for changing the workspace lifecycle mappings file | ||
* WorkspaceMappingsFileTest | ||
* | ||
* @author andrew | ||
*/ | ||
public class WorkspaceMappingsFileTest extends AbstractLifecycleMappingTest { | ||
|
||
protected void tearDown() throws Exception { | ||
mavenConfiguration.setWorkspaceMappingsFile(null); | ||
super.tearDown(); | ||
} | ||
|
||
public void testIsDefault() throws Exception { | ||
assertEquals(mavenConfiguration.getDefaultWorkspaceMappingsFile(), | ||
mavenConfiguration.getWorkspaceMappingsFile()); | ||
} | ||
|
||
public void testChangeFromDefault() throws Exception { | ||
String newFile = "foo"; | ||
mavenConfiguration.setWorkspaceMappingsFile(newFile); | ||
assertEquals(newFile, | ||
mavenConfiguration.getWorkspaceMappingsFile()); | ||
} | ||
public void testChangeToDefault() throws Exception { | ||
String newFile = "foo"; | ||
mavenConfiguration.setWorkspaceMappingsFile(newFile); | ||
mavenConfiguration.setWorkspaceMappingsFile(null); | ||
assertEquals(mavenConfiguration.getDefaultWorkspaceMappingsFile(), | ||
mavenConfiguration.getWorkspaceMappingsFile()); | ||
} | ||
|
||
public void testChangeText() throws Exception { | ||
String origText = mavenConfiguration.getWorkspaceMappings(); | ||
String newText = "blah!"; | ||
mavenConfiguration.setWorkspaceMappings(newText); | ||
assertEquals(newText, mavenConfiguration.getWorkspaceMappings()); | ||
mavenConfiguration.setWorkspaceMappings(origText); | ||
assertEquals(origText, mavenConfiguration.getWorkspaceMappings()); | ||
} | ||
} |