You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2005/04/29 12:33:02 UTC
svn commit: r165290 - in
/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api:
ExportDocViewTest.java SysViewContentHandler.java TreeComparator.java
Author: stefan
Date: Fri Apr 29 03:33:00 2005
New Revision: 165290
URL: http://svn.apache.org/viewcvs?rev=165290&view=rev
Log:
adapting testcases to latest spec (0.16.4.1)
Modified:
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ExportDocViewTest.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SysViewContentHandler.java
incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/TreeComparator.java
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ExportDocViewTest.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ExportDocViewTest.java?rev=165290&r1=165289&r2=165290&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ExportDocViewTest.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/ExportDocViewTest.java Fri Apr 29 03:33:00 2005
@@ -434,8 +434,9 @@
boolean isBinary = (prop.getType() == PropertyType.BINARY);
if (skipBinary) {
if (isBinary) {
- assertEquals("Binary property " + prop.getPath() +
- " exported although skipBinary is true", attribute, null);
+ assertEquals("Value of binary property " + prop.getPath() +
+ " exported although skipBinary is true",
+ attribute.getValue().length(), 0);
}
// check the flags
else {
@@ -553,8 +554,16 @@
}
}
}
- assertEquals("Value of property " + prop.getPath() +
- " is not exported correctly: ", val, attrVal);
+ if (isBinary && skipBinary) {
+ assertEquals("Value of binary property " + prop.getPath() +
+ " is not exported correctly: ", "", attrVal);
+ assertEquals("Value of binary property " + prop.getPath() +
+ " exported although skipBinary is true",
+ "", attrVal);
+ } else {
+ assertEquals("Value of property " + prop.getPath() +
+ " is not exported correctly: ", val, attrVal);
+ }
}
/**
@@ -631,15 +640,12 @@
while (iter.hasNext()) {
Property prop = iter.nextProperty();
String name = prop.getName();
- boolean isBinary = prop.getType() == PropertyType.BINARY;
boolean isMultiple = prop.getDefinition().isMultiple();
// props not exported so we decrease the expected size.
if (!exportInvalidXmlNames && !XMLChar.isValidName(name)) {
size--;
} else if (!exportMultivalProps && isMultiple) {
- size--;
- } else if (skipBinary && isBinary) {
size--;
}
}
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SysViewContentHandler.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SysViewContentHandler.java?rev=165290&r1=165289&r2=165290&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SysViewContentHandler.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/SysViewContentHandler.java Fri Apr 29 03:33:00 2005
@@ -421,7 +421,6 @@
boolean correctVal = false;
Node node = nodeElem.node;
ArrayList propElems = nodeElem.propElems;
- long binaryCounter = 0;
// no props exported
if (propElems.size() == 0) {
@@ -528,8 +527,9 @@
}
// skipBinary true and propType is Binary, should be skipped
else {
- checkCondition("Binary property "+ prop.getPath()
- + " exported although skipBinary flag is true.", false);
+ checkCondition("Value of binary property "+ prop.getPath()
+ + " exported although skipBinary flag is true.",
+ propElem.values.isEmpty());
}
}
// given node has no property with the name given by the prop element
@@ -540,17 +540,8 @@
}
}
// compare the sizes here
- if (skipBinary) {
- PropertyIterator propIter = node.getProperties();
- while (propIter.hasNext()) {
- if (propIter.nextProperty().getType() == PropertyType.BINARY) {
- binaryCounter++;
- }
- }
- }
-
long otherSize = getSize(node.getProperties());
- allFound = (propElems.size() + binaryCounter == otherSize);
+ allFound = propElems.size() == otherSize;
checkCondition("Not all properties of node " +
nodeElem.path + " are exported.", allFound);
}
Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/TreeComparator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/TreeComparator.java?rev=165290&r1=165289&r2=165290&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/TreeComparator.java (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/TreeComparator.java Fri Apr 29 03:33:00 2005
@@ -428,23 +428,14 @@
if (!propertySkipped(pName)) {
try {
pb = b.getProperty(pName);
- //fail if the property is there but should not be
- if (skipBinary && pType == PropertyType.BINARY) {
- // todo
- fail("Property '" + pPath + "' must not be available if skipBinary=true.");
- }
-
} catch (RepositoryException e) {
//fail if the property is not there but should
- if (!(skipBinary && pType == PropertyType.BINARY)) {
- // todo
- fail("Property '" + pPath + "' not available: " + e);
- fail("Property '" + pPath + "' not available: " + e);
- }
+ fail("Property '" + pPath + "' not available: " + e);
}
- //if the property should be available and is available, then compare source and target value
if (!(skipBinary && pType == PropertyType.BINARY)) {
+ // todo
+ // compare source and target value
compareProperties(pa, pb);
}
}