jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1214245 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation: AbstractObservationTest.java EventJournalTest.java EventResult.java LockingTest.java PropertyAddedTest.java
Date Wed, 14 Dec 2011 14:01:57 GMT
Author: reschke
Date: Wed Dec 14 14:01:57 2011
New Revision: 1214245

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

Reduce warning noise on observation tests

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AbstractObservationTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventJournalTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventResult.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AbstractObservationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AbstractObservationTest.java?rev=1214245&r1=1214244&r2=1214245&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AbstractObservationTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/AbstractObservationTest.java
Wed Dec 14 14:01:57 2011
@@ -122,11 +122,11 @@ public abstract class AbstractObservatio
      * @return array of <code>EventListeners</code>.
      */
     protected EventListener[] toArray(EventListenerIterator it) {
-        List listeners = new ArrayList();
+        List<EventListener> listeners = new ArrayList<EventListener>();
         while (it.hasNext()) {
             listeners.add(it.nextEventListener());
         }
-        return (EventListener[]) listeners.toArray(new EventListener[listeners.size()]);
+        return listeners.toArray(new EventListener[listeners.size()]);
     }
 
     //--------------------< check methods >-------------------------------------
@@ -223,7 +223,7 @@ public abstract class AbstractObservatio
      */
     protected void checkNodes(Event[] events, String[] requiredRelPaths, String[] optionalRelPaths,
long eventType)
             throws RepositoryException {
-        Set paths = new HashSet();
+        Set<String> paths = new HashSet<String>();
         for (int i = 0; i < events.length; i++) {
             assertEquals("Wrong event type", eventType, events[i].getType());
             String path = events[i].getPath();
@@ -237,14 +237,14 @@ public abstract class AbstractObservatio
             paths.remove(expected);
         }
         // check what remains in the set is indeed optional
-        Set optional = new HashSet();
+        Set<String> optional = new HashSet<String>();
         if (optionalRelPaths != null) {
             for (int i = 0; i < optionalRelPaths.length; i++) {
                 optional.add(testRoot + "/" + optionalRelPaths[i]);
             }
         }
-        for (Iterator it = paths.iterator(); it.hasNext(); ) {
-            String path = (String)it.next();
+        for (Iterator<String> it = paths.iterator(); it.hasNext(); ) {
+            String path = it.next();
             assertTrue("Path " + path + " not expected in events.",
                     optional.contains(path));
         }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventJournalTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventJournalTest.java?rev=1214245&r1=1214244&r2=1214245&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventJournalTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventJournalTest.java
Wed Dec 14 14:01:57 2011
@@ -258,8 +258,8 @@ public class EventJournalTest extends Ab
      *          journal.
      */
     private void checkJournal(String[] allowed, String[] denied) throws RepositoryException
{
-        Set allowedSet = new HashSet(Arrays.asList(allowed));
-        Set deniedSet = new HashSet(Arrays.asList(denied));
+        Set<String> allowedSet = new HashSet<String>(Arrays.asList(allowed));
+        Set<String> deniedSet = new HashSet<String>(Arrays.asList(denied));
         while (journal.hasNext()) {
             String path = journal.nextEvent().getPath();
             allowedSet.remove(path);

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventResult.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventResult.java?rev=1214245&r1=1214244&r2=1214245&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventResult.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/EventResult.java
Wed Dec 14 14:01:57 2011
@@ -127,10 +127,10 @@ public class EventResult implements Even
      * @return the events from the iterator.
      */
     private Event[] getEvents(EventIterator events) {
-        List eventList = new ArrayList();
+        List<Event> eventList = new ArrayList<Event>();
         while (events.hasNext()) {
             eventList.add(events.nextEvent());
         }
-        return (Event[]) eventList.toArray(new Event[eventList.size()]);
+        return eventList.toArray(new Event[eventList.size()]);
     }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java?rev=1214245&r1=1214244&r2=1214245&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/LockingTest.java
Wed Dec 14 14:01:57 2011
@@ -63,7 +63,7 @@ public class LockingTest extends Abstrac
         for (int i = 0; i < events.length; i++) {
             assertEquals("Wrong type of event.", Event.PROPERTY_ADDED, events[i].getType());
         }
-        List paths = new ArrayList();
+        List<String> paths = new ArrayList<String>();
         for (int i = 0; i < events.length; i++) {
             paths.add(events[i].getPath());
         }
@@ -96,7 +96,7 @@ public class LockingTest extends Abstrac
         for (int i = 0; i < events.length; i++) {
             assertEquals("Wrong type of event.", Event.PROPERTY_REMOVED, events[i].getType());
         }
-        List paths = new ArrayList();
+        List<String> paths = new ArrayList<String>();
         for (int i = 0; i < events.length; i++) {
             paths.add(events[i].getPath());
         }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java?rev=1214245&r1=1214244&r2=1214245&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/observation/PropertyAddedTest.java
Wed Dec 14 14:01:57 2011
@@ -51,7 +51,7 @@ public class PropertyAddedTest extends A
         testRootNode.save();
         Event[] events = result.getEvents(DEFAULT_WAIT_TIMEOUT);
         removeEventListener(result);
-        List paths = new ArrayList();
+        List<String> paths = new ArrayList<String>();
         for (int i = 0; i < events.length; i++) {
             paths.add(events[i].getPath());
         }



Mime
View raw message