Strabon

changeset 1347:13a7688d8430

Replace class TemplateOrderByTest, with a protected variable in TemplateTest
author Dimitrianos Savva <dimis@di.uoa.gr>
date Wed Jul 09 12:21:59 2014 +0300 (2014-07-09)
parents cd3fec856743
children b87735624a1c
files testsuite/src/test/java/eu/earthobservatory/testsuite/bugs/SpatialFunctionInOrderBy.java testsuite/src/test/java/eu/earthobservatory/testsuite/utils/TemplateOrderByTest.java testsuite/src/test/java/eu/earthobservatory/testsuite/utils/TemplateTest.java testsuite/src/test/java/eu/earthobservatory/testsuite/utils/Utils.java
line diff
     1.1 --- a/testsuite/src/test/java/eu/earthobservatory/testsuite/bugs/SpatialFunctionInOrderBy.java	Tue Jul 01 18:48:46 2014 +0300
     1.2 +++ b/testsuite/src/test/java/eu/earthobservatory/testsuite/bugs/SpatialFunctionInOrderBy.java	Wed Jul 09 12:21:59 2014 +0300
     1.3 @@ -9,7 +9,7 @@
     1.4   */
     1.5  package eu.earthobservatory.testsuite.bugs;
     1.6  
     1.7 -import eu.earthobservatory.testsuite.utils.TemplateOrderByTest;
     1.8 +import eu.earthobservatory.testsuite.utils.TemplateTest;
     1.9  
    1.10  
    1.11  /**
    1.12 @@ -17,4 +17,9 @@
    1.13   * 
    1.14   * @author Dimitrianos Savva <dimis@di.uoa.gr>
    1.15   */
    1.16 -public class SpatialFunctionInOrderBy extends TemplateOrderByTest{}
    1.17 +public class SpatialFunctionInOrderBy extends TemplateTest{
    1.18 +	public SpatialFunctionInOrderBy() {
    1.19 +		super();
    1.20 +		this.orderResults=true;
    1.21 +	}
    1.22 +}
     2.1 --- a/testsuite/src/test/java/eu/earthobservatory/testsuite/utils/TemplateOrderByTest.java	Tue Jul 01 18:48:46 2014 +0300
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,42 +0,0 @@
     2.4 -/**
     2.5 - * This Source Code Form is subject to the terms of the Mozilla Public
     2.6 - * License, v. 2.0. If a copy of the MPL was not distributed with this
     2.7 - * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     2.8 - * 
     2.9 - * Copyright (C) 2010, 2011, 2012, 2013 Pyravlos Team
    2.10 - * 
    2.11 - * http://www.strabon.di.uoa.gr/
    2.12 - */
    2.13 -package eu.earthobservatory.testsuite.utils;
    2.14 -
    2.15 -import java.io.File;
    2.16 -import java.net.URISyntaxException;
    2.17 -import java.util.ArrayList;
    2.18 -import java.util.Iterator;
    2.19 -
    2.20 -import org.junit.After;
    2.21 -import org.junit.Before;
    2.22 -import org.junit.Test;
    2.23 -
    2.24 -
    2.25 -/**
    2.26 - * 4) checks if the results of the query are the expected considering ORDER of results
    2.27 - * 	  If you don't explicitly use ORDER BY do NOT use this class. Use instead {@link TemplateTest}
    2.28 - * @author Dimitrianos Savva <dimis@di.uoa.gr>
    2.29 - */
    2.30 -public abstract class TemplateOrderByTest extends TemplateTest
    2.31 -{	
    2.32 -	@Override
    2.33 -	@Test
    2.34 -	public void test() throws Exception
    2.35 -	{
    2.36 -		Iterator<String> queryFileIterator = queryFile.iterator();
    2.37 -		Iterator<String> resultsFileIterator = resultsFile.iterator();
    2.38 -		
    2.39 -		while(queryFileIterator.hasNext() && resultsFileIterator.hasNext())
    2.40 -		{
    2.41 -			boolean take_into_account_order=true;
    2.42 -			Utils.testQuery(queryFileIterator.next(), resultsFileIterator.next(),take_into_account_order);
    2.43 -		}
    2.44 -	}
    2.45 -}
     3.1 --- a/testsuite/src/test/java/eu/earthobservatory/testsuite/utils/TemplateTest.java	Tue Jul 01 18:48:46 2014 +0300
     3.2 +++ b/testsuite/src/test/java/eu/earthobservatory/testsuite/utils/TemplateTest.java	Wed Jul 09 12:21:59 2014 +0300
     3.3 @@ -36,7 +36,7 @@
     3.4  	protected ArrayList<String> queryFile;
     3.5  	protected ArrayList<String> resultsFile;
     3.6  	protected Boolean inference;
     3.7 -
     3.8 +	protected Boolean orderResults;
     3.9  	
    3.10  	public TemplateTest()
    3.11  	{
    3.12 @@ -74,6 +74,7 @@
    3.13  		}
    3.14  		
    3.15  		inference=false;
    3.16 +		orderResults=false;
    3.17  	}
    3.18  
    3.19  	@Before
    3.20 @@ -91,7 +92,7 @@
    3.21  		
    3.22  		while(queryFileIterator.hasNext() && resultsFileIterator.hasNext())
    3.23  		{
    3.24 -			Utils.testQuery(queryFileIterator.next(), resultsFileIterator.next());
    3.25 +			Utils.testQuery(queryFileIterator.next(), resultsFileIterator.next(),orderResults);
    3.26  		}
    3.27  	}
    3.28  	
     4.1 --- a/testsuite/src/test/java/eu/earthobservatory/testsuite/utils/Utils.java	Tue Jul 01 18:48:46 2014 +0300
     4.2 +++ b/testsuite/src/test/java/eu/earthobservatory/testsuite/utils/Utils.java	Wed Jul 09 12:21:59 2014 +0300
     4.3 @@ -143,10 +143,6 @@
     4.4  	}
     4.5  	
     4.6  	
     4.7 -	public static void testQuery(String queryFile, String resultsFile) throws IOException, MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, URISyntaxException, QueryResultParseException, UnsupportedQueryResultFormatException
     4.8 -	{
     4.9 -		testQuery(queryFile, resultsFile, false); //dimis
    4.10 -	}
    4.11  	public static void testQuery(String queryFile, String resultsFile,boolean orderOn) throws IOException, MalformedQueryException, QueryEvaluationException, TupleQueryResultHandlerException, URISyntaxException, QueryResultParseException, UnsupportedQueryResultFormatException
    4.12  	{
    4.13  		ByteArrayOutputStream resultsStream = new ByteArrayOutputStream();