Skip to content

Commit

Permalink
Issue #5870 - Updating Windows tests
Browse files Browse the repository at this point in the history
+ Eliminating OS.MAC (as it doesn't support drive letters)
+ Adding alt URI syntax version as well
  • Loading branch information
joakime committed Jan 11, 2021
1 parent 799691c commit 34ffe9f
Showing 1 changed file with 19 additions and 6 deletions.
Expand Up @@ -43,8 +43,8 @@
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;
import static org.junit.jupiter.api.Assertions.assertTrue;

public class ResourceTest
{
Expand Down Expand Up @@ -299,17 +299,30 @@ public void testGlobPath() throws IOException
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.MAC, OS.WINDOWS})
public void testEquals() throws Exception
@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);
assertTrue(ra.equals(rb));

assertEquals(rb, ra);
}
}

0 comments on commit 34ffe9f

Please sign in to comment.