1 17 18 19 20 package org.apache.lenya.cms.rc; 21 22 import java.io.FileNotFoundException ; 23 import java.io.IOException ; 24 25 import junit.framework.TestCase; 26 27 public class RevisionControllerTest extends TestCase { 28 32 public RevisionControllerTest(String test) { 33 super(test); 34 } 35 36 40 public static void main(String [] args) { 41 43 if (args.length != 4) { 44 System.out.println( 45 "Usage: " 46 + new RevisionController().getClass().getName() 47 + " username(user who checkout) source(filename without the rootDirectory of the document to checkout) username(user who checkin) destination(filename without the rootDirectory of document to checkin)"); 48 49 return; 50 } 51 52 String identityS = args[0]; 53 String source = args[1]; 54 String identityD = args[2]; 55 String destination = args[3]; 56 RevisionController rc = new RevisionController(); 57 try { 58 rc.reservedCheckOut(source, identityS); 59 } catch (FileNotFoundException e) { 61 System.out.println(e.toString()); 62 } catch (FileReservedCheckOutException e) { 64 System.out.println(e.toString()); 65 return; 67 68 } catch (IOException e) { System.out.println(e.toString()); 70 return; 71 72 } catch (Exception e) { 73 System.out.println(e.toString()); 74 return; 75 } 76 77 try { 78 rc.reservedCheckIn(destination, identityD, true); 79 } catch (FileReservedCheckInException e) { 80 System.out.println(e.toString()); 81 } catch (Exception e) { 82 System.out.println(e.toString()); 83 } 84 } 85 86 93 103 104 protected void setUp() throws Exception {} 105 } 106 | Popular Tags |