1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 // Common Qetest / Xalan testing imports 19 import org.apache.qetest.Datalet; 20 import org.apache.qetest.Logger; 21 import org.apache.qetest.TestletImpl; 22 23 // REPLACE_imports needed for reproducing the bug 24 25 26 /** 27 * Testlet for reproducing Bugzilla reported bugs. 28 * 29 * INSTRUCTIONS: 30 * <ul>Given your Bugzilla bugnumber: 31 * <li>Save this file under a different name like 32 * Bugzilla<i>bugnumber</li> and search-and-replace 33 * 'NNNN' to your Bugzilla bugnumber</li> 34 * <li>Search-and-replace all REPLACE_* strings with something appropriate</li> 35 * <li>javac BugzillaNNNN.java</li> 36 * <li>java BugzillaNNNN</li> 37 * <li>Attach the .java file to your Bugzilla report (or, checkin 38 * to xml-xalan/test/tests/Bugzilla if committer)</li> 39 * </ul> 40 * Using this common format may allow us in the future to automate 41 * verifying Bugzilla bugs to prevent regressions! 42 * @author REPLACE_your_email_address 43 */ 44 public class BugzillaNNNN extends TestletImpl 45 { 46 // Initialize our classname for TestletImpl's main() method - must be updated! 47 static { thisClassName = "BugzillaNNNN"; } 48 49 /** 50 * Write Minimal code to reproduce your Bugzilla bug report. 51 * Many Bugzilla tests won't bother with a datalet; they'll 52 * just have the data to reproduce the bug encoded by default. 53 * @param d (optional) Datalet to use as data point for the test. 54 */ execute(Datalet d)55 public void execute(Datalet d) 56 { 57 // Use logger.logMsg(...) instead of System.out.println(...) 58 logger.logMsg(Logger.STATUSMSG, "Reproducing Bugzilla#NNNN"); 59 60 // Optional: use the Datalet d if supplied 61 62 // Call code to reproduce the bug here 63 64 // Call logger.checkFail("desc") (like Junit's assert(true, "desc") 65 // or logger.checkPass("desc") (like Junit's assert(false, "desc") 66 // to report the actual bug fail/pass status 67 } 68 69 /** 70 * <a href="http://nagoya.apache.org/bugzilla/show_bug.cgi?id=NNNN"> 71 * Link to Bugzilla report</a> 72 * @return REPLACE_BugzillaNNNN_description. 73 */ getDescription()74 public String getDescription() 75 { 76 return "REPLACE_BugzillaNNNN_description"; 77 } 78 79 } // end of class BugzillaNNNN 80 81