You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Andy Seaborne <an...@epimorphics.com> on 2011/01/26 14:18:36 UTC

Warnings from the test suite

The test suite is producing warnings:

Reproduce by:

java -classpath 'classes:lib/*' junit.textui.TestRunner 
com.hp.hpl.jena.test.TestPackage

Should these be warnings at all?

	Andy


WARN [main] (LiteralLabelImpl.java:129) - inventing a datatype for class 
java.sql.Date

WARN [main] (LiteralLabelImpl.java:129) - inventing a datatype for class 
com.hp.hpl.jena.rdf.model.impl.ResourceImpl

WARN [main] (LiteralLabelImpl.java:129) - inventing a datatype for class 
java.lang.Object

WARN [main] (LiteralLabelImpl.java:129) - inventing a datatype for class 
com.hp.hpl.jena.regression.Regression$LitTestObj

WARN [main] (LiteralLabelImpl.java:129) - inventing a datatype for class 
com.hp.hpl.jena.graph.Triple

Re: Warnings from the test suite

Posted by Andy Seaborne <an...@epimorphics.com>.

On 26/01/11 14:57, Chris Dollin wrote:
> On Wednesday, January 26, 2011 01:18:36 pm Andy Seaborne wrote:
>> The test suite is producing warnings:
>
>> Should these be warnings at all?
>
>> WARN [main] (LiteralLabelImpl.java:129) - inventing a datatype for class
>> java.sql.Date
>
> Yes, they should be at least warnings. The literal system has been asked
> to create a typed literal for which it does not have a registered
> datatype object. So it creates one (and re-uses it as necessary).
>
> Good programs won't do this, but it allows less-good [1] programs,
> and tests, to carry on.
>
> Making it an error would mean fiddling around with the regression
> tests -- or finally dumping them, since they are pure legacy and
> their job was taken over by NewRegression. Making it configurable
> would be a pain (adding a new global flag is an a-priori bad idea,
> and doesn't work if different models would have different expectations).
>
> I'm thinking ... pastels! and dumping the old regression suite. Less
> clutter to carry forward.
>
> Chris
>
>   [1] ++ungood programs have more serious issues.

Can the output of the warning be suppressed during testing?  For 
example, beforeClass/afterClass bracketing that changes the logging 
levels. org.openjena.atlas.logging.Log has some code to enable/disable 
logging for log4j programmatically which might help.  The logging 
messages aren't checked in the tests are they?

Having a build/test that causes output is problematic.  It's less error 
prone to look through the output and see no messages, or if they are,to 
take action.  Having to sift through the messages to notice what's 
expected and what isn't is liable to miss things.

(The same is true of javadoc warnings - but these aren't from this code)

	Andy

Re: Warnings from the test suite

Posted by Chris Dollin <ch...@epimorphics.com>.
On Wednesday, January 26, 2011 01:18:36 pm Andy Seaborne wrote:
> The test suite is producing warnings:

> Should these be warnings at all?

> WARN [main] (LiteralLabelImpl.java:129) - inventing a datatype for class 
> java.sql.Date

Yes, they should be at least warnings. The literal system has been asked
to create a typed literal for which it does not have a registered
datatype object. So it creates one (and re-uses it as necessary).

Good programs won't do this, but it allows less-good [1] programs,
and tests, to carry on.

Making it an error would mean fiddling around with the regression
tests -- or finally dumping them, since they are pure legacy and
their job was taken over by NewRegression. Making it configurable
would be a pain (adding a new global flag is an a-priori bad idea,
and doesn't work if different models would have different expectations).

I'm thinking ... pastels! and dumping the old regression suite. Less
clutter to carry forward.

Chris

 [1] ++ungood programs have more serious issues. 

-- 
"There are questions, so many questions"                /Script Switch Trigger/

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)