X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fext%2Ftest%2Forg%2Fargeo%2Fcms%2Ftabular%2FJcrTabularTest.java;h=c1ca4c4b8254e1bc7f852cbb616ba4e2923b308b;hb=4b0f656244f364957088bc4dbcfb0c0f692fdc69;hp=112562c3fd68f0f061f83a1d41bf47f3f6d43cda;hpb=d21cbc30de1e4d8d9ae64f237b3c81ec31a26353;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/ext/test/org/argeo/cms/tabular/JcrTabularTest.java b/org.argeo.cms/ext/test/org/argeo/cms/tabular/JcrTabularTest.java index 112562c3f..c1ca4c4b8 100644 --- a/org.argeo.cms/ext/test/org/argeo/cms/tabular/JcrTabularTest.java +++ b/org.argeo.cms/ext/test/org/argeo/cms/tabular/JcrTabularTest.java @@ -25,7 +25,6 @@ import javax.jcr.PropertyType; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.jackrabbit.commons.cnd.CndImporter; -import org.argeo.cms.ArgeoNames; import org.argeo.cms.ArgeoTypes; import org.argeo.jackrabbit.unit.AbstractJackrabbitTestCase; import org.argeo.node.tabular.TabularColumn; @@ -37,13 +36,11 @@ public class JcrTabularTest extends AbstractJackrabbitTestCase { private final static Log log = LogFactory.getLog(JcrTabularTest.class); public void testWriteReadCsv() throws Exception { - session().setNamespacePrefix("argeo", ArgeoNames.ARGEO_NAMESPACE); - InputStreamReader reader = new InputStreamReader(getClass() - .getResourceAsStream("/org/argeo/node/node.cnd")); + // session().setNamespacePrefix("argeo", ArgeoNames.ARGEO_NAMESPACE); + InputStreamReader reader = new InputStreamReader(getClass().getResourceAsStream("/org/argeo/node/node.cnd")); CndImporter.registerNodeTypes(reader, session()); reader.close(); - reader = new InputStreamReader(getClass() - .getResourceAsStream("/org/argeo/cms/cms.cnd")); + reader = new InputStreamReader(getClass().getResourceAsStream("/org/argeo/cms/cms.cnd")); CndImporter.registerNodeTypes(reader, session()); reader.close(); @@ -56,10 +53,8 @@ public class JcrTabularTest extends AbstractJackrabbitTestCase { for (int i = 0; i < columnCount; i++) { header.add(new TabularColumn("col" + i, PropertyType.STRING)); } - Node tableNode = session().getRootNode().addNode("table", - ArgeoTypes.ARGEO_TABLE); - TabularWriter writer = new JcrTabularWriter(tableNode, header, - ArgeoTypes.ARGEO_CSV); + Node tableNode = session().getRootNode().addNode("table", ArgeoTypes.ARGEO_TABLE); + TabularWriter writer = new JcrTabularWriter(tableNode, header, ArgeoTypes.ARGEO_CSV); for (int i = 0; i < rowCount; i++) { List objs = new ArrayList(); for (int j = 0; j < columnCount; j++) { @@ -71,8 +66,7 @@ public class JcrTabularTest extends AbstractJackrabbitTestCase { session().save(); if (log.isDebugEnabled()) - log.debug("Wrote tabular content " + rowCount + " rows, " - + columnCount + " columns"); + log.debug("Wrote tabular content " + rowCount + " rows, " + columnCount + " columns"); // read TabularRowIterator rowIt = new JcrTabularRowIterator(tableNode); Long count = 0l; @@ -83,7 +77,6 @@ public class JcrTabularTest extends AbstractJackrabbitTestCase { } assertEquals(rowCount, count); if (log.isDebugEnabled()) - log.debug("Read tabular content " + rowCount + " rows, " - + columnCount + " columns"); + log.debug("Read tabular content " + rowCount + " rows, " + columnCount + " columns"); } }