jdk/test/javax/management/ObjectName/ValueWildcardTest.java
author rprotacio
Wed, 02 Mar 2016 15:10:38 -0500
changeset 36396 26a241a959de
parent 30376 2ccf2cf7ea48
child 44423 306c020eb154
permissions -rw-r--r--
8145098: JNI GetVersion should return JNI_VERSION_9 Summary: Updated JNI_VERSION for current version to be JNI_VERSION_9 Reviewed-by: hseigel, gtriantafill, dholmes, alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
30376
2ccf2cf7ea48 8078896: Add @modules as needed to the jdk_svc tests
ykantser
parents: 5506
diff changeset
     2
 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * @bug 4716807
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * @summary Test wildcards in ObjectName key properties value part.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * @author Luis-Miguel Alventosa
30376
2ccf2cf7ea48 8078896: Add @modules as needed to the jdk_svc tests
ykantser
parents: 5506
diff changeset
    29
 * @modules java.management
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * @run clean ValueWildcardTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * @run build ValueWildcardTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * @run main ValueWildcardTest
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.util.Hashtable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.management.ObjectName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
public class ValueWildcardTest {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    private static int createObjectName(int i,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
                                        String s,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
                                        String d,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
                                        String k,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
                                        String v,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
                                        Hashtable<String,String> t,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
                                        boolean plp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
                                        boolean pvp)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
        throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        System.out.println("----------------------------------------------");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
        switch (i) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        case 1:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
            System.out.println("ObjectName = " + s);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        case 2:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
            System.out.println("ObjectName.Domain = " + d);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            System.out.println("ObjectName.Key = " + k);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
            System.out.println("ObjectName.Value = " + v);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
        case 3:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
            System.out.println("ObjectName.Domain = " + d);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
            System.out.println("ObjectName.Hashtable = " + t);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
        default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
            throw new Exception("Test incorrect: case: " + i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        int error = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        ObjectName on = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            switch (i) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
            case 1:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                on = new ObjectName(s);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
            case 2:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
                on = new ObjectName(d, k, v);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
            case 3:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                on = new ObjectName(d, t);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
            default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                throw new Exception("Test incorrect: case: " + i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
            System.out.println("Got Expected ObjectName = " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                               on.getCanonicalName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            boolean isPattern = on.isPattern();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
            boolean isDomainPattern = on.isDomainPattern();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
            boolean isPropertyPattern = on.isPropertyPattern();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            boolean isPropertyListPattern = on.isPropertyListPattern();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
            boolean isPropertyValuePattern = on.isPropertyValuePattern();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            System.out.println("ObjectName.isPattern = " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                               isPattern);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            System.out.println("ObjectName.isDomainPattern = " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
                               isDomainPattern);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
            System.out.println("ObjectName.isPropertyPattern = " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
                               isPropertyPattern);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            System.out.println("ObjectName.isPropertyListPattern = " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
                               isPropertyListPattern);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            System.out.println("ObjectName.isPropertyValuePattern = " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                               isPropertyValuePattern);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
            int error2 = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            if (isDomainPattern) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                error2++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                System.out.println("Error: Shouldn't be domain pattern!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
            if (!plp && isPropertyListPattern) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                error2++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                System.out.println("Error: Shouldn't be property list pattern!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            if (!pvp && isPropertyValuePattern) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                error2++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                System.out.println("Error: Shouldn't be property value pattern!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            if (plp &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                !isPattern && !isPropertyPattern && !isPropertyListPattern) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                error2++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                System.out.println("Error: Should be property list pattern!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            if (pvp &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                !isPattern && !isPropertyPattern && !isPropertyValuePattern) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                error2++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                System.out.println("Error: Should be property value pattern!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
            if (error2 > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                error++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                System.out.println("Test failed!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                System.out.println("Test passed!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        } catch (Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            error++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
            System.out.println("Got Unexpected Exception = " + e.toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        System.out.println("----------------------------------------------");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        return error;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    private static int createObjectName1(String s,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
                                         boolean plp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                                         boolean pvp)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        return createObjectName(1, s, null, null, null, null, plp, pvp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    private static int createObjectName2(String d,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                                         String k,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                                         String v,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                                         boolean plp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                                         boolean pvp)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        return createObjectName(2, null, d, k, v, null, plp, pvp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    private static int createObjectName3(String d,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
                                         Hashtable<String,String> t,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
                                         boolean plp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                                         boolean pvp)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        return createObjectName(3, null, d, null, null, t, plp, pvp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    public static void main(String[] args) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        int error = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        error += createObjectName1("d:k=*", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        error += createObjectName1("d:k=a*b", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        error += createObjectName1("d:k=a*b,*", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        error += createObjectName1("d:*,k=a*b", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        error += createObjectName1("d:k=?", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        error += createObjectName1("d:k=a?b", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        error += createObjectName1("d:k=a?b,*", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        error += createObjectName1("d:*,k=a?b", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        error += createObjectName1("d:k=?*", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        error += createObjectName1("d:k=a?bc*d", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        error += createObjectName1("d:k=a?bc*d,*", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        error += createObjectName1("d:*,k=a?bc*d", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        error += createObjectName1("d:k1=?,k2=*", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        error += createObjectName1("d:k1=a?b,k2=c*d", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        error += createObjectName1("d:k1=a?b,k2=c*d,*", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        error += createObjectName1("d:*,k1=a?b,k2=c*d", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        error += createObjectName1("d:k=\"*\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        error += createObjectName1("d:k=\"a*b\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        error += createObjectName1("d:k=\"a*b\",*", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        error += createObjectName1("d:*,k=\"a*b\"", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        error += createObjectName1("d:k=\"?\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        error += createObjectName1("d:k=\"a?b\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        error += createObjectName1("d:k=\"a?b\",*", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        error += createObjectName1("d:*,k=\"a?b\"", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        error += createObjectName1("d:k=\"?*\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        error += createObjectName1("d:k=\"a?bc*d\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        error += createObjectName1("d:k=\"a?bc*d\",*", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        error += createObjectName1("d:*,k=\"a?bc*d\"", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        error += createObjectName1("d:k1=\"?\",k2=\"*\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        error += createObjectName1("d:k1=\"a?b\",k2=\"c*d\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        error += createObjectName1("d:k1=\"a?b\",k2=\"c*d\",*", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        error += createObjectName1("d:*,k1=\"a?b\",k2=\"c*d\"", true, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        error += createObjectName2("d", "k", "*", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        error += createObjectName2("d", "k", "a*b", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        error += createObjectName2("d", "k", "?", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        error += createObjectName2("d", "k", "a?b", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        error += createObjectName2("d", "k", "?*", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        error += createObjectName2("d", "k", "a?bc*d", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        error += createObjectName2("d", "k", "\"*\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        error += createObjectName2("d", "k", "\"a*b\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        error += createObjectName2("d", "k", "\"?\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        error += createObjectName2("d", "k", "\"a?b\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        error += createObjectName2("d", "k", "\"?*\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        error += createObjectName2("d", "k", "\"a?bc*d\"", false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        Hashtable<String,String> h1 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        h1.put("k", "*");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        error += createObjectName3("d", h1, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        Hashtable<String,String> h2 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        h2.put("k", "a*b");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        error += createObjectName3("d", h2, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        Hashtable<String,String> h3 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        h3.put("k", "?");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
        error += createObjectName3("d", h3, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        Hashtable<String,String> h4 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        h4.put("k", "a?b");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        error += createObjectName3("d", h4, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        Hashtable<String,String> h5 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        h5.put("k", "?*");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        error += createObjectName3("d", h5, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        Hashtable<String,String> h6 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        h6.put("k", "a?bc*d");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        error += createObjectName3("d", h6, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        Hashtable<String,String> h7 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        h7.put("k1", "?");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        h7.put("k2", "*");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        error += createObjectName3("d", h7, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        Hashtable<String,String> h8 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        h8.put("k1", "a?b");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        h8.put("k2", "c*d");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
        error += createObjectName3("d", h8, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        Hashtable<String,String> h9 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        h9.put("k", "\"*\"");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        error += createObjectName3("d", h9, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        Hashtable<String,String> h10 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        h10.put("k", "\"a*b\"");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        error += createObjectName3("d", h10, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        Hashtable<String,String> h11 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
        h11.put("k", "\"?\"");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        error += createObjectName3("d", h11, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
        Hashtable<String,String> h12 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        h12.put("k", "\"a?b\"");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
        error += createObjectName3("d", h12, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        Hashtable<String,String> h13 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
        h13.put("k", "\"?*\"");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        error += createObjectName3("d", h13, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
        Hashtable<String,String> h14 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
        h14.put("k", "\"a?bc*d\"");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
        error += createObjectName3("d", h14, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
        Hashtable<String,String> h15 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
        h15.put("k1", "\"?\"");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        h15.put("k2", "\"*\"");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        error += createObjectName3("d", h15, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        Hashtable<String,String> h16 = new Hashtable<String,String>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
        h16.put("k1", "\"a?b\"");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        h16.put("k2", "\"c*d\"");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        error += createObjectName3("d", h16, false, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
        if (error > 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
            final String msg = "Test FAILED! Got " + error + " error(s)";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
            System.out.println(msg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
            throw new IllegalArgumentException(msg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
            System.out.println("Test PASSED!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
}