Skip to content

Commit cfdd50d

Browse files
committed
Polish whitespace
1 parent e3136e6 commit cfdd50d

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

org.springframework.jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void testDefaultInstanceWithNoSuchDatabase() {
4545
assertTrue(sec.getBadSqlGrammarCodes().length == 0);
4646
assertTrue(sec.getDataIntegrityViolationCodes().length == 0);
4747
}
48-
48+
4949
/**
5050
* Check that a known database produces recognizable codes.
5151
*/
@@ -62,7 +62,7 @@ private void assertIsOracle(SQLErrorCodes sec) {
6262
// This had better NOT be
6363
assertFalse(Arrays.binarySearch(sec.getBadSqlGrammarCodes(), "9xx42") >= 0);
6464
}
65-
65+
6666
private void assertIsHsql(SQLErrorCodes sec) {
6767
assertTrue(sec.getBadSqlGrammarCodes().length > 0);
6868
assertTrue(sec.getDataIntegrityViolationCodes().length > 0);
@@ -75,12 +75,12 @@ private void assertIsHsql(SQLErrorCodes sec) {
7575
private void assertIsDB2(SQLErrorCodes sec) {
7676
assertTrue(sec.getBadSqlGrammarCodes().length > 0);
7777
assertTrue(sec.getDataIntegrityViolationCodes().length > 0);
78-
78+
7979
assertFalse(Arrays.binarySearch(sec.getBadSqlGrammarCodes(), "942") >= 0);
8080
// This had better NOT be
8181
assertTrue(Arrays.binarySearch(sec.getBadSqlGrammarCodes(), "-204") >= 0);
8282
}
83-
83+
8484
public void testLookupOrder() {
8585
class TestSQLErrorCodesFactory extends SQLErrorCodesFactory {
8686
private int lookups = 0;
@@ -98,13 +98,13 @@ protected Resource loadResource(String path) {
9898
}
9999
}
100100
}
101-
101+
102102
// Should have failed to load without error
103103
TestSQLErrorCodesFactory sf = new TestSQLErrorCodesFactory();
104104
assertTrue(sf.getErrorCodes("XX").getBadSqlGrammarCodes().length == 0);
105105
assertTrue(sf.getErrorCodes("Oracle").getDataIntegrityViolationCodes().length == 0);
106106
}
107-
107+
108108
/**
109109
* Check that user defined error codes take precedence.
110110
*/
@@ -117,15 +117,15 @@ protected Resource loadResource(String path) {
117117
return null;
118118
}
119119
}
120-
120+
121121
// Should have loaded without error
122122
TestSQLErrorCodesFactory sf = new TestSQLErrorCodesFactory();
123123
assertTrue(sf.getErrorCodes("XX").getBadSqlGrammarCodes().length == 0);
124124
assertEquals(2, sf.getErrorCodes("Oracle").getBadSqlGrammarCodes().length);
125125
assertEquals("1", sf.getErrorCodes("Oracle").getBadSqlGrammarCodes()[0]);
126126
assertEquals("2", sf.getErrorCodes("Oracle").getBadSqlGrammarCodes()[1]);
127127
}
128-
128+
129129
public void testInvalidUserDefinedCodeFormat() {
130130
class TestSQLErrorCodesFactory extends SQLErrorCodesFactory {
131131
protected Resource loadResource(String path) {
@@ -142,7 +142,7 @@ protected Resource loadResource(String path) {
142142
assertTrue(sf.getErrorCodes("XX").getBadSqlGrammarCodes().length == 0);
143143
assertEquals(0, sf.getErrorCodes("Oracle").getBadSqlGrammarCodes().length);
144144
}
145-
145+
146146
/**
147147
* Check that custom error codes take precedence.
148148
*/
@@ -155,7 +155,7 @@ protected Resource loadResource(String path) {
155155
return null;
156156
}
157157
}
158-
158+
159159
// Should have loaded without error
160160
TestSQLErrorCodesFactory sf = new TestSQLErrorCodesFactory();
161161
assertEquals(1, sf.getErrorCodes("Oracle").getCustomTranslations().length);
@@ -164,9 +164,9 @@ protected Resource loadResource(String path) {
164164
assertEquals(CustomErrorCodeException.class, translation.getExceptionClass());
165165
assertEquals(1, translation.getErrorCodes().length);
166166
}
167-
167+
168168
public void testDataSourceWithNullMetadata() throws Exception {
169-
169+
170170
MockControl ctrlConnection = MockControl.createControl(Connection.class);
171171
Connection mockConnection = (Connection) ctrlConnection.getMock();
172172
mockConnection.getMetaData();
@@ -180,16 +180,16 @@ public void testDataSourceWithNullMetadata() throws Exception {
180180
mockDataSource.getConnection();
181181
ctrlDataSource.setDefaultReturnValue(mockConnection);
182182
ctrlDataSource.replay();
183-
183+
184184
SQLErrorCodes sec = SQLErrorCodesFactory.getInstance().getErrorCodes(mockDataSource);
185185
assertIsEmpty(sec);
186-
186+
187187
ctrlConnection.verify();
188188
ctrlDataSource.verify();
189189
}
190-
190+
191191
public void testGetFromDataSourceWithSQLException() throws Exception {
192-
192+
193193
SQLException expectedSQLException = new SQLException();
194194

195195
MockControl ctrlDataSource = MockControl.createControl(DataSource.class);
@@ -216,7 +216,7 @@ private SQLErrorCodes getErrorCodesFromDataSource(String productName, SQLErrorCo
216216
md.getDatabaseProductName();
217217
mdControl.setReturnValue(productName);
218218
mdControl.replay();
219-
219+
220220
MockControl ctrlConnection = MockControl.createControl(Connection.class);
221221
Connection mockConnection = (Connection) ctrlConnection.getMock();
222222
mockConnection.getMetaData();
@@ -250,12 +250,12 @@ private SQLErrorCodes getErrorCodesFromDataSource(String productName, SQLErrorCo
250250

251251
return sec;
252252
}
253-
253+
254254
public void testOracleRecognizedFromMetadata() throws Exception {
255255
SQLErrorCodes sec = getErrorCodesFromDataSource("Oracle", null);
256256
assertIsOracle(sec);
257257
}
258-
258+
259259
public void testHsqlRecognizedFromMetadata() throws Exception {
260260
SQLErrorCodes sec = getErrorCodesFromDataSource("HSQL Database Engine", null);
261261
assertIsHsql(sec);
@@ -282,13 +282,13 @@ protected Resource loadResource(String path) {
282282
return null;
283283
}
284284
}
285-
285+
286286
WildcardSQLErrorCodesFactory factory = new WildcardSQLErrorCodesFactory();
287287
SQLErrorCodes sec = getErrorCodesFromDataSource("DB2", factory);
288288
assertIsDB2(sec);
289289
sec = getErrorCodesFromDataSource("DB2 UDB for Xxxxx", factory);
290290
assertIsDB2(sec);
291-
291+
292292
sec = getErrorCodesFromDataSource("DB3", factory);
293293
assertIsDB2(sec);
294294
sec = getErrorCodesFromDataSource("DB3/", factory);

0 commit comments

Comments
 (0)