sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1651189 - in /sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis: internal/shapefile/jdbc/ internal/shapefile/jdbc/sql/ storage/shapefile/
Date Mon, 12 Jan 2015 20:26:33 GMT
Author: desruisseaux
Date: Mon Jan 12 20:26:33 2015
New Revision: 1651189

URL: http://svn.apache.org/r1651189
Log:
Remove trailing spaces for reducing the risk of conflicts during merge.
There is no code or formatting change in this commit.

Modified:
    sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/AbstractTestBaseForInternalJDBC.java
    sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFConnectionTest.java
    sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFResultSetTest.java
    sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFStatementTest.java
    sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/sql/WhereClauseTest.java
    sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java

Modified: sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/AbstractTestBaseForInternalJDBC.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/AbstractTestBaseForInternalJDBC.java?rev=1651189&r1=1651188&r2=1651189&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/AbstractTestBaseForInternalJDBC.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/AbstractTestBaseForInternalJDBC.java
[UTF-8] Mon Jan 12 20:26:33 2015
@@ -17,14 +17,14 @@ import org.apache.sis.util.logging.Loggi
 import org.junit.Before;
 
 /**
- * Base class to settle a common environment to all the JDBC tests : 
+ * Base class to settle a common environment to all the JDBC tests :
  * all these tests are currently based on the SignedBikeRoute_4326_clipped.dbf DBase 3 file.
  * @author Marc LE BIHAN
  */
 public abstract class AbstractTestBaseForInternalJDBC extends TestCase {
     /** Logger. */
     protected Logger log = Logging.getLogger(getClass().getName());
-    
+
     /** The database file to use for testing purpose.  */
     protected File dbfFile;
 
@@ -35,9 +35,9 @@ public abstract class AbstractTestBaseFo
      */
     public Connection connect() throws SQLException {
         final Driver driver = new DBFDriver();
-        return driver.connect(dbfFile.getAbsolutePath(), null);        
+        return driver.connect(dbfFile.getAbsolutePath(), null);
     }
-    
+
     /**
      * Test setup.
      * @throws URISyntaxException If an error occurred while getting the file to the test
database.

Modified: sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFConnectionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFConnectionTest.java?rev=1651189&r1=1651188&r2=1651189&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFConnectionTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFConnectionTest.java
[UTF-8] Mon Jan 12 20:26:33 2015
@@ -48,7 +48,7 @@ public class DBFConnectionTest extends A
         assertTrue ("Connection should be closed", connection.isClosed());
         assertFalse("Connection should no more be valid", connection.isValid(0));
     }
-    
+
     /**
      * An attempt to use a closed connection must fail with the correct exception.
      * @throws SQLException if an error occurred while opening the database.
@@ -60,7 +60,7 @@ public class DBFConnectionTest extends A
         final Driver driver = new DBFDriver();
         final Connection connection = driver.connect(dbfFile.getAbsolutePath(), null);
         connection.close();
-        
+
         // Then, attempt to use it.
         try {
             connection.createStatement();

Modified: sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFResultSetTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFResultSetTest.java?rev=1651189&r1=1651188&r2=1651189&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFResultSetTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFResultSetTest.java
[UTF-8] Mon Jan 12 20:26:33 2015
@@ -53,7 +53,7 @@ public class DBFResultSetTest extends Ab
             assertEquals("getDate(\"TR_DATE\")", null, rs.getDate("TR_DATE"));          
            // TR_DATE Date(8)
         }
     }
-    
+
     /**
      * Read all the DBF records.
      * @throws SQLException if an error occurred while querying the database.
@@ -63,10 +63,10 @@ public class DBFResultSetTest extends Ab
     public void readAllRecords() throws SQLException {
         try(Connection connection = connect(); Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM SignedBikeRoute")) {
             int count = 0;
-            
+
             while(rs.next()) {
                 ArrayList<Object> record = new ArrayList<>();
-                
+
                 record.add(rs.getLong("OBJECTID"));         // Type : Number, Field length
: 10, Decimal positions : 0
                 record.add(rs.getLong("FNODE_"));           // Type : Number, Field length
: 10, Decimal positions : 0
                 record.add(rs.getLong("TNODE_"));           // Type : Number, Field length
: 10, Decimal positions : 0
@@ -122,16 +122,16 @@ public class DBFResultSetTest extends Ab
                 record.add(rs.getString("SIGNED_JOI"));     // Type : Character, Field length
: 5, Decimal positions : 0
                 record.add(rs.getString("SIGNED_FAC"));     // Type : Character, Field length
: 30, Decimal positions : 0
                 record.add(rs.getString("NEW_USE"));        // Type : Character, Field length
: 30, Decimal positions : 0
-                record.add(rs.getBigDecimal("SHAPE_LEN"));  // Type : Number, Field length
: 19, Decimal positions : 11                
-                
+                record.add(rs.getBigDecimal("SHAPE_LEN"));  // Type : Number, Field length
: 19, Decimal positions : 11
+
                 count ++;
                 log.info(MessageFormat.format("Record {0,number} : {1}\n", count, record));
             }
-            
+
             assertTrue("Less than one record was readed.", count > 1);
         }
     }
-    
+
     /**
      * An attempt to use a closed resultSet must fail with the correct exception and message.
      * @throws SQLException if an error occurred while opening the database, the statement
or the resultset.
@@ -140,36 +140,36 @@ public class DBFResultSetTest extends Ab
     public void resultSetClosed() throws SQLException {
         // 1) Open a connection, open a statement, open and close a ResultSet.
         String sql = "SELECT * FROM SignedBikeRoute";
-        
+
         try(Connection connection = connect(); Statement stmt = connection.createStatement())
{
             // Then, attempt to use it.
             try {
                 ResultSet rs = stmt.executeQuery(sql);
                 rs.close();
-            } 
+            }
             catch(SQLConnectionClosedException e) {
                 assertEquals("The database name in this exception is not well set.", e.getDatabase().getName(),
dbfFile.getName());
                 assertEquals("The SQL Query is exception is not well set.", e.getSQL(), sql);
-            } 
+            }
             catch(SQLException e) {
                 fail("Not the expected exception for using a closed ResultSet.");
             }
         }
-        
+
         // 2) Same, but we close the connection instead.
         Connection connection = connect();
         Statement stmt = connection.createStatement();
         ResultSet rs = stmt.executeQuery(sql);
-        
+
         connection.close(); // At this time, you expect also a warning on the console, telling
that you have one statement and one ResultSet still opened.
-        
+
         // Then, attempt to use it.
         try {
             rs.next();
-        } 
+        }
         catch(SQLConnectionClosedException e) {
             assertEquals("The database name is exception message is not well set.", e.getDatabase().getName(),
dbfFile.getName());
-        } 
+        }
         catch(SQLException e) {
             fail("Not the expected exception for using a closed ResultSet.");
         }
@@ -177,21 +177,21 @@ public class DBFResultSetTest extends Ab
             rs.close();
             stmt.close();
         }
-        
+
         // 3) Same, but we close the statement instead .
         try(Connection cnt = connect()) {
             stmt = cnt.createStatement();
             rs = stmt.executeQuery(sql);
-            
+
             stmt.close(); // At this time, you expect also a information message on the console,
telling that the statement has closed its current ResultSet.
-            
+
             // Then, attempt to use it.
             try {
                 rs.next();
-            } 
+            }
             catch(SQLConnectionClosedException e) {
                 assertEquals("The database name is exception message is not well set.", e.getDatabase().getName(),
dbfFile.getName());
-            } 
+            }
             catch(SQLException e) {
                 fail("Not the expected exception for using a closed ResultSet.");
             }

Modified: sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFStatementTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFStatementTest.java?rev=1651189&r1=1651188&r2=1651189&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFStatementTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/DBFStatementTest.java
[UTF-8] Mon Jan 12 20:26:33 2015
@@ -40,16 +40,16 @@ public class DBFStatementTest extends Ab
     @Test
     public void openCloseStatement() throws SQLException {
         final Driver driver = new DBFDriver();
-        
+
         try(Connection connection = driver.connect(dbfFile.getAbsolutePath(), null)) {
             final Statement stmt = connection.createStatement();
             assertFalse("Statement should be opened", stmt.isClosed());
-    
+
             stmt.close();
             assertTrue ("Statement should be closed", stmt.isClosed());
         }
     }
-    
+
     /**
      * An attempt to use a closed statement must fail with the correct exception.
      * @throws SQLException if an error occurred while opening the database or the statement.
@@ -61,32 +61,32 @@ public class DBFStatementTest extends Ab
         try(Connection connection = connect()) {
             final Statement stmt = connection.createStatement();
             stmt.close();
-            
+
             // Then, attempt to use it.
             try {
                 stmt.executeQuery("Must detect that the statement is closed, and not try
to parse this query.");
-            } 
+            }
             catch(SQLConnectionClosedException e) {
                 assertEquals("The database name in this exception is not well set.", e.getDatabase().getName(),
dbfFile.getName());
-            } 
+            }
             catch(SQLException e) {
                 fail("Not the expected exception for using a closed statement.");
             }
         }
-        
+
         // Same, but we close the connection instead.
         Connection connection = connect();
         final Statement stmt = connection.createStatement();
-        
+
         connection.close(); // At this time, you expect also a warning on the console, telling
that you have one statement still opened.
-        
+
         // Then, attempt to use it.
         try {
             stmt.executeQuery("Must detect that the statement is closed, and not try to parse
this query.");
-        } 
+        }
         catch(SQLConnectionClosedException e) {
             assertEquals("The database name in this exception is not well set.", e.getDatabase().getName(),
dbfFile.getName());
-        } 
+        }
         catch(SQLException e) {
             fail("Not the expected exception for using a closed statement.");
         }

Modified: sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/sql/WhereClauseTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/sql/WhereClauseTest.java?rev=1651189&r1=1651188&r2=1651189&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/sql/WhereClauseTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/internal/shapefile/jdbc/sql/WhereClauseTest.java
[UTF-8] Mon Jan 12 20:26:33 2015
@@ -22,31 +22,31 @@ public class WhereClauseTest extends Abs
     public void operators() throws SQLException {
         try(Connection connection = connect(); Statement stmt = connection.createStatement();
DBFRecordBasedResultSet rs = (DBFRecordBasedResultSet)stmt.executeQuery("SELECT * FROM SignedBikeRoute"))
{
             rs.next();
-            
+
             assertTrue("FNODE_ = 1199", new ConditionalClauseResolver("FNODE_", 1199L, "=").isVerified(rs));
             assertFalse("FNODE_ > 1199", new ConditionalClauseResolver("FNODE_", 1199L,
">").isVerified(rs));
             assertFalse("FNODE_ < 1199", new ConditionalClauseResolver("FNODE_", 1199L,
"<").isVerified(rs));
             assertTrue("FNODE_ >= 1199", new ConditionalClauseResolver("FNODE_", 1199L,
">=").isVerified(rs));
             assertTrue("FNODE_ <= 1199", new ConditionalClauseResolver("FNODE_", 1199L,
"<=").isVerified(rs));
-            
+
             assertTrue("FNODE_ > 1198", new ConditionalClauseResolver("FNODE_", 1198L,
">").isVerified(rs));
             assertFalse("FNODE_ < 1198", new ConditionalClauseResolver("FNODE_", 1198L,
"<").isVerified(rs));
             assertTrue("FNODE_ >= 1198", new ConditionalClauseResolver("FNODE_", 1198L,
">=").isVerified(rs));
             assertFalse("FNODE_ <= 1198", new ConditionalClauseResolver("FNODE_", 1198L,
"<=").isVerified(rs));
-            
+
             assertFalse("FNODE_ > 1200", new ConditionalClauseResolver("FNODE_", 1200L,
">").isVerified(rs));
             assertTrue("FNODE_ < 1200", new ConditionalClauseResolver("FNODE_", 1200L,
"<").isVerified(rs));
             assertFalse("FNODE_ >= 1200", new ConditionalClauseResolver("FNODE_", 1200L,
">=").isVerified(rs));
             assertTrue("FNODE_ <= 1200", new ConditionalClauseResolver("FNODE_", 1200L,
"<=").isVerified(rs));
-            
+
             assertTrue("ST_NAME = '36TH ST'", new ConditionalClauseResolver("ST_NAME", "'36TH
ST'", "=").isVerified(rs));
-            
+
             assertTrue("SHAPE_LEN = 43.0881492571", new ConditionalClauseResolver("SHAPE_LEN",
43.0881492571, "=").isVerified(rs));
             assertTrue("SHAPE_LEN > 43.088", new ConditionalClauseResolver("SHAPE_LEN",
43.088, ">").isVerified(rs));
             assertFalse("SHAPE_LEN < 43.0881492571", new ConditionalClauseResolver("SHAPE_LEN",
43.0881492571, "<").isVerified(rs));
         }
     }
-    
+
     /**
      * Test where conditions : field [operator] integer.
      * @throws SQLException if a trouble occurs : all tests shall pass.
@@ -55,7 +55,7 @@ public class WhereClauseTest extends Abs
     public void whereCondition_field_literal_int() throws SQLException {
         checkAndCount("FNODE_ < 2000", rs -> rs.getInt("FNODE_") < 2000, 3);
     }
-    
+
     /**
      * Test where conditions : field [operator] integer.
      * @throws SQLException if a trouble occurs : all tests shall pass.
@@ -82,12 +82,12 @@ public class WhereClauseTest extends Abs
     public void whereCondition_field_field() throws SQLException {
         checkAndCount("FNODE_ < TNODE_", rs -> rs.getInt("FNODE_") < rs.getInt("TNODE_"),
1);
     }
-    
-    /** 
-     * Trick suggested by AdiGuba (Forum des développeurs) to avoid the exception thrown
by ResultSet:getInt(), 
+
+    /**
+     * Trick suggested by AdiGuba (Forum des développeurs) to avoid the exception thrown
by ResultSet:getInt(),
      * unhandlable by a simple Predicate.
-     * @param <T> Type used. 
-     */ 
+     * @param <T> Type used.
+     */
     @FunctionalInterface
     public interface ResultSetPredicate<T> {
         /**
@@ -98,7 +98,7 @@ public class WhereClauseTest extends Abs
          */
         boolean test(T condition) throws SQLException;
     }
-    
+
     /**
      * Check that all records match the conditions and count them.
      * @param whereCondition The where condition to add to a "SELECT * FROM SignedBikeRoute
WHERE " statement.
@@ -108,15 +108,15 @@ public class WhereClauseTest extends Abs
      */
     private void checkAndCount(String whereCondition, ResultSetPredicate<ResultSet>
condition, int countExpected) throws SQLException {
         String sql = "SELECT * FROM SignedBikeRoute WHERE " + whereCondition;
-        
+
         try(Connection connection = connect(); Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(sql)) {
             int count = 0;
-            
+
             while(rs.next()) {
                 count ++;
                 assertTrue(sql, condition.test(rs));
             }
-            
+
             if (countExpected != -1)
                 assertEquals("Wrong number of records red by : " + sql, countExpected, count);
         }

Modified: sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java?rev=1651189&r1=1651188&r2=1651189&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java
[UTF-8] Mon Jan 12 20:26:33 2015
@@ -54,7 +54,7 @@ public final strictfp class ShapeFileTes
     @Test
     public void testPolyineCount() throws URISyntaxException, SQLException, InvalidShapefileFormatException
{
         ShapeFile shp = new ShapeFile(path("SignedBikeRoute_4326_clipped.shp"));
-        readAll(shp); 
+        readAll(shp);
     }
 
     /**
@@ -66,7 +66,7 @@ public final strictfp class ShapeFileTes
      @Test
      public void testPolygonCount() throws URISyntaxException, SQLException, InvalidShapefileFormatException
{
         ShapeFile shp = new ShapeFile(path("ANC90Ply_4326.shp"));
-        readAll(shp); 
+        readAll(shp);
     }
 
      /**
@@ -78,9 +78,9 @@ public final strictfp class ShapeFileTes
      @Test
      public void testPointCount() throws URISyntaxException, SQLException, InvalidShapefileFormatException
{
         ShapeFile shp = new ShapeFile(path("ABRALicenseePt_4326_clipped.shp"));
-        readAll(shp); 
+        readAll(shp);
      }
-     
+
     /**
      * Read all the shapefile content.
      * @param shp Shapefile to read.
@@ -90,7 +90,7 @@ public final strictfp class ShapeFileTes
     private void readAll(ShapeFile shp) throws SQLException, InvalidShapefileFormatException
{
         try(InputFeatureStream is = shp.findAll()) {
             Feature feature = is.readFeature();
-            
+
             while(feature != null) {
                 feature = is.readFeature();
             }



Mime
View raw message