You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by cl...@apache.org on 2013/03/26 23:20:37 UTC

svn commit: r1461345 - in /jena/trunk: jena-core/src/test/java/com/hp/hpl/jena/graph/test/ jena-core/src/test/resources/regression/ jena-core/src/test/resources/regression/testModelEquals/ jena-core/testing/regression/testModelEquals/ jena-parent/ jena...

Author: claude
Date: Tue Mar 26 22:20:37 2013
New Revision: 1461345

URL: http://svn.apache.org/r1461345
Log:
Fixes Jena-424
Moved the files into resources directory
Changed AbstractTestGraph to open use getResourceAsStream() to open them.

Added:
    jena/trunk/jena-core/src/test/resources/regression/
    jena/trunk/jena-core/src/test/resources/regression/testModelEquals/
      - copied from r1455008, jena/trunk/jena-core/testing/regression/testModelEquals/
Removed:
    jena/trunk/jena-core/testing/regression/testModelEquals/
Modified:
    jena/trunk/jena-core/src/test/java/com/hp/hpl/jena/graph/test/AbstractTestGraph.java
    jena/trunk/jena-parent/pom.xml
    jena/trunk/jena-tdb/bin/tdb_path

Modified: jena/trunk/jena-core/src/test/java/com/hp/hpl/jena/graph/test/AbstractTestGraph.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-core/src/test/java/com/hp/hpl/jena/graph/test/AbstractTestGraph.java?rev=1461345&r1=1461344&r2=1461345&view=diff
==============================================================================
--- jena/trunk/jena-core/src/test/java/com/hp/hpl/jena/graph/test/AbstractTestGraph.java (original)
+++ jena/trunk/jena-core/src/test/java/com/hp/hpl/jena/graph/test/AbstractTestGraph.java Tue Mar 26 22:20:37 2013
@@ -20,6 +20,11 @@ package com.hp.hpl.jena.graph.test;
 
 import java.io.FileInputStream ;
 import java.io.FileNotFoundException ;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
 import java.util.* ;
 
 import com.hp.hpl.jena.graph.* ;
@@ -889,7 +894,7 @@ public abstract class AbstractTestGraph 
 
     /** testIsomorphism from file data 
      * @throws FileNotFoundException */
-    public void testIsomorphismFile() throws FileNotFoundException {
+    public void testIsomorphismFile() throws URISyntaxException, MalformedURLException {
         testIsomorphismXMLFile(1,true);
         testIsomorphismXMLFile(2,true);
         testIsomorphismXMLFile(3,true);
@@ -900,17 +905,22 @@ public abstract class AbstractTestGraph 
         testIsomorphismNTripleFile(8,false);
 
     }
-    private void testIsomorphismNTripleFile(int i, boolean result) throws FileNotFoundException {
+    private void testIsomorphismNTripleFile(int i, boolean result) throws URISyntaxException, MalformedURLException {
         testIsomorphismFile(i,"N-TRIPLE","nt",result);
     }
 
-    private void testIsomorphismXMLFile(int i, boolean result) throws FileNotFoundException {
+    private void testIsomorphismXMLFile(int i, boolean result) throws URISyntaxException, MalformedURLException {
         testIsomorphismFile(i,"RDF/XML","rdf",result);
 
     }
 
-    String  filebase = "testing/regression/testModelEquals/";
-    private void testIsomorphismFile(int n, String lang, String suffix, boolean result) throws FileNotFoundException {
+    private InputStream getInputStream( int n, int n2, String suffix) throws URISyntaxException, MalformedURLException
+    {
+    	String urlStr = String.format( "regression/testModelEquals/%s-%s.%s", n, n2, suffix);
+    	return AbstractTestGraph.class.getClassLoader().getResourceAsStream(  urlStr );
+    }
+    
+    private void testIsomorphismFile(int n, String lang, String suffix, boolean result) throws URISyntaxException, MalformedURLException {
 
         Graph g1 = getGraph();
         Graph g2 = getGraph();
@@ -918,10 +928,10 @@ public abstract class AbstractTestGraph 
         Model m2 = ModelFactory.createModelForGraph(g2);
 
         m1.read(
-                new FileInputStream(filebase + Integer.toString(n) + "-1."+suffix),
+                getInputStream(n, 1, suffix),
                 "http://www.example.org/",lang);
         m2.read(
-                new FileInputStream(filebase + Integer.toString(n) + "-2."+suffix),
+                getInputStream(n, 2, suffix),
                 "http://www.example.org/",lang);
 
         boolean rslt = g1.isIsomorphicWith(g2) == result;

Modified: jena/trunk/jena-parent/pom.xml
URL: http://svn.apache.org/viewvc/jena/trunk/jena-parent/pom.xml?rev=1461345&r1=1461344&r2=1461345&view=diff
==============================================================================
--- jena/trunk/jena-parent/pom.xml (original)
+++ jena/trunk/jena-parent/pom.xml Tue Mar 26 22:20:37 2013
@@ -55,7 +55,7 @@
     <ver.log4j>1.2.16</ver.log4j>
     <ver.junit>4.11</ver.junit>
 
-    <ver.xerces>2.10.0</ver.xerces>
+    <ver.xerces>2.11.0</ver.xerces>
     <ver.httpclient>4.2.3</ver.httpclient>
 
     <jdk.version>1.6</jdk.version>

Modified: jena/trunk/jena-tdb/bin/tdb_path
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/bin/tdb_path?rev=1461345&r1=1461344&r2=1461345&view=diff
==============================================================================
--- jena/trunk/jena-tdb/bin/tdb_path (original)
+++ jena/trunk/jena-tdb/bin/tdb_path Tue Mar 26 22:20:37 2013
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/sh -x
 ## 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