unit test must not force a maven repository path #1574
Signed-off-by: olivier lamy <olamy@webtide.com>
This commit is contained in:
parent
80e964ef35
commit
16f441541b
|
@ -22,6 +22,19 @@
|
|||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<mavenRepoPath>${settings.localRepository}</mavenRepoPath>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
|
@ -24,6 +24,9 @@ import org.hamcrest.Matchers;
|
|||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class TypeUtilTest
|
||||
{
|
||||
@Test
|
||||
|
@ -125,8 +128,10 @@ public class TypeUtilTest
|
|||
@Test
|
||||
public void testGetLocationOfClass() throws Exception
|
||||
{
|
||||
Path mavenRepoPath = Paths.get( System.getProperty( "mavenRepoPath" ) );
|
||||
String mavenRepo = mavenRepoPath.toFile().getPath();
|
||||
// Classes from maven dependencies
|
||||
Assert.assertThat(TypeUtil.getLocationOfClass(Assert.class).toASCIIString(),Matchers.containsString("/repository/"));
|
||||
Assert.assertThat(TypeUtil.getLocationOfClass(Assert.class).toASCIIString(),Matchers.containsString(mavenRepo));
|
||||
|
||||
// Class from project dependencies
|
||||
Assert.assertThat(TypeUtil.getLocationOfClass(TypeUtil.class).toASCIIString(),Matchers.containsString("/classes/"));
|
||||
|
|
Loading…
Reference in New Issue