1 package com.openedit.archive; 2 3 import java.io.ByteArrayOutputStream ; 4 import java.io.File ; 5 6 import com.openedit.OpenEditException; 7 import com.openedit.WebPageRequest; 8 import com.openedit.util.FileUtils; 9 10 public class ConvertDocumentGeneratorTest extends ArchiveTest 11 { 12 boolean wrote = false; 13 public ConvertDocumentGeneratorTest( String inName ) 14 { 15 super( inName ); 16 } 17 18 22 public void testConvertToEPS() throws OpenEditException 23 { 24 String path = "/testcatalog/downloads/converted/copysheetai123456789/copysheet.eps"; 25 WebPageRequest request = getFixture().createPageRequest( path ); 26 wrote = false; 27 ByteArrayOutputStream out = new ByteArrayOutputStream () 29 { 30 public synchronized void write(byte[] b, int off, int len) {wrote = true;}; 31 public void write(byte[] b) throws java.io.IOException {wrote = true;}; 32 public synchronized void write(int b) {wrote = true;}; 33 }; 34 request.putPageValue("out",out); 35 getFixture().getModuleManager().executePathActions( request.getPage(), request ); 36 38 44 } 45 46 protected void setUp() throws Exception 47 { 48 File etc = new File ( getStore().getRootDirectory().getParentFile(),"etc"); 49 FileUtils util = new FileUtils(); 51 File export = new File (etc,"/export.cre"); 52 File out = new File (getStore().getRootDirectory(),"/upload/export.cre"); 53 util.copyFiles(export,out); 54 File input = new File ( etc, "archivefiles"); 55 File output = new File ( "/tmp/archivefiles"); 56 util.dirCopy(input,output); 57 } 58 59 60 } 61 | Popular Tags |