Skip to content

Commit

Permalink
2.4: Merged revisions 1225525, 1225528, 1226452, 1226472 and 1226515 (J…
Browse files Browse the repository at this point in the history
…CR-3177)

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/branches/2.4@1232456 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jukka committed Jan 17, 2012
1 parent 5a09eb4 commit 8d5cddf
Show file tree
Hide file tree
Showing 21 changed files with 95 additions and 24 deletions.
Expand Up @@ -1119,13 +1119,11 @@ private class AttributeSeparator {
private static final String xmlnsURI = "http://www.w3.org/2000/xmlns/";
private static final String xmlnsPrefix = "xmlns";

Element elem;
NamedNodeMap attrs;
Map<String, String> nsAttrs;
Map<String, String> nonNsAttrs;

AttributeSeparator(Element elem) {
this.elem = elem;
nsAttrs = new HashMap<String, String>();
nonNsAttrs = new HashMap<String, String>();
attrs = elem.getAttributes();
Expand Down
Expand Up @@ -1446,7 +1446,7 @@ private static Node[] getSharedSet(Node n) throws RepositoryException {
* @return node array
*/
private static Node[] toArray(NodeIterator iter) {
ArrayList list = new ArrayList();
List<Node> list = new ArrayList<Node>();

while (iter.hasNext()) {
list.add(iter.nextNode());
Expand Down
Expand Up @@ -17,8 +17,6 @@
package org.apache.jackrabbit.test.api.lock;

import org.apache.jackrabbit.test.NotExecutableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.jcr.Node;
import javax.jcr.RepositoryException;
Expand All @@ -28,8 +26,6 @@
/** <code>DeepLockTest</code>... */
public class DeepLockTest extends AbstractLockTest {

private static Logger log = LoggerFactory.getLogger(DeepLockTest.class);

protected boolean isSessionScoped() {
return true;
}
Expand Down
Expand Up @@ -30,14 +30,10 @@

import org.apache.jackrabbit.test.AbstractJCRTest;
import org.apache.jackrabbit.test.NotExecutableException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** <code>LockManagerTest</code>... */
public class LockManagerTest extends AbstractJCRTest {

private static Logger log = LoggerFactory.getLogger(LockManagerTest.class);

protected LockManager lockMgr;
protected Node testNode;
protected String testPath;
Expand Down
Expand Up @@ -16,14 +16,9 @@
*/
package org.apache.jackrabbit.test.api.lock;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** <code>OpenScopedLockTest</code>... */
public class OpenScopedLockTest extends AbstractLockTest {

private static Logger log = LoggerFactory.getLogger(OpenScopedLockTest.class);

protected boolean isSessionScoped() {
return false;
}
Expand Down
Expand Up @@ -16,8 +16,6 @@
*/
package org.apache.jackrabbit.test.api.lock;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.jackrabbit.test.NotExecutableException;

import javax.jcr.RepositoryException;
Expand All @@ -30,8 +28,6 @@
/** <code>SessionScopedLockTest</code>... */
public class SessionScopedLockTest extends AbstractLockTest {

private static Logger log = LoggerFactory.getLogger(SessionScopedLockTest.class);

protected boolean isSessionScoped() {
return true;
}
Expand Down
Expand Up @@ -219,7 +219,6 @@ private void assertNoEffect(Node target, String childName, String propName) thro
}

private void assertNoEffect(Property target) throws RepositoryException {
Session s = target.getSession();
target.setValue("test3");
target.remove();
}
Expand Down
Expand Up @@ -403,13 +403,11 @@ public void testHoldGetName2() throws RepositoryException, NotExecutableExceptio
}

public void testHoldIsDeep() throws RepositoryException, NotExecutableException {
String holdName = getHoldName();
Hold h = retentionMgr.addHold(testNodePath, getHoldName(), false);
assertEquals("Hold.isDeep() must reflect the specified flag.", false, h.isDeep());
}

public void testHoldIsDeep2() throws RepositoryException, NotExecutableException {
String holdName = getHoldName();
Hold h = retentionMgr.addHold(testNodePath, getHoldName(), true);
assertEquals("Hold.isDeep() must reflect the specified flag.", true, h.isDeep());
}
Expand Down
Expand Up @@ -164,7 +164,6 @@ private void assertNoEffect(Node target, String childName, String propName) thro
}

private void assertNoEffect(Property target) throws RepositoryException {
Session s = target.getSession();
target.setValue("test3");
target.remove();
}
Expand Down
Expand Up @@ -47,6 +47,7 @@ protected void setUp() throws Exception {
*
* @throws javax.jcr.RepositoryException
*/
@SuppressWarnings("deprecation")
public void testIsCheckedOut() throws RepositoryException {
versionableNode.checkin();
assertTrue("After calling Node.checkin() on a versionable node N, N.isCheckedOut() must return false", versionableNode.isCheckedOut() == false);
Expand All @@ -71,6 +72,7 @@ public void testIsCheckedOutJcr2() throws RepositoryException {
*
* @throws RepositoryException
*/
@SuppressWarnings("deprecation")
public void testCheckinRemovesPredecessorProperty() throws RepositoryException {

versionableNode.checkin();
Expand Down Expand Up @@ -101,6 +103,7 @@ public void testCheckinRemovesPredecessorPropertyJcr2() throws RepositoryExcepti
*
* @throws RepositoryException
*/
@SuppressWarnings("deprecation")
public void testPredecessorIsCopiedToNewVersion() throws RepositoryException {

Value[] nPredecessorsValue = versionableNode.getProperty(jcrPredecessors).getValues();
Expand Down Expand Up @@ -134,6 +137,7 @@ public void testPredecessorIsCopiedToNewVersionJcr2() throws RepositoryException
*
* @throws RepositoryException
*/
@SuppressWarnings("deprecation")
public void testMultipleCheckinHasNoEffect() throws RepositoryException {

Version v = versionableNode.checkin();
Expand Down Expand Up @@ -172,6 +176,7 @@ public void testMultipleCheckinHasNoEffectJcr2() throws RepositoryException {
*
* @throws RepositoryException
*/
@SuppressWarnings("deprecation")
public void testBaseVersionAfterCheckin() throws RepositoryException {
Version v = versionableNode.checkin();
Value baseVersionRef = versionableNode.getProperty(jcrBaseVersion).getValue();
Expand Down Expand Up @@ -200,6 +205,7 @@ public void testBaseVersionAfterCheckinJcr2() throws RepositoryException {
*
* @throws RepositoryException
*/
@SuppressWarnings("deprecation")
public void testCheckinWithPendingChanges() throws RepositoryException {
try {
// modify node without calling save()
Expand Down Expand Up @@ -237,6 +243,7 @@ public void testCheckinWithPendingChangesJcr2() throws RepositoryException {
*
* @throws RepositoryException
*/
@SuppressWarnings("deprecation")
public void testIsNotCheckedOut() throws RepositoryException {
versionableNode.checkin();
boolean isCheckedOut = versionableNode.isCheckedOut();
Expand All @@ -263,6 +270,7 @@ public void testIsNotCheckedOutJcr2() throws RepositoryException {
*
* @throws RepositoryException
*/
@SuppressWarnings("deprecation")
public void testCheckinCreatesNewVersion() throws RepositoryException {

long initialNumberOfVersions = getNumberOfVersions(versionableNode.getVersionHistory());
Expand Down Expand Up @@ -293,6 +301,7 @@ public void testCheckinCreatesNewVersionJcr2() throws RepositoryException {
*
* @throws RepositoryException
*/
@SuppressWarnings("deprecation")
public void testCheckinNonVersionableNode() throws RepositoryException {
try {
nonVersionableNode.checkin();
Expand Down
Expand Up @@ -52,6 +52,7 @@ protected void setUp() throws Exception {
* Test if Node.isCheckedOut() returns true, if the versionable node has
* been checked out before.
*/
@SuppressWarnings("deprecation")
public void testIsCheckedOut() throws RepositoryException {
versionableNode.checkout();
assertTrue("After calling Node.checkout() a versionable node N, N.isCheckedOut() must return true.", versionableNode.isCheckedOut());
Expand Down Expand Up @@ -127,6 +128,7 @@ public void testIsCheckedOutNonVersionableNodeJcr2() throws RepositoryException
/**
* Test calling Node.checkout() on a non-versionable node.
*/
@SuppressWarnings("deprecation")
public void testCheckoutNonVersionableNode() throws RepositoryException {
try {
nonVersionableNode.checkout();
Expand Down Expand Up @@ -155,6 +157,7 @@ public void testCheckoutNonVersionableNodeJcr2() throws RepositoryException {
* Test if Node.checkout() doesn't throw any exception if the versionable
* node has been checked out before.
*/
@SuppressWarnings("deprecation")
public void testCheckoutTwiceDoesNotThrow() throws RepositoryException {
versionableNode.checkout();
versionableNode.checkout();
Expand All @@ -176,6 +179,7 @@ public void testCheckoutTwiceDoesNotThrowJcr2() throws RepositoryException {
* Test if Node.checkout() copies the node's jcr:baseVersion to node's
* jcr:predecessors property (no save required).
*/
@SuppressWarnings("deprecation")
public void testCheckoutCopiesBaseValueToPredecessorProperty() throws RepositoryException {
Value baseVersionValue = versionableNode.getProperty(jcrBaseVersion).getValue();
versionableNode.checkout();
Expand Down
Expand Up @@ -58,6 +58,7 @@ protected void tearDown() throws Exception {
* the jcr:mergeFailed property of N. <br> without adding it to
* jcr:predecessors.<br> Branches will not be joined.<br>
*/
@SuppressWarnings("deprecation")
public void testMergeNodeCancelMerge() throws RepositoryException {
// create 2 independent versions for a node and its corresponding node
// so merge fails for this node
Expand Down
Expand Up @@ -67,6 +67,7 @@ protected void tearDown() throws Exception {
* Node.merge(): InvalidItemStateException if unsaved changes within the
* current Session<br>
*/
@SuppressWarnings("deprecation")
public void testMergeNodeWithUnsavedStates() throws RepositoryException {
// set a property and do not save workspace
nodeToMerge.setProperty(propertyName1, CHANGED_STRING);
Expand Down Expand Up @@ -97,6 +98,7 @@ public void testMergeNodeWithUnsavedStatesJcr2() throws RepositoryException {
/**
* Perform a merge on a node with a unkwnown workspacename
*/
@SuppressWarnings("deprecation")
public void testMergeUnknownWorkspaceName() throws RepositoryException {
try {
nodeToMerge.merge(getNonExistingWorkspaceName(superuser), false);
Expand All @@ -122,6 +124,7 @@ public void testMergeUnknownWorkspaceNameJcr2() throws RepositoryException {
* indicated workspace <br> then the merge method returns quietly and no
* changes are made.<br>
*/
@SuppressWarnings("deprecation")
public void testMergeNodeNonCorrespondingNode() throws RepositoryException {
// create new node - this node has no corresponding node in default workspace
Node subNode = nodeToMerge.addNode(nodeName3, versionableNodeType);
Expand Down Expand Up @@ -156,6 +159,7 @@ public void testMergeNodeNonCorrespondingNodeJcr2() throws RepositoryException {
* successor of, predecessor of, nor identical with V', then the merge
* result for N is failed<br>
*/
@SuppressWarnings("deprecation")
public void testMergeNodeVersionAmbiguous() throws RepositoryException {
// create 2 independent versions for a node and its corresponding node
// so merge fails for this node
Expand Down Expand Up @@ -215,6 +219,7 @@ public void testMergeNodeVersionAmbiguousJcr2() throws RepositoryException {
* Node.merge(): bestEffort is true > any merge-failure (represented by the
* version in the workspace) is reported in the jcrMergeFailed property<br>
*/
@SuppressWarnings("deprecation")
public void testMergeNodeBestEffortTrueCheckMergeFailedProperty() throws RepositoryException {
// create 2 independent versions for a node and its corresponding node
// so merge fails for this node
Expand Down Expand Up @@ -298,6 +303,7 @@ public void testMergeNodeBestEffortTrueCheckMergeFailedPropertyJcr2() throws Rep
/**
* if mergeFailedProperty is present > VersionException<br>
*/
@SuppressWarnings("deprecation")
public void disable_testMergeNodeForceFailure() throws RepositoryException {
// create 2 independent versions for a node and its corresponding node
// so merge fails for this node
Expand Down Expand Up @@ -359,6 +365,7 @@ public void disable_testMergeNodeForceFailureJcr2() throws RepositoryException {
* Node.merge(): bestEffort is false and any merge fails a MergeException is
* thrown.<br>
*/
@SuppressWarnings("deprecation")
public void testMergeNodeBestEffortFalse() throws RepositoryException {
/// create successor versions for a node
// so merge fails for this node
Expand Down Expand Up @@ -409,6 +416,7 @@ public void testMergeNodeBestEffortFalseJcr2() throws RepositoryException {
* versionable node is encountered whose corresponding node's base version
* is on a divergent branch from this node's base version.
*/
@SuppressWarnings("deprecation")
public void testMergeNodeBestEffortFalseAmbiguousVersions() throws RepositoryException {
/// create 2 independent base versions for a node and its corresponding node
// so merge fails for this node
Expand Down Expand Up @@ -471,6 +479,7 @@ public void testMergeNodeBestEffortFalseAmbiguousVersionsJcr2() throws Repositor
* locked node.
* @throws NotExecutableException if repository does not support locking.
*/
@SuppressWarnings("deprecation")
public void disable_testMergeLocked()
throws NotExecutableException, RepositoryException {

Expand Down
Expand Up @@ -58,6 +58,7 @@ protected void tearDown() throws Exception {
* update, then the subnode N is removed<br> retrieve the initialised node
* to perform operations we need before for this test<br>
*/
@SuppressWarnings("deprecation")
public void disable_testRemoveNodeFromSourceWorkspaceAndMergeWithUpdate() throws RepositoryException {
// status 'update' for parent
nodeToMerge.checkin();
Expand Down Expand Up @@ -123,6 +124,7 @@ public void disable_testRemoveNodeFromSourceWorkspaceAndMergeWithUpdateJcr2() th
* on the workspace1 and then merge the one in workspace2 with the one in
* workspace1 precondition is that the node in workspace2 is checked in
*/
@SuppressWarnings("deprecation")
public void disable_testMergeNodeFromUpdatedSourceWorkspace() throws RepositoryException {
Node originalNode = testRootNode.getNode(nodeName1);

Expand Down Expand Up @@ -179,6 +181,7 @@ public void disable_testMergeNodeFromUpdatedSourceWorkspaceJcr2() throws Reposit
* workspace1<br> the node in workspace2 should be updated<br> precondition
* is that the node in workspace2 is checked in
*/
@SuppressWarnings("deprecation")
public void testMergeNodeFromOlderSourceWorkspace() throws RepositoryException {
// touch the version on workspace2
nodeToMerge.checkin();
Expand Down Expand Up @@ -223,6 +226,7 @@ public void testMergeNodeFromOlderSourceWorkspaceJcr2() throws RepositoryExcepti
* Node.merge(): bestEffort is true > (sub)node which could not be merged
* are not affected.<br>
*/
@SuppressWarnings("deprecation")
public void disable_testMergeNodeBestEffortTrue() throws RepositoryException {
// create 2 new nodes with two independent versions
// so merge fails for this node
Expand Down Expand Up @@ -301,6 +305,7 @@ public void disable_testMergeNodeBestEffortTrueJcr2() throws RepositoryException
* node,<br> a merge test is performed comparing N with its corresponding
* node in workspace, N'.<br>
*/
@SuppressWarnings("deprecation")
public void disable_testMergeNodeSubNodesMergeTest() throws RepositoryException {
//setCheckProperty(nodeToMerge);
nodeToMerge.checkout();
Expand Down
Expand Up @@ -54,6 +54,7 @@ public void testRestoreProp() throws RepositoryException {
*
* @throws javax.jcr.RepositoryException
*/
@SuppressWarnings("deprecation")
public void testRestoreNode() throws RepositoryException {
// prepare for node test
Node childNode = addChildNode(OPVAction);
Expand Down

0 comments on commit 8d5cddf

Please sign in to comment.