1 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 20 public class TestContentCommand extends Command 21 { 22 23 private String uri; 24 private String s; 25 26 public TestContentCommand(String uri, String s) 27 { 28 this.uri = uri; 29 this.s = s; 30 } 31 32 public void execute(Client.Result result, NodeFactory factory) throws NodeException 33 { 34 Node node = factory.getNode(uri); 35 result.assertTrue(node.exists(), uri + " does not exists"); 36 result.assertFalse(node.isDir(), uri + " is a dir"); 37 Content content = node.getContent(); 38 String s = new String (content.getBytes()); 39 result.assertTrue(this.s.equals(s), this.s + " != " + s); 40 } 41 42 protected String describe() 43 { 44 return "[testcontent," + uri + "," + s + "]"; 45 } 46 } 47 | Popular Tags |