unit test must not force a maven repository path #1574
Signed-off-by: olivier lamy <olamy@webtide.com>
This commit is contained in:
parent
806dff64f3
commit
4ce42c19ec
|
@ -1,60 +1,73 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.eclipse.jetty</groupId>
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
<artifactId>jetty-project</artifactId>
|
<artifactId>jetty-project</artifactId>
|
||||||
<version>9.4.7-SNAPSHOT</version>
|
<version>9.4.6-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>jetty-util</artifactId>
|
<artifactId>jetty-util</artifactId>
|
||||||
<name>Jetty :: Utilities</name>
|
<name>Jetty :: Utilities</name>
|
||||||
<description>Utility classes for Jetty</description>
|
<description>Utility classes for Jetty</description>
|
||||||
<url>http://www.eclipse.org/jetty</url>
|
<url>http://www.eclipse.org/jetty</url>
|
||||||
<properties>
|
<properties>
|
||||||
<bundle-symbolic-name>${project.groupId}.util</bundle-symbolic-name>
|
<bundle-symbolic-name>${project.groupId}.util</bundle-symbolic-name>
|
||||||
</properties>
|
</properties>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>findbugs-maven-plugin</artifactId>
|
<artifactId>findbugs-maven-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<onlyAnalyze>org.eclipse.jetty.util.*</onlyAnalyze>
|
<onlyAnalyze>org.eclipse.jetty.util.*</onlyAnalyze>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
<pluginManagement>
|
||||||
<dependencies>
|
<plugins>
|
||||||
<dependency>
|
<plugin>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<scope>provided</scope>
|
<configuration>
|
||||||
</dependency>
|
<systemPropertyVariables>
|
||||||
<dependency>
|
<mavenRepoPath>${settings.localRepository}</mavenRepoPath>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
</systemPropertyVariables>
|
||||||
<artifactId>jetty-perf-helper</artifactId>
|
</configuration>
|
||||||
<scope>test</scope>
|
</plugin>
|
||||||
</dependency>
|
</plugins>
|
||||||
<dependency>
|
</pluginManagement>
|
||||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
</build>
|
||||||
<artifactId>jetty-test-helper</artifactId>
|
<dependencies>
|
||||||
<scope>test</scope>
|
<dependency>
|
||||||
</dependency>
|
<groupId>javax.servlet</groupId>
|
||||||
<dependency>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
<groupId>org.slf4j</groupId>
|
<scope>provided</scope>
|
||||||
<artifactId>slf4j-api</artifactId>
|
</dependency>
|
||||||
<scope>provided</scope>
|
<dependency>
|
||||||
<optional>true</optional>
|
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||||
</dependency>
|
<artifactId>jetty-perf-helper</artifactId>
|
||||||
<!--
|
<scope>test</scope>
|
||||||
This dependency is used to test Slf4jLog.
|
</dependency>
|
||||||
Due to the introduction of src/test/resource/jetty-logging.properties (and the Log.static{} block)
|
<dependency>
|
||||||
the default Log implementation is still StdErrLog during testing.
|
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||||
-->
|
<artifactId>jetty-test-helper</artifactId>
|
||||||
<dependency>
|
<scope>test</scope>
|
||||||
<groupId>org.slf4j</groupId>
|
</dependency>
|
||||||
<artifactId>slf4j-jdk14</artifactId>
|
<dependency>
|
||||||
<version>${slf4j-version}</version>
|
<groupId>org.slf4j</groupId>
|
||||||
<scope>test</scope>
|
<artifactId>slf4j-api</artifactId>
|
||||||
</dependency>
|
<scope>provided</scope>
|
||||||
</dependencies>
|
<optional>true</optional>
|
||||||
</project>
|
</dependency>
|
||||||
|
<!--
|
||||||
|
This dependency is used to test Slf4jLog.
|
||||||
|
Due to the introduction of src/test/resource/jetty-logging.properties (and the Log.static{} block)
|
||||||
|
the default Log implementation is still StdErrLog during testing.
|
||||||
|
-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-jdk14</artifactId>
|
||||||
|
<version>${slf4j-version}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
|
|
|
@ -24,6 +24,9 @@ import org.hamcrest.Matchers;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
public class TypeUtilTest
|
public class TypeUtilTest
|
||||||
{
|
{
|
||||||
@Test
|
@Test
|
||||||
|
@ -125,8 +128,10 @@ public class TypeUtilTest
|
||||||
@Test
|
@Test
|
||||||
public void testGetLocationOfClass() throws Exception
|
public void testGetLocationOfClass() throws Exception
|
||||||
{
|
{
|
||||||
|
Path mavenRepoPath = Paths.get( System.getProperty( "mavenRepoPath" ) );
|
||||||
|
String mavenRepo = mavenRepoPath.toFile().getPath();
|
||||||
// Classes from maven dependencies
|
// 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
|
// Class from project dependencies
|
||||||
Assert.assertThat(TypeUtil.getLocationOfClass(TypeUtil.class).toASCIIString(),Matchers.containsString("/classes/"));
|
Assert.assertThat(TypeUtil.getLocationOfClass(TypeUtil.class).toASCIIString(),Matchers.containsString("/classes/"));
|
||||||
|
|
Loading…
Reference in New Issue