View Javadoc
1   /*
2    *    Copyright 2009-2022 the original author or authors.
3    *
4    *    Licensed under the Apache License, Version 2.0 (the "License");
5    *    you may not use this file except in compliance with the License.
6    *    You may obtain a copy of the License at
7    *
8    *       https://www.apache.org/licenses/LICENSE-2.0
9    *
10   *    Unless required by applicable law or agreed to in writing, software
11   *    distributed under the License is distributed on an "AS IS" BASIS,
12   *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *    See the License for the specific language governing permissions and
14   *    limitations under the License.
15   */
16  package org.apache.ibatis.type;
17  
18  import java.sql.CallableStatement;
19  import java.sql.PreparedStatement;
20  import java.sql.ResultSet;
21  import java.sql.ResultSetMetaData;
22  
23  import org.junit.jupiter.api.extension.ExtendWith;
24  import org.mockito.Mock;
25  import org.mockito.junit.jupiter.MockitoExtension;
26  
27  @ExtendWith(MockitoExtension.class)
28  abstract class BaseTypeHandlerTest {
29  
30    @Mock
31    protected ResultSet rs;
32    @Mock
33    protected PreparedStatement ps;
34    @Mock
35    protected CallableStatement cs;
36    @Mock
37    protected ResultSetMetaData rsmd;
38  
39    public abstract void shouldSetParameter() throws Exception;
40  
41    public abstract void shouldGetResultFromResultSetByName() throws Exception;
42  
43    public abstract void shouldGetResultNullFromResultSetByName() throws Exception;
44  
45    public abstract void shouldGetResultFromResultSetByPosition() throws Exception;
46  
47    public abstract void shouldGetResultNullFromResultSetByPosition() throws Exception;
48  
49    public abstract void shouldGetResultFromCallableStatement() throws Exception;
50  
51    public abstract void shouldGetResultNullFromCallableStatement() throws Exception;
52  }