Enum1.java revision 0
2830N/A/*
2830N/A * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
2830N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2830N/A *
2830N/A * This code is free software; you can redistribute it and/or modify it
2830N/A * under the terms of the GNU General Public License version 2 only, as
2830N/A * published by the Free Software Foundation.
2830N/A *
2830N/A * This code is distributed in the hope that it will be useful, but WITHOUT
2830N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2830N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2830N/A * version 2 for more details (a copy is included in the LICENSE file that
2830N/A * accompanied this code).
2830N/A *
2830N/A * You should have received a copy of the GNU General Public License version
2830N/A * 2 along with this work; if not, write to the Free Software Foundation,
2830N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2830N/A *
2830N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
2830N/A * CA 95054 USA or visit www.sun.com if you need additional information or
2830N/A * have any questions.
2830N/A */
2830N/A
2830N/A/*
2830N/A * @test
2830N/A * @bug 4945532
2830N/A * @summary enums: test output of values().toString()
2830N/A * @author gafter
2830N/A *
2830N/A * @compile -source 1.5 Enum1.java
2830N/A * @run main Enum1
2830N/A */
2830N/A
2830N/Aimport java.util.*;
2830N/A
2830N/Apublic enum Enum1 {
2830N/A red, green, blue;
2830N/A
2830N/A public static void main(String[] args) {
2830N/A if (!Arrays.asList(values()).toString().equals("[red, green, blue]"))
2830N/A throw new Error();
2830N/A }
2830N/A}
2830N/A