jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1214236 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version: MergeNodeIteratorTest.java RemoveVersionTest.java RestoreTest.java VersionHistoryTest.java VersionLabelTest.java VersionTest.java
Date Wed, 14 Dec 2011 13:26:56 GMT
Author: reschke
Date: Wed Dec 14 13:26:55 2011
New Revision: 1214236

URL: http://svn.apache.org/viewvc?rev=1214236&view=rev
Log:
JCR-3177: Remove jdk 1.4 restriction for jcr-tests

Reduce warning noise on version tests

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeNodeIteratorTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionLabelTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeNodeIteratorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeNodeIteratorTest.java?rev=1214236&r1=1214235&r2=1214236&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeNodeIteratorTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeNodeIteratorTest.java
Wed Dec 14 13:26:55 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.test.api.version;
 
+import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.Node;
 import javax.jcr.version.VersionManager;
@@ -53,11 +54,11 @@ public class MergeNodeIteratorTest exten
 
         Node nodeToMerge = testRootNodeW2.getNode(nodeName1);
 
-        Iterator failedNodes = nodeToMerge.merge(workspace.getName(), true);
+        NodeIterator failedNodes1 = nodeToMerge.merge(workspace.getName(), true);
 
-        List nodeList = new ArrayList();
-        while (failedNodes.hasNext()) {
-            nodeList.add(failedNodes.next());
+        List<Node> nodeList = new ArrayList<Node>();
+        while (failedNodes1.hasNext()) {
+            nodeList.add(failedNodes1.nextNode());
         }
 
         assertEquals("Node.merge() does not return a NodeIterator with " +
@@ -66,10 +67,10 @@ public class MergeNodeIteratorTest exten
                 nodeList.size());
 
         // re-aquire iterator, has been consumed to get size
-        failedNodes = nodeList.iterator();
+        Iterator<Node> failedNodes2 = nodeList.iterator();
         compareReturnedWithExpected:
-        while (failedNodes.hasNext()) {
-            String path = ((Node) failedNodes.next()).getPath();
+        while (failedNodes2.hasNext()) {
+            String path = failedNodes2.next().getPath();
             for (int i = 0; i < expectedFailedNodes.length; i++) {
                 if (expectedFailedNodes[i] != null) {
                     String expectedPath = expectedFailedNodes[i].getPath();
@@ -94,12 +95,12 @@ public class MergeNodeIteratorTest exten
 
         Node nodeToMerge = testRootNodeW2.getNode(nodeName1);
 
-        Iterator failedNodes = nodeToMerge.getSession().getWorkspace().getVersionManager().merge(
+        NodeIterator failedNodes1 = nodeToMerge.getSession().getWorkspace().getVersionManager().merge(
                 nodeToMerge.getPath(), workspace.getName(), true);
 
-        List nodeList = new ArrayList();
-        while (failedNodes.hasNext()) {
-            nodeList.add(failedNodes.next());
+        List<Node> nodeList = new ArrayList<Node>();
+        while (failedNodes1.hasNext()) {
+            nodeList.add(failedNodes1.nextNode());
         }
 
         assertEquals("Node.merge() does not return a NodeIterator with " +
@@ -108,10 +109,10 @@ public class MergeNodeIteratorTest exten
                 nodeList.size());
 
         // re-aquire iterator, has been consumed to get size
-        failedNodes = nodeList.iterator();
+        Iterator<Node> failedNodes2 = nodeList.iterator();
         compareReturnedWithExpected:
-        while (failedNodes.hasNext()) {
-            String path = ((Node) failedNodes.next()).getPath();
+        while (failedNodes2.hasNext()) {
+            String path = failedNodes2.next().getPath();
             for (int i = 0; i < expectedFailedNodes.length; i++) {
                 if (expectedFailedNodes[i] != null) {
                     String expectedPath = expectedFailedNodes[i].getPath();

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java?rev=1214236&r1=1214235&r2=1214236&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RemoveVersionTest.java
Wed Dec 14 13:26:55 2011
@@ -114,7 +114,7 @@ public class RemoveVersionTest extends A
     public void testRemoveVersionAdjustPredecessorSet() throws RepositoryException {
 
         // retrieve predecessors to test and remove the version
-        List predecPaths = new ArrayList();
+        List<String> predecPaths = new ArrayList<String>();
         Version[] predec = version.getPredecessors();
         for (int i = 0; i < predec.length; i++) {
             predecPaths.add(predec[i].getPath());

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java?rev=1214236&r1=1214235&r2=1214236&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/RestoreTest.java
Wed Dec 14 13:26:55 2011
@@ -30,7 +30,6 @@ import javax.jcr.InvalidItemStateExcepti
 import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.ItemExistsException;
 import javax.jcr.NodeIterator;
-import javax.jcr.Session;
 
 /**
  * <code>RestoreTest</code> covers tests related to the restore methods available

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java?rev=1214236&r1=1214235&r2=1214236&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionHistoryTest.java
Wed Dec 14 13:26:55 2011
@@ -24,6 +24,7 @@ import java.util.GregorianCalendar;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import javax.jcr.ItemNotFoundException;
@@ -165,7 +166,7 @@ public class VersionHistoryTest extends 
         
         VersionManager vm = versionableNode.getSession().getWorkspace().getVersionManager();
         
-        List lvh = new ArrayList();
+        List<String> lvh = new ArrayList<String>();
         for (VersionIterator it = vHistory.getAllLinearVersions(); it.hasNext(); ) {
             lvh.add(it.nextVersion().getName());
         }
@@ -188,7 +189,7 @@ public class VersionHistoryTest extends 
      */
     public void testGetAllVersions() throws RepositoryException {
         int cnt = 5;
-        HashMap versions = new HashMap();
+        Map<String, Version> versions = new HashMap<String, Version>();
         Version v = vHistory.getRootVersion();
         versions.put(v.getUUID(), v);
         for (int i = 0; i < cnt; i++) {
@@ -217,7 +218,7 @@ public class VersionHistoryTest extends 
      */
     public void testGetAllVersionsJcr2() throws RepositoryException {
         int cnt = 5;
-        HashMap versions = new HashMap();
+        Map<String, Version> versions = new HashMap<String, Version>();
         Version v = vHistory.getRootVersion();
         versions.put(v.getIdentifier(), v);
         for (int i = 0; i < cnt; i++) {
@@ -256,13 +257,13 @@ public class VersionHistoryTest extends 
             vm.checkpoint(path);
         }
 
-        Set frozenIds = new HashSet();
+        Set<String> frozenIds = new HashSet<String>();
         for (VersionIterator it = vm.getVersionHistory(path).getAllVersions(); it.hasNext();
) {
             Version v = it.nextVersion();
             frozenIds.add(v.getFrozenNode().getIdentifier());
         }
         
-        Set test = new HashSet();
+        Set<String> test = new HashSet<String>();
         for (NodeIterator it = vHistory.getAllFrozenNodes(); it.hasNext(); ) {
             Node n = it.nextNode();
             assertTrue("Node " + n.getPath() + " must be of type frozen node",

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionLabelTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionLabelTest.java?rev=1214236&r1=1214235&r2=1214236&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionLabelTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionLabelTest.java
Wed Dec 14 13:26:55 2011
@@ -18,6 +18,8 @@ package org.apache.jackrabbit.test.api.v
 
 import java.util.Arrays;
 import java.util.HashSet;
+import java.util.Set;
+
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.UnsupportedRepositoryOperationException;
@@ -337,7 +339,7 @@ public class VersionLabelTest extends Ab
      */
     public void testGetVersionLabels() throws RepositoryException {
 
-        HashSet testLabels = new HashSet(Arrays.asList(vHistory.getVersionLabels()));
+        Set<String> testLabels = new HashSet<String>(Arrays.asList(vHistory.getVersionLabels()));
         versionableNode.checkout();
         Version v = versionableNode.checkin();
 
@@ -366,7 +368,7 @@ public class VersionLabelTest extends Ab
      */
     public void testGetVersionLabelsJcr2() throws RepositoryException {
 
-        HashSet testLabels = new HashSet(Arrays.asList(vHistory.getVersionLabels()));
+        Set<String> testLabels = new HashSet<String>(Arrays.asList(vHistory.getVersionLabels()));
 
         VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
         String path = versionableNode.getPath();
@@ -399,7 +401,7 @@ public class VersionLabelTest extends Ab
      */
     public void testGetVersionLabelsForVersion() throws RepositoryException {
 
-        HashSet testLabels = new HashSet(Arrays.asList(vHistory.getVersionLabels(rootVersion)));
+        Set<String> testLabels = new HashSet<String>(Arrays.asList(vHistory.getVersionLabels(rootVersion)));
 
         vHistory.addVersionLabel(rootVersion.getName(), versionLabel, false);
         testLabels.add(versionLabel);
@@ -430,7 +432,7 @@ public class VersionLabelTest extends Ab
      */
     public void testGetVersionLabelsForVersionJcr2() throws RepositoryException {
 
-        HashSet testLabels = new HashSet(Arrays.asList(vHistory.getVersionLabels(rootVersion)));
+        Set<String> testLabels = new HashSet<String>(Arrays.asList(vHistory.getVersionLabels(rootVersion)));
 
         vHistory.addVersionLabel(rootVersion.getName(), versionLabel, false);
         testLabels.add(versionLabel);

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionTest.java?rev=1214236&r1=1214235&r2=1214236&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/VersionTest.java
Wed Dec 14 13:26:55 2011
@@ -448,7 +448,7 @@ public class VersionTest extends Abstrac
      * Tests if <code>Version.getUUID()</code> returns the right UUID
      */
     public void testGetUUID() throws Exception {
-        List successorValues = Arrays.asList(versionableNode.getVersionHistory().getRootVersion().getProperty(jcrSuccessors).getValues());
+        List<Value> successorValues = Arrays.asList(versionableNode.getVersionHistory().getRootVersion().getProperty(jcrSuccessors).getValues());
         assertTrue("Version.getUUID() did not return the right UUID", successorValues.contains(superuser.getValueFactory().createValue(version)));
     }
 



Mime
View raw message