999N/A/*
2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
999N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
999N/A *
999N/A * This code is free software; you can redistribute it and/or modify it
999N/A * under the terms of the GNU General Public License version 2 only, as
999N/A * published by the Free Software Foundation.
999N/A *
999N/A * This code is distributed in the hope that it will be useful, but WITHOUT
999N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
999N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
999N/A * version 2 for more details (a copy is included in the LICENSE file that
999N/A * accompanied this code).
999N/A *
999N/A * You should have received a copy of the GNU General Public License version
999N/A * 2 along with this work; if not, write to the Free Software Foundation,
999N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
999N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
999N/A */
999N/A
999N/A/* @test
999N/A * @summary Pass if no RuntimeException.
999N/A * @bug 6812600
999N/A */
999N/Aimport java.awt.*;
999N/Aimport java.awt.image.BufferedImage;
999N/A
999N/Apublic class JoinMiterTest {
999N/A
999N/A public static void main(String[] args) throws Exception {
999N/A BufferedImage image = new BufferedImage(200, 200,
999N/ABufferedImage.TYPE_INT_RGB);
999N/A Graphics2D g = image.createGraphics();
999N/A g.setPaint(Color.WHITE);
999N/A g.fill(new Rectangle(image.getWidth(), image.getHeight()));
999N/A g.translate(25, 100);
999N/A g.setPaint(Color.BLACK);
999N/A g.setStroke(new BasicStroke(20, BasicStroke.CAP_BUTT,
999N/A BasicStroke.JOIN_MITER));
999N/A g.draw(new Polygon(new int[] {0, 150, 0}, new int[] {75, 0, -75}, 3));
999N/A if (image.getRGB(16, 10) == Color.WHITE.getRGB()) {
999N/A throw new RuntimeException("Miter is not rendered.");
999N/A }
999N/A }
999N/A}