jdk/test/javax/sql/testng/util/StubArray.java
author sundar
Mon, 16 May 2016 14:50:43 +0530
changeset 37951 ce2744a0f1a7
parent 24497 d51dff0b4aaf
permissions -rw-r--r--
8156914: jlink API minor cleanups Reviewed-by: mchung
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24497
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
     1
/*
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
     4
 *
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
     8
 *
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    13
 * accompanied this code).
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    14
 *
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    18
 *
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    21
 * questions.
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    22
 */
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    23
package util;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    24
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    25
import java.sql.Array;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    26
import java.sql.JDBCType;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    27
import java.sql.ResultSet;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    28
import java.sql.SQLException;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    29
import java.util.Arrays;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    30
import java.util.Map;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    31
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    32
public class StubArray implements Array {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    33
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    34
    private String typeName;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    35
    Object[] elements;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    36
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    37
    public StubArray(String name, Object[] values) {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    38
        typeName = name;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    39
        elements = Arrays.copyOf(values, values.length);
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    40
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    41
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    42
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    43
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    44
    public String getBaseTypeName() throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    45
        return typeName;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    46
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    47
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    48
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    49
    public int getBaseType() throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    50
        return JDBCType.valueOf(typeName).getVendorTypeNumber();
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    51
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    52
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    53
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    54
    public Object getArray() throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    55
        return Arrays.copyOf(elements, elements.length);
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    56
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    57
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    58
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    59
    public Object getArray(Map<String, Class<?>> map) throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    60
        return getArray();
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    61
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    62
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    63
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    64
    public Object getArray(long index, int count) throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    65
        return getArray();
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    66
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    67
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    68
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    69
    public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    70
        return getArray();
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    71
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    72
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    73
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    74
    public ResultSet getResultSet() throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    75
        throw new UnsupportedOperationException("Not supported yet.");
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    76
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    77
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    78
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    79
    public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    80
        throw new UnsupportedOperationException("Not supported yet.");
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    81
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    82
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    83
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    84
    public ResultSet getResultSet(long index, int count) throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    85
        throw new UnsupportedOperationException("Not supported yet.");
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    86
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    87
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    88
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    89
    public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    90
        throw new UnsupportedOperationException("Not supported yet.");
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    91
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    92
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    93
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    94
    public void free() throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    95
        elements = null;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    96
        typeName = null;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    97
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    98
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    99
}