Author: pnedonosko
Date: 2009-11-10 07:07:26 -0500 (Tue, 10 Nov 2009)
New Revision: 546
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/SimpleNodeReadTest.java
Log:
EXOJCR-199: simple test on JCR core
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/SimpleNodeReadTest.java
===================================================================
---
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/SimpleNodeReadTest.java
(rev 0)
+++
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/SimpleNodeReadTest.java 2009-11-10
12:07:26 UTC (rev 546)
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.storage.jbosscache;
+
+import org.exoplatform.services.jcr.JcrImplBaseTest;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.Value;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 10.11.2009
+ *
+ * @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter
Nedonosko</a>
+ * @version $Id$
+ */
+public class SimpleNodeReadTest extends JcrImplBaseTest
+{
+
+ public void testReadRootNode() throws Exception
+ {
+ Node root = session.getRootNode();
+
+ log.info(session.getWorkspace().getName() + " " + root.getPath());
+ log.info("Properties: ");
+ try
+ {
+ for (PropertyIterator pi = root.getProperties(); pi.hasNext();)
+ {
+ Property p = pi.nextProperty();
+ String values = "";
+ if (p.getDefinition().isMultiple())
+ {
+ for (Value v : p.getValues())
+ {
+ values += v.getString() + " ";
+ }
+ }
+ else
+ {
+ values += p.getString();
+ }
+ log.info(p.getPath() + " : " + values);
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Error: ", e);
+ }
+
+ log.info("Child nodes: ");
+ try
+ {
+ for (NodeIterator ni = root.getNodes(); ni.hasNext();)
+ {
+ Node n = ni.nextNode();
+ log.info(n.getPath() + " : " + n.getPrimaryNodeType().getName());
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Error: ", e);
+ }
+ }
+
+}
Property changes on:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/SimpleNodeReadTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id