1 17 18 19 20 package org.apache.lenya.cms.rc; 21 22 import java.io.File ; 23 import java.io.PrintWriter ; 24 import java.util.Date ; 25 26 import junit.framework.TestCase; 27 28 import org.apache.lenya.xml.DOMParserFactory; 29 import org.apache.lenya.xml.DOMWriter; 30 import org.w3c.dom.Document ; 31 import org.w3c.dom.Element ; 32 33 public class RCMLTest extends TestCase { 34 35 public static final short co = 0; 36 public static final short ci = 1; 37 38 private File rcmlFile; 39 private Document document = null; 40 private boolean dirty = false; 41 private int maximalNumberOfEntries = 5; 42 43 47 public RCMLTest(String test) { 48 super(test); 49 } 50 51 55 public void main(String [] args) { 56 58 59 if (args.length != 1) { 60 System.out.println("Usage: java RCML rcmlDirectory datafilename rootDirectory"); 61 62 return; 63 } 64 65 try { 66 RCML rcml = new RCML(args[0], args[1], args[2]); 67 rcml.checkOutIn(RCML.co, "michi", new Date ().getTime(), false); 68 69 new DOMWriter(new PrintWriter (System.out)).print(this.document); 70 71 CheckOutEntry coe = rcml.getLatestCheckOutEntry(); 72 System.out.println("\n"); 73 74 if (coe == null) { 75 System.out.println("Not checked out"); 76 } else { 77 System.out.println("Checked out: " + coe.getIdentity() + " " + coe.getTime()); 78 } 79 } catch (Exception e) { 80 System.out.println(e); 81 } 82 } 83 84 91 101 102 protected void setUp() throws Exception { 103 106 DOMParserFactory dpf = new DOMParserFactory(); 107 document = dpf.getDocument(); 108 109 Element root = dpf.newElementNode(document, "XPSRevisionControl"); 110 document.appendChild(root); 111 112 } 113 } 114 | Popular Tags |