1*cdf0e10cSrcweir /* 2*cdf0e10cSrcweir * ************************************************************************ 3*cdf0e10cSrcweir * 4*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5*cdf0e10cSrcweir * 6*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 7*cdf0e10cSrcweir * 8*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 9*cdf0e10cSrcweir * 10*cdf0e10cSrcweir * This file is part of OpenOffice.org. 11*cdf0e10cSrcweir * 12*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 13*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 14*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 15*cdf0e10cSrcweir * 16*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 17*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 18*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 20*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 21*cdf0e10cSrcweir * 22*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 23*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 24*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 25*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 26*cdf0e10cSrcweir * 27*cdf0e10cSrcweir * *********************************************************************** 28*cdf0e10cSrcweir */ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir package graphical; 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir 33*cdf0e10cSrcweir /** 34*cdf0e10cSrcweir * 35*cdf0e10cSrcweir * @author ll93751 36*cdf0e10cSrcweir */ 37*cdf0e10cSrcweir public class PostscriptCreator extends EnhancedComplexTestCase 38*cdf0e10cSrcweir { 39*cdf0e10cSrcweir 40*cdf0e10cSrcweir // @Override 41*cdf0e10cSrcweir public String[] getTestMethodNames() 42*cdf0e10cSrcweir { 43*cdf0e10cSrcweir return new String[]{"DocumentToPostscript"}; 44*cdf0e10cSrcweir } 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir /** 47*cdf0e10cSrcweir * test function. 48*cdf0e10cSrcweir */ 49*cdf0e10cSrcweir public void DocumentToPostscript() 50*cdf0e10cSrcweir { 51*cdf0e10cSrcweir GlobalLogWriter.set(log); 52*cdf0e10cSrcweir ParameterHelper aParam = new ParameterHelper(param); 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir param.put(util.PropertyName.OFFICE_CLOSE_TIME_OUT, 2000); 55*cdf0e10cSrcweir // run through all documents found in Inputpath 56*cdf0e10cSrcweir foreachDocumentinInputPath(aParam); 57*cdf0e10cSrcweir } 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir public void checkOneFile(String _sDocumentName, String _sResult, ParameterHelper _aParams) throws OfficeException 61*cdf0e10cSrcweir { 62*cdf0e10cSrcweir GlobalLogWriter.println(" Document: " + _sDocumentName); 63*cdf0e10cSrcweir GlobalLogWriter.println(" results: " + _sResult); 64*cdf0e10cSrcweir IOffice aOffice = new Office(_aParams, _sResult); 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir PerformanceContainer a = new PerformanceContainer(); 67*cdf0e10cSrcweir a.startTime(PerformanceContainer.AllTime); 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir // _aParams.getTestParameters().put(util.PropertyName.DEBUG_IS_ACTIVE, Boolean.TRUE); 70*cdf0e10cSrcweir a.startTime(PerformanceContainer.OfficeStart); 71*cdf0e10cSrcweir aOffice.start(); 72*cdf0e10cSrcweir a.stopTime(PerformanceContainer.OfficeStart); 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir // _aParams.getTestParameters().put(util.PropertyName.DEBUG_IS_ACTIVE, Boolean.FALSE); 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir // This force an error! _sDocumentName = helper.StringHelper.doubleQuote(_sDocumentName); 77*cdf0e10cSrcweir try 78*cdf0e10cSrcweir { 79*cdf0e10cSrcweir a.startTime(PerformanceContainer.Load); 80*cdf0e10cSrcweir aOffice.load(_sDocumentName); 81*cdf0e10cSrcweir a.stopTime(PerformanceContainer.Load); 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir a.startTime(PerformanceContainer.Print); 84*cdf0e10cSrcweir aOffice.storeAsPostscript(); 85*cdf0e10cSrcweir a.stopTime(PerformanceContainer.Print); 86*cdf0e10cSrcweir } 87*cdf0e10cSrcweir finally 88*cdf0e10cSrcweir { 89*cdf0e10cSrcweir a.startTime(PerformanceContainer.OfficeStop); 90*cdf0e10cSrcweir aOffice.close(); 91*cdf0e10cSrcweir a.stopTime(PerformanceContainer.OfficeStop); 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir a.stopTime(PerformanceContainer.AllTime); 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir a.print( System.out ); 96*cdf0e10cSrcweir } 97*cdf0e10cSrcweir } 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir // public static void main(String [] _args) 103*cdf0e10cSrcweir // { 104*cdf0e10cSrcweir // String args[] = { 105*cdf0e10cSrcweir // "-TimeOut", "3600000", 106*cdf0e10cSrcweir // "-tb", "java_complex", 107*cdf0e10cSrcweir // "-o", "graphical.PostscriptCreator", 108*cdf0e10cSrcweir //// "-DOC_COMPARATOR_INPUT_PATH", "D:\\temp\\input", 109*cdf0e10cSrcweir //// "-DOC_COMPARATOR_OUTPUT_PATH", "D:\\temp\\output", 110*cdf0e10cSrcweir //// "-DOC_COMPARATOR_REFERENCE_PATH", "D:\\temp\\output\\ref", 111*cdf0e10cSrcweir //// "-DOC_COMPARATOR_PRINT_MAX_PAGE", "9999", 112*cdf0e10cSrcweir //// "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION", "180", 113*cdf0e10cSrcweir //// "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX", "http://so-gfxcmp-lin.germany.sun.com/gfxcmp_ui/cw.php?inifile=", 114*cdf0e10cSrcweir ////// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "PDF", /* default: "OOo" */ 115*cdf0e10cSrcweir ////// "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE", "msoffice", /* default: "OOo" */ 116*cdf0e10cSrcweir ////// "-OFFICE_VIEWABLE", "false", 117*cdf0e10cSrcweir //// "-AppExecutionCommand", "\"C:/home/ll93751/staroffice9_DEV300_m25/Sun/StarOffice 9/program/soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;", 118*cdf0e10cSrcweir ////// "-NoOffice" 119*cdf0e10cSrcweir // "-DOC_COMPARATOR_PRINT_MAX_PAGE","9999", 120*cdf0e10cSrcweir // "-DOC_COMPARATOR_GFX_OUTPUT_DPI_RESOLUTION","180", 121*cdf0e10cSrcweir // "-DOC_COMPARATOR_HTML_OUTPUT_PREFIX","http://so-gfxcmp.germany.sun.com/gfxcmp_ui/cw.php?inifile=", 122*cdf0e10cSrcweir // "-DOC_COMPARATOR_REFERENCE_CREATOR_TYPE","OOo", 123*cdf0e10cSrcweir // "-DOC_COMPARATOR_DB_INFO_STRING","p:DEV300_m18,c:,d:LLA_test,src:DEV300_m18,dest:,doc:LLA_test,id:34715,distinct:2008-06-27_13-39-09_d6f22d4c-958d-10", 124*cdf0e10cSrcweir // "-DISTINCT","2008-06-27_13-39-09_d6f22d4c-958d-10", 125*cdf0e10cSrcweir // "-TEMPPATH","//so-gfxcmp-lin/gfxcmp-data/wntmsci/temp/2008-06-27_13-39-09_d6f22d4c-958d-10/34715", 126*cdf0e10cSrcweir //// "ConnectionString","socket,host=localhost,port=8101", 127*cdf0e10cSrcweir // "-OFFICE_VIEWABLE","true", 128*cdf0e10cSrcweir // "-wntmsci.DOC_COMPARATOR_INPUT_PATH","\\\\so-gfxcmp-lin\\doc-pool\\LLA_test\\issue_79214.odb", 129*cdf0e10cSrcweir // "-wntmsci.DOC_COMPARATOR_OUTPUT_PATH","\\\\so-gfxcmp-lin\\gfxcmp-data\\wntmsci\\convwatch-output\\LLA_test\\DEV300_m11", 130*cdf0e10cSrcweir // "-wntmsci.AppExecutionCommand","\"C:\\gfxcmp\\programs\\staroffice8_DEV300_m11\\Sun\\StarOffice 9\\program\\soffice.exe\" -norestore -nocrashreport -accept=pipe,name=ll93751;urp;", 131*cdf0e10cSrcweir // "-wntmsci.AppKillCommand","\"C:\\bin\\pskill.exe soffice.bin;C:\\bin\\pskill.exe winword;C:\\bin\\pskill.exe excel\"", 132*cdf0e10cSrcweir // 133*cdf0e10cSrcweir // }; 134*cdf0e10cSrcweir // 135*cdf0e10cSrcweir // org.openoffice.Runner.main(args); 136*cdf0e10cSrcweir // } 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir } 139