コード例 #1
0
 @Override
 public void doFinish(TestCase tc, JCRTestContext context) throws Exception {
   super.doFinish(tc, context);
   // clear all children
   registryService.getRegistry(sessionProvider).getNode().remove();
   context.getSession().save();
 }
コード例 #2
0
 /**
  * Creates content in registry on doPrepare() phase. Used for read, update, delete tests.
  *
  * @param tc
  * @param context
  * @throws Exception
  */
 protected void createContent(TestCase tc, JCRTestContext context) throws Exception {
   // create content
   RegistryEntry registryEntry = RegistryEntry.parse(GENERIC_ENTRY.getBytes());
   // create list of user names and add generic entry to each user
   for (int i = 0; i <= sumIterations; i++) {
     String name = context.generateUniqueName("username");
     addUser(name);
     registryService.createEntry(
         sessionProvider, RegistryService.EXO_USERS + "/" + name, registryEntry);
   }
 }
コード例 #3
0
 @Override
 public void doRun(TestCase tc, JCRTestContext context) throws Exception {
   context.getSession().getItem(absPath);
 }
コード例 #4
0
 @Override
 public void doPrepare(TestCase tc, JCRTestContext context) throws Exception {
   absPath = context.getSession().getRootNode().addNode("testNode").getPath();
   context.getSession().save();
 }
コード例 #5
0
 @Override
 protected void createContent(Node parent, TestCase tc, JCRTestContext context) throws Exception {
   value = context.getSession().getValueFactory().createValue("testValue");
   Property property = parent.setProperty(context.generateUniqueName("testProperty"), value);
   addProperty(property);
 }