1 /* 2 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 @test 26 @bug 6397684 27 @summary PASS if no VM crash. 28 @run main NullGetName 29 */ 30 31 32 import javax.print.*; 33 import javax.print.attribute.*; 34 import javax.print.event.*; 35 import java.awt.print.*; 36 37 38 public class NullGetName { 39 main(String[] args)40 public static void main(String[] args) { 41 PrinterJob printerJob = PrinterJob.getPrinterJob(); 42 try { 43 printerJob.setPrintService(new ImagePrintService()); 44 } catch (PrinterException e) { 45 } 46 } 47 } 48 49 50 class ImagePrintService implements PrintService { 51 52 getSupportedAttributeCategories()53 public Class[] getSupportedAttributeCategories() { 54 // TODO Auto-generated method stub 55 return null; 56 } 57 isAttributeCategorySupported(Class category)58 public boolean isAttributeCategorySupported(Class category) { 59 // TODO Auto-generated method stub 60 return false; 61 } 62 getName()63 public String getName() { 64 // TODO Auto-generated method stub 65 return null; 66 } 67 getSupportedDocFlavors()68 public DocFlavor[] getSupportedDocFlavors() { 69 // TODO Auto-generated method stub 70 return null; 71 } 72 73 isDocFlavorSupported(DocFlavor flavor)74 public boolean isDocFlavorSupported(DocFlavor flavor) { 75 if(DocFlavor.SERVICE_FORMATTED.PAGEABLE.equals(flavor)) 76 return true; 77 if(DocFlavor.SERVICE_FORMATTED.PRINTABLE.equals(flavor)) 78 return true; 79 return false; 80 } 81 createPrintJob()82 public DocPrintJob createPrintJob() { 83 // TODO Auto-generated method stub 84 return null; 85 } 86 getServiceUIFactory()87 public ServiceUIFactory getServiceUIFactory() { 88 // TODO Auto-generated method stub 89 return null; 90 } 91 92 getAttributes()93 public PrintServiceAttributeSet getAttributes() { 94 // TODO Auto-generated method stub 95 return null; 96 } 97 addPrintServiceAttributeListener( PrintServiceAttributeListener listener)98 public void addPrintServiceAttributeListener( 99 PrintServiceAttributeListener listener) { 100 // TODO Auto-generated method stub 101 102 } 103 removePrintServiceAttributeListener( PrintServiceAttributeListener listener)104 public void removePrintServiceAttributeListener( 105 PrintServiceAttributeListener listener) { 106 // TODO Auto-generated method stub 107 108 } 109 getDefaultAttributeValue(Class category)110 public Object getDefaultAttributeValue(Class category) { 111 // TODO Auto-generated method stub 112 return null; 113 } 114 115 public <T extends PrintServiceAttribute> T getAttribute(Class<T> category)116 getAttribute(Class<T> category) { 117 // TODO Auto-generated method stub 118 return null; 119 } 120 isAttributeValueSupported(Attribute attrval, DocFlavor flavor, AttributeSet attributes)121 public boolean isAttributeValueSupported(Attribute attrval, 122 DocFlavor flavor, AttributeSet attributes) { 123 // TODO Auto-generated method stub 124 return false; 125 } 126 getUnsupportedAttributes(DocFlavor flavor, AttributeSet attributes)127 public AttributeSet getUnsupportedAttributes(DocFlavor flavor, 128 AttributeSet attributes) { 129 // TODO Auto-generated method stub 130 return null; 131 } 132 getSupportedAttributeValues(Class category, DocFlavor flavor, AttributeSet attributes)133 public Object getSupportedAttributeValues(Class category, DocFlavor flavor, 134 AttributeSet attributes) { 135 // TODO Auto-generated method stub 136 return null; 137 } 138 139 } 140