001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: *
017: */
018:
019: /* $Id: RCMLTest.java 564507 2007-08-10 08:33:31Z andreas $ */
020:
021: package org.apache.lenya.cms.rc;
022:
023: import java.io.PrintWriter;
024:
025: import org.w3c.dom.Document;
026: import org.apache.lenya.ac.impl.AbstractAccessControlTest;
027: import org.apache.lenya.xml.DocumentHelper;
028:
029: /**
030: * RCML Test
031: */
032: public class RCMLTest extends AbstractAccessControlTest {
033:
034: /**
035: * <code>co</code> Checkout
036: */
037: public static final short co = 0;
038: /**
039: * <code>ci</code> Checkin
040: */
041: public static final short ci = 1;
042:
043: private Document document = null;
044:
045: /**
046: * Constructor.
047: * @param test The test to execute.
048: */
049: public RCMLTest() {
050: super ();
051: }
052:
053: public void testRCML() {
054: String[] args = { "", "", "" };
055: testRCML(args);
056: }
057:
058: public void testRCML(String[] args) {
059:
060: if (args.length != 1) {
061: System.out
062: .println("Usage: java RCML rcmlDirectory datafilename rootDirectory");
063:
064: return;
065: }
066:
067: try {
068: org.apache.lenya.cms.publication.Document doc = null;
069: doc.getRepositoryNode().checkout();
070:
071: (new PrintWriter(System.out)).print(this .document);
072:
073: System.out.println("\n");
074:
075: if (doc.getRepositoryNode().isCheckedOut()) {
076: System.out.println("Checked out");
077: } else {
078: System.out.println("Not checked out");
079: }
080: } catch (Exception e) {
081: System.out.println(e);
082: }
083: }
084:
085: /* protected static final Class[] classes = {
086: };
087:
088: /**
089: * Creates a test suite.
090: * @return a test suite.
091: */
092: /* public static Test getSuite() {
093: TestSuite suite = new TestSuite();
094:
095: for (int i = 0; i < classes.length; i++) {
096: suite.addTestSuite(classes[i]);
097: }
098:
099: return suite;
100: }
101: */
102: /** @see junit.framework.TestCase#setUp() */
103: protected void setUp() throws Exception {
104: /**
105: * initialise the RCML-document. Delete all entries
106: */
107: this .document = DocumentHelper.createDocument(null,
108: "XPSRevisionControl", null);
109: }
110: }
|