Skip to content
This repository has been archived by the owner on Jan 3, 2021. It is now read-only.

unit test failure: testSafariGetsHTML null expected:<[text/html]> but was:<[application/x-turtle]> #27

Open
jgeluk opened this issue Mar 7, 2014 · 3 comments

Comments

@jgeluk
Copy link

jgeluk commented Mar 7, 2014

testSafariGetsHTML(de.fuberlin.wiwiss.pubby.negotiation.PubbyNegotiatorTest) Time elapsed: 0.001 sec <<< FAILURE!
junit.framework.ComparisonFailure: null expected:<[text/html]> but was:<[application/x-turtle]>
at junit.framework.Assert.assertEquals(Assert.java:81)
at junit.framework.Assert.assertEquals(Assert.java:87)
at de.fuberlin.wiwiss.pubby.negotiation.PubbyNegotiatorTest.testSafariGetsHTML(PubbyNegotiatorTest.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

@pirelaurent
Copy link

*** i'm here because these errors prevent mvn package to progress and to obtain a war ***
After a look, the errors come from negotiator.getBestMatch("/") in

  • testAcceptEverythingGetsHTML
  • testSafariGetsHTML.

Digging into PubbyNegociator.java found the note :
--Send Turtle to clients that indicate they accept everything.--
... pubbyNegotiator.addUserAgentOverride(null,"/", "text/turtle");

So it is designed now to return [application/x-turtle] when "/" only
** Class is ok, test is not **
=> either change the assert assertEquals("text/html", by "application/x-turtle"
=> either comment the two tests.

HTH

@sorenroug
Copy link

I have the same issue. I can see these tests are from 2007, while the modification in PubbyNegotiator.java that causes the tests to fail is from October 2013.

@sorenroug
Copy link

I have contributed a patch that fixes the tests. Richard just have to pull it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants