01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18:
19: /* $Id: RevisionControllerTest.java 588618 2007-10-26 12:10:30Z andreas $ */
20:
21: package org.apache.lenya.cms.rc;
22:
23: import org.apache.lenya.ac.impl.AbstractAccessControlTest;
24: import org.apache.lenya.cms.publication.Document;
25: import org.apache.lenya.cms.publication.DocumentManager;
26: import org.apache.lenya.cms.repository.RepositoryException;
27:
28: /**
29: * Revision Controller test
30: */
31: public class RevisionControllerTest extends AbstractAccessControlTest {
32:
33: /**
34: * @see <a
35: * href="http://issues.apache.org/bugzilla/show_bug.cgi?id=41005">Bug
36: * 41005</a>
37: * @throws Exception
38: */
39: public void testCheckIn() throws Exception {
40: login("lenya");
41:
42: DocumentManager docMgr = null;
43: try {
44: docMgr = (DocumentManager) getManager().lookup(
45: DocumentManager.ROLE);
46: Document source = getPublication("test").getArea(
47: "authoring").getSite().getNode("/links").getLink(
48: "en").getDocument();
49: Document target = docMgr.addVersion(source, "authoring",
50: "es");
51: target.delete();
52: } finally {
53: if (docMgr != null) {
54: getManager().release(docMgr);
55: }
56: }
57:
58: getFactory().getSession().commit();
59: }
60:
61: public void testRevisionController() throws RepositoryException,
62: RevisionControlException {
63:
64: String[] args = { "", "", "", "" };
65:
66: // TestRunner.run(getSuite());
67:
68: if (args.length != 4) {
69: System.out
70: .println("Usage: "
71: + RevisionControllerTest.class.getName()
72: + " 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)");
73:
74: return;
75: }
76:
77: Document doc1 = null;
78: Document doc2 = null;
79:
80: String identityS = args[0];
81: String source = args[1];
82: String identityD = args[2];
83: String destination = args[3];
84: //doc1.getRepositoryNode().checkout();
85: //doc2.getRepositoryNode().checkin();
86: }
87:
88: }
|