Q: What about when the tests are used by subclasses in a different package. The test files would then need to be loaded from the class path. I ran into this issue trying to run tests on graph implementations before. However, it my not apply in this specific case with assemblers. So I am asking, is there an issue here if the test is subclassed in a different project and includes these tests via the test-jar packaging?
Claude On Thu, Nov 30, 2017 at 11:38 PM, afs <[email protected]> wrote: > Github user afs commented on a diff in the pull request: > > https://github.com/apache/jena/pull/314#discussion_r154233274 > > --- Diff: jena-arq/src/test/java/org/apache/jena/sparql/core/ > assembler/TestDatasetAssembler.java --- > @@ -0,0 +1,122 @@ > +/* > + * Licensed to the Apache Software Foundation (ASF) under one > + * or more contributor license agreements. See the NOTICE file > + * distributed with this work for additional information > + * regarding copyright ownership. The ASF licenses this file > + * to you under the Apache License, Version 2.0 (the > + * "License"); you may not use this file except in compliance > + * with the License. You may obtain a copy of the License at > + * > + * http://www.apache.org/licenses/LICENSE-2.0 > + * > + * Unless required by applicable law or agreed to in writing, software > + * distributed under the License is distributed on an "AS IS" BASIS, > + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > implied. > + * See the License for the specific language governing permissions and > + * limitations under the License. > + */ > +package org.apache.jena.sparql.core.assembler; > + > +import static java.nio.file.Files.createTempFile; > +import static org.apache.jena.assembler.JA.data; > +import static org.apache.jena.assembler.Mode.DEFAULT; > +import static org.apache.jena.rdf.model.ModelFactory. > createDefaultModel; > +import static org.apache.jena.riot.Lang.NQUADS; > +import static org.apache.jena.riot.RDFDataMgr.write; > +import static org.apache.jena.vocabulary.RDF.type; > + > +import java.io.*; > +import java.nio.file.Path; > + > +import org.apache.jena.assembler.JA; > +import org.apache.jena.assembler.exceptions.CannotConstructException; > +import org.apache.jena.query.Dataset; > +import org.apache.jena.rdf.model.*; > +import org.apache.jena.sparql.core.*; > +import org.apache.jena.sparql.sse.SSE; > +import org.apache.jena.sparql.util.IsoMatcher; > +import org.apache.jena.system.Txn; > +import org.junit.Assert; > +import org.junit.Test; > + > +public class TestDatasetAssembler extends Assert { > --- End diff -- > > Generally, tests are loaded from a `testing/` directory, not the > classpath. Some tests need to read real, normal files and also the W3C > SPARQL tests run from on-disk files and manifests. Once some tests do need > files, there isn't much value in classpath loading as its extra, not > instead of. Assemblers need to read from files, it being the common > usecase. > > > > > --- > -- I like: Like Like - The likeliest place on the web <http://like-like.xenei.com> LinkedIn: http://www.linkedin.com/in/claudewarren
