jdk/test/javax/sql/testng/util/StubStruct.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.SQLException;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    26
import java.sql.Struct;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    27
import java.util.Arrays;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    28
import java.util.Map;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    29
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    30
public class StubStruct implements Struct {
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
    private final String type;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    33
    private final Object[] attribs;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    34
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    35
    public StubStruct(String type, Object[] o) {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    36
        this.type = type;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    37
        this.attribs = Arrays.copyOf(o, o.length);
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    38
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    39
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    40
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    41
    public String getSQLTypeName() throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    42
        return type;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    43
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    44
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    45
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    46
    public Object[] getAttributes() throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    47
        return attribs;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    48
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    49
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    50
    @Override
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    51
    public Object[] getAttributes(Map<String, Class<?>> map) throws SQLException {
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    52
        return attribs;
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    53
    }
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    54
d51dff0b4aaf 8043278: Add initial unit tests for javax.sql.rowset.serial
lancea
parents:
diff changeset
    55
}