KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > test > cms > stress > TestDirCommand


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.test.cms.stress;
10
11 import org.jboss.portal.cms.NodeFactory;
12 import org.jboss.portal.cms.NodeException;
13 import org.jboss.portal.cms.Node;
14 import org.jboss.portal.cms.Content;
15
16 /**
17  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
18  * @version $Revision: 1.1 $
19  */

20 public class TestDirCommand extends Command
21 {
22
23    private String JavaDoc uri;
24
25    public TestDirCommand(String JavaDoc uri)
26    {
27       this.uri = uri;
28    }
29
30    public void execute(Client.Result result, NodeFactory factory) throws NodeException
31    {
32       Node node = factory.getNode(uri);
33       result.assertTrue(node.exists(), uri + " does not exists");
34       result.assertTrue(node.isDir(), uri + " is not a dir");
35    }
36
37    protected String JavaDoc describe()
38    {
39       return "[testdir," + uri + "]";
40    }
41 }
42
Popular Tags