Fixing QuickStart / AttributeNormalizer test failures

+ Adding more noise to test cases to help determine what's going on in
  CI builds for test-quickstart
This commit is contained in:
Joakim Erdfelt 2016-03-23 21:28:27 -07:00
parent d341b0e1d6
commit 3628e105e9
3 changed files with 22 additions and 5 deletions

View File

@ -183,6 +183,15 @@ public class AttributeNormalizer
attributes.add(new PathAttribute("user.dir", "user.dir").weight(6));
Collections.sort(attributes, new PathAttributeComparator());
if (LOG.isDebugEnabled())
{
int i = 0;
for (PathAttribute attr : attributes)
{
LOG.debug(" [{}] {}", i++, attr);
}
}
}
catch (Exception e)
{
@ -361,7 +370,8 @@ public class AttributeNormalizer
{
if (attr.key.equalsIgnoreCase(property))
{
return attr.path.toUri().toString();
// stupid uri abuse to get "file:(scheme-specific-part)"
return attr.path.toUri().getRawSchemeSpecificPart();
}
}

View File

@ -18,16 +18,18 @@
package org.eclipse.jetty.quickstart;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import org.eclipse.jetty.util.resource.Resource;
import org.junit.Test;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;
public class AttributeNormalizerTest
{
@Test
@ -54,6 +56,8 @@ public class AttributeNormalizerTest
// Setup example from windows
String userhome = AttributeNormalizer.uriSeparators(System.getProperty("user.home"));
System.err.printf("System.getProperty('user.home') = [%s]%n",System.getProperty("user.home"));
System.err.printf("userhome = [%s]%n",userhome);
String path = "jar:file:" + userhome + "/.m2/repository/something/somejar.jar!/META-INF/some.tld";
String result = normalizer.normalize(path);

View File

@ -0,0 +1,3 @@
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
org.eclipse.jetty.LEVEL=INFO
org.eclipse.jetty.quickstart.AttributeNormalizer.LEVEL=DEBUG