You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/03/06 18:57:38 UTC

[jira] [Commented] (WICKET-5851) PackageResourceTest#packageResourceGuard test fails under Windows

    [ https://issues.apache.org/jira/browse/WICKET-5851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14350642#comment-14350642 ] 

ASF GitHub Bot commented on WICKET-5851:
----------------------------------------

GitHub user shuraa opened a pull request:

    https://github.com/apache/wicket/pull/107

    WICKET-5851 Fix PackageResourceTest and PackageResourceGuardTest under Windows

    Please, review PR.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shuraa/wicket wicket-6.x

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/wicket/pull/107.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #107
    
----
commit e00c54c310000924290476f91797a2197a756782
Author: Alexander Morozov <al...@gmail.com>
Date:   2015-03-05T18:16:59Z

    WICKET-5850 Fix class loading issue in LazyInitProxyFactory in case of multimodule deployment

commit 830776e90ffd564d7b8e678c8d850d18a41e5142
Author: Alexander Morozov <al...@gmail.com>
Date:   2015-03-06T17:07:16Z

    Merge remote-tracking branch 'upstream/wicket-6.x' into wicket-6.x
    
    Conflicts:
    	wicket-ioc/src/main/java/org/apache/wicket/proxy/LazyInitProxyFactory.java

commit 2ed52c012c5d84c9dfcb5ffb571b9541c0575073
Author: Alexander Morozov <al...@gmail.com>
Date:   2015-03-06T17:51:13Z

    WICKET-5851 Fix PackageResourceTest and PackageResourceGuardTest under Windows

----


> PackageResourceTest#packageResourceGuard test fails under Windows
> -----------------------------------------------------------------
>
>                 Key: WICKET-5851
>                 URL: https://issues.apache.org/jira/browse/WICKET-5851
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.19.0
>         Environment: Windows 8.1 Pro, Oracle JDK 7u72 x64
>            Reporter: Alexander Morozov
>
> I'm emphasized assert statement which causes the issue
> {code:java}
> 	@Test
> 	public void packageResourceGuard() throws Exception
> 	{
> 		PackageResourceGuard guard = new PackageResourceGuard();
> 		assertTrue(guard.acceptExtension("txt"));
> 		assertFalse(guard.acceptExtension("java"));
> 		assertTrue(guard.acceptAbsolutePath("foo/Bar.txt"));
> 		assertFalse(guard.acceptAbsolutePath("foo/Bar.java"));
> 		assertTrue(guard.accept(PackageResourceTest.class,
> 			Packages.absolutePath(PackageResourceTest.class, "Bar.txt")));
> 		assertTrue(guard.accept(PackageResourceTest.class,
> 			Packages.absolutePath(PackageResourceTest.class, "Bar.txt.")));
> 		assertTrue(guard.accept(PackageResourceTest.class,
> 			Packages.absolutePath(PackageResourceTest.class, ".Bar.txt")));
> 		assertTrue(guard.accept(PackageResourceTest.class,
> 			Packages.absolutePath(PackageResourceTest.class, ".Bar.txt.")));
> 		assertTrue(guard.accept(PackageResourceTest.class,
> 			Packages.absolutePath(PackageResourceTest.class, ".Bar")));
> >>>>	assertTrue(guard.accept(PackageResourceTest.class,
> 			Packages.absolutePath(PackageResourceTest.class, ".java")));
> 		assertFalse(guard.accept(PackageResourceTest.class,
> 			Packages.absolutePath(PackageResourceTest.class, "Bar.java")));
> 	}
> {code}
> There is another issue in PackageResourceGuardTest 
> {code:java}
> 	@Test
> 	public void acceptAbsolutePath()
> 	{
> 		PackageResourceGuard guard = new PackageResourceGuard();
> 		guard.setAllowAccessToRootResources(false);
> 		assertTrue(guard.acceptAbsolutePath("/test/test.js"));
> 		assertFalse(guard.acceptAbsolutePath("/test.js"));
> >>> File.pathSeparator must be replaced with File.separator
> >>>		if ("\\".equals(File.pathSeparator))
> 		{
> 			assertTrue(guard.acceptAbsolutePath("c:\\test\\org\\apache\\test.js"));
> 			assertTrue(guard.acceptAbsolutePath("\\test\\org\\apache\\test.js"));
> 			assertFalse(guard.acceptAbsolutePath("c:\\test.js"));
> 			assertFalse(guard.acceptAbsolutePath("\\test.js"));
> 			// java also generates file paths with '/' on windows
> 			assertTrue(guard.acceptAbsolutePath("c:/test/org/apache/test.js"));
> 			assertTrue(guard.acceptAbsolutePath("/test/org/apache/test.js"));
> 			assertFalse(guard.acceptAbsolutePath("c:/test.js"));
> 			assertFalse(guard.acceptAbsolutePath("/test.js"));
> 		}
> 	}
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)