Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-11.0.x

This commit is contained in:
Jan Bartel 2021-01-12 12:01:09 +01:00
commit 8152fe312e
2 changed files with 29 additions and 2 deletions

View File

@ -709,11 +709,10 @@ public class AnnotationConfiguration extends AbstractConfiguration
}
//Check if it is excluded by an ordering
URI loadingJarURI = sciResource.getURI();
boolean included = false;
for (Resource r : orderedJars)
{
included = r.getURI().equals(loadingJarURI);
included = r.equals(sciResource);
if (included)
break;
}

View File

@ -29,6 +29,7 @@ import org.hamcrest.Matchers;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
@ -37,6 +38,7 @@ import org.junit.jupiter.params.provider.MethodSource;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
public class ResourceTest
@ -292,4 +294,30 @@ public class ResourceTest
Resource globResource = Resource.newResource(globReference);
assertNotNull(globResource, "Should have produced a Resource");
}
@Test
@EnabledOnOs(OS.WINDOWS)
public void testEqualsWindowsAltUriSyntax() throws Exception
{
URI a = new URI("file:/C:/foo/bar");
URI b = new URI("file:///C:/foo/bar");
Resource ra = Resource.newResource(a);
Resource rb = Resource.newResource(b);
assertEquals(rb, ra);
}
@Test
@EnabledOnOs(OS.WINDOWS)
public void testEqualsWindowsCaseInsensitiveDrive() throws Exception
{
URI a = new URI("file:///c:/foo/bar");
URI b = new URI("file:///C:/foo/bar");
Resource ra = Resource.newResource(a);
Resource rb = Resource.newResource(b);
assertEquals(rb, ra);
}
}