Make decorator classes serializable, bug 18815
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131766 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e96040f146
commit
e00f903d7e
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -26,13 +26,21 @@ import org.apache.commons.collections.collection.AbstractCollectionDecorator;
|
|||
* Methods are forwarded directly to the decorated bag.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.4 $ $Date: 2004/02/18 00:56:25 $
|
||||
* @version $Revision: 1.5 $ $Date: 2004/06/02 21:53:02 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public abstract class AbstractBagDecorator
|
||||
extends AbstractCollectionDecorator implements Bag {
|
||||
|
||||
/**
|
||||
* Constructor only used in deserialization, do not use otherwise.
|
||||
* @since Commons Collections 3.1
|
||||
*/
|
||||
protected AbstractBagDecorator() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that wraps (not copies).
|
||||
*
|
||||
|
|
|
@ -25,13 +25,21 @@ import org.apache.commons.collections.SortedBag;
|
|||
* Methods are forwarded directly to the decorated bag.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.4 $ $Date: 2004/02/18 00:56:25 $
|
||||
* @version $Revision: 1.5 $ $Date: 2004/06/02 21:53:02 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public abstract class AbstractSortedBagDecorator
|
||||
extends AbstractBagDecorator implements SortedBag {
|
||||
|
||||
/**
|
||||
* Constructor only used in deserialization, do not use otherwise.
|
||||
* @since Commons Collections 3.1
|
||||
*/
|
||||
protected AbstractSortedBagDecorator() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that wraps (not copies).
|
||||
*
|
||||
|
|
|
@ -31,9 +31,11 @@ import org.apache.commons.collections.collection.PredicatedCollection;
|
|||
* <p>
|
||||
* One usage would be to ensure that no null entries are added to the bag.
|
||||
* <pre>Bag bag = PredicatedBag.decorate(new HashBag(), NotNullPredicate.INSTANCE);</pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/05/21 21:38:40 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:56:19 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Paul Jack
|
||||
|
|
|
@ -30,9 +30,11 @@ import org.apache.commons.collections.SortedBag;
|
|||
* <p>
|
||||
* One usage would be to ensure that no null entries are added to the bag.
|
||||
* <pre>SortedBag bag = PredicatedSortedBag.decorate(new TreeBag(), NotNullPredicate.INSTANCE);</pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/05/21 21:38:40 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:56:19 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Paul Jack
|
||||
|
|
|
@ -29,9 +29,11 @@ import org.apache.commons.collections.set.TransformedSet;
|
|||
* Thus objects must be removed or searched for using their transformed form.
|
||||
* For example, if the transformation converts Strings to Integers, you must
|
||||
* use the Integer form to remove objects.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2004/05/15 12:27:04 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:56:19 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
|
|
@ -27,9 +27,11 @@ import org.apache.commons.collections.Transformer;
|
|||
* Thus objects must be removed or searched for using their transformed form.
|
||||
* For example, if the transformation converts Strings to Integers, you must
|
||||
* use the Integer form to remove objects.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2004/05/15 12:27:04 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:56:19 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
*/
|
||||
package org.apache.commons.collections.bag;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
@ -26,14 +30,19 @@ import org.apache.commons.collections.set.UnmodifiableSet;
|
|||
|
||||
/**
|
||||
* Decorates another <code>Bag</code> to ensure it can't be altered.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.7 $ $Date: 2004/05/15 12:27:04 $
|
||||
* @version $Revision: 1.8 $ $Date: 2004/06/02 21:56:19 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public final class UnmodifiableBag
|
||||
extends AbstractBagDecorator implements Unmodifiable {
|
||||
extends AbstractBagDecorator implements Unmodifiable, Serializable {
|
||||
|
||||
/** Serialization version */
|
||||
private static final long serialVersionUID = -1873799975157099624L;
|
||||
|
||||
/**
|
||||
* Factory method to create an unmodifiable bag.
|
||||
|
@ -62,6 +71,30 @@ public final class UnmodifiableBag
|
|||
super(bag);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Write the collection out using a custom routine.
|
||||
*
|
||||
* @param out the output stream
|
||||
* @throws IOException
|
||||
*/
|
||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||
out.defaultWriteObject();
|
||||
out.writeObject(collection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the collection in using a custom routine.
|
||||
*
|
||||
* @param in the input stream
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
collection = (Collection) in.readObject();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
public Iterator iterator() {
|
||||
return UnmodifiableIterator.decorate(getCollection().iterator());
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
*/
|
||||
package org.apache.commons.collections.bag;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
@ -26,14 +30,19 @@ import org.apache.commons.collections.set.UnmodifiableSet;
|
|||
|
||||
/**
|
||||
* Decorates another <code>SortedBag</code> to ensure it can't be altered.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.8 $ $Date: 2004/05/15 12:27:04 $
|
||||
* @version $Revision: 1.9 $ $Date: 2004/06/02 21:56:19 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public final class UnmodifiableSortedBag
|
||||
extends AbstractSortedBagDecorator implements Unmodifiable {
|
||||
extends AbstractSortedBagDecorator implements Unmodifiable, Serializable {
|
||||
|
||||
/** Serialization version */
|
||||
private static final long serialVersionUID = -3190437252665717841L;
|
||||
|
||||
/**
|
||||
* Factory method to create an unmodifiable bag.
|
||||
|
@ -62,6 +71,30 @@ public final class UnmodifiableSortedBag
|
|||
super(bag);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Write the collection out using a custom routine.
|
||||
*
|
||||
* @param out the output stream
|
||||
* @throws IOException
|
||||
*/
|
||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||
out.defaultWriteObject();
|
||||
out.writeObject(collection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the collection in using a custom routine.
|
||||
*
|
||||
* @param in the input stream
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
collection = (Collection) in.readObject();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
public Iterator iterator() {
|
||||
return UnmodifiableIterator.decorate(getCollection().iterator());
|
||||
|
|
|
@ -24,12 +24,20 @@ import org.apache.commons.collections.collection.AbstractCollectionDecorator;
|
|||
* Methods are forwarded directly to the decorated buffer.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:18 $
|
||||
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:02 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public abstract class AbstractBufferDecorator extends AbstractCollectionDecorator implements Buffer {
|
||||
|
||||
/**
|
||||
* Constructor only used in deserialization, do not use otherwise.
|
||||
* @since Commons Collections 3.1
|
||||
*/
|
||||
protected AbstractBufferDecorator() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that wraps (not copies).
|
||||
*
|
||||
|
|
|
@ -29,9 +29,11 @@ import org.apache.commons.collections.collection.PredicatedCollection;
|
|||
* <p>
|
||||
* One usage would be to ensure that no null entries are added to the buffer.
|
||||
* <pre>Buffer buffer = PredicatedBuffer.decorate(new UnboundedFifoBuffer(), NotNullPredicate.INSTANCE);</pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2004/05/21 21:38:48 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:57:03 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Paul Jack
|
||||
|
|
|
@ -26,9 +26,11 @@ import org.apache.commons.collections.collection.TransformedCollection;
|
|||
* Thus objects must be removed or searched for using their transformed form.
|
||||
* For example, if the transformation converts Strings to Integers, you must
|
||||
* use the Integer form to remove objects.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.4 $ $Date: 2004/05/15 12:33:23 $
|
||||
* @version $Revision: 1.5 $ $Date: 2004/06/02 21:57:03 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
*/
|
||||
package org.apache.commons.collections.buffer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
|
@ -24,13 +28,20 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||
|
||||
/**
|
||||
* Decorates another <code>Buffer</code> to ensure it can't be altered.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/05/15 12:33:23 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:57:03 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public final class UnmodifiableBuffer extends AbstractBufferDecorator implements Unmodifiable {
|
||||
public final class UnmodifiableBuffer
|
||||
extends AbstractBufferDecorator
|
||||
implements Unmodifiable, Serializable {
|
||||
|
||||
/** Serialization version */
|
||||
private static final long serialVersionUID = 1832948656215393357L;
|
||||
|
||||
/**
|
||||
* Factory method to create an unmodifiable buffer.
|
||||
|
@ -59,6 +70,30 @@ public final class UnmodifiableBuffer extends AbstractBufferDecorator implements
|
|||
super(buffer);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Write the collection out using a custom routine.
|
||||
*
|
||||
* @param out the output stream
|
||||
* @throws IOException
|
||||
*/
|
||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||
out.defaultWriteObject();
|
||||
out.writeObject(collection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the collection in using a custom routine.
|
||||
*
|
||||
* @param in the input stream
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
collection = (Collection) in.readObject();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
public Iterator iterator() {
|
||||
return UnmodifiableIterator.decorate(getCollection().iterator());
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.util.Iterator;
|
|||
* to write an unmodifiable implementation it might provide a loophole.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 00:58:53 $
|
||||
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:03 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Paul Jack
|
||||
|
@ -42,7 +42,15 @@ import java.util.Iterator;
|
|||
public abstract class AbstractCollectionDecorator implements Collection {
|
||||
|
||||
/** The collection being decorated */
|
||||
protected final Collection collection;
|
||||
protected Collection collection;
|
||||
|
||||
/**
|
||||
* Constructor only used in deserialization, do not use otherwise.
|
||||
* @since Commons Collections 3.1
|
||||
*/
|
||||
protected AbstractCollectionDecorator() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that wraps (not copies).
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright 2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections.collection;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Serializable subclass of AbstractCollectionDecorator.
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @since Commons Collections 3.1
|
||||
*/
|
||||
public abstract class AbstractSerializableCollectionDecorator
|
||||
extends AbstractCollectionDecorator
|
||||
implements Serializable {
|
||||
|
||||
/** Serialization version */
|
||||
private static final long serialVersionUID = 6249888059822088500L;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
protected AbstractSerializableCollectionDecorator(Collection coll) {
|
||||
super(coll);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Write the collection out using a custom routine.
|
||||
*
|
||||
* @param out the output stream
|
||||
* @throws IOException
|
||||
*/
|
||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||
out.defaultWriteObject();
|
||||
out.writeObject(collection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the collection in using a custom routine.
|
||||
*
|
||||
* @param in the input stream
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
collection = (Collection) in.readObject();
|
||||
}
|
||||
|
||||
}
|
|
@ -30,14 +30,16 @@ import org.apache.commons.collections.Predicate;
|
|||
* <p>
|
||||
* One usage would be to ensure that no null entries are added to the collection.
|
||||
* <pre>Collection coll = PredicatedCollection.decorate(new ArrayList(), NotNullPredicate.INSTANCE);</pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2004/05/21 21:38:40 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:58:06 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Paul Jack
|
||||
*/
|
||||
public class PredicatedCollection extends AbstractCollectionDecorator {
|
||||
public class PredicatedCollection extends AbstractSerializableCollectionDecorator {
|
||||
|
||||
/** The predicate to use */
|
||||
protected final Predicate predicate;
|
||||
|
|
|
@ -29,13 +29,15 @@ import org.apache.commons.collections.Transformer;
|
|||
* Thus objects must be removed or searched for using their transformed form.
|
||||
* For example, if the transformation converts Strings to Integers, you must
|
||||
* use the Integer form to remove objects.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2004/05/15 12:39:13 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:58:06 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public class TransformedCollection extends AbstractCollectionDecorator {
|
||||
public class TransformedCollection extends AbstractSerializableCollectionDecorator {
|
||||
|
||||
/** The transformer to use */
|
||||
protected final Transformer transformer;
|
||||
|
|
|
@ -30,13 +30,17 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||
* longer accessible.
|
||||
* The factory on this class will attempt to retrieve the bounded nature by
|
||||
* examining the package scope variables.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.8 $ $Date: 2004/05/15 12:39:13 $
|
||||
* @version $Revision: 1.9 $ $Date: 2004/06/02 21:58:06 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public final class UnmodifiableBoundedCollection extends AbstractCollectionDecorator implements BoundedCollection {
|
||||
public final class UnmodifiableBoundedCollection
|
||||
extends AbstractSerializableCollectionDecorator
|
||||
implements BoundedCollection {
|
||||
|
||||
/**
|
||||
* Factory method to create an unmodifiable bounded collection.
|
||||
|
@ -130,5 +134,5 @@ public final class UnmodifiableBoundedCollection extends AbstractCollectionDecor
|
|||
public int maxSize() {
|
||||
return ((BoundedCollection) collection).maxSize();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -23,13 +23,17 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||
|
||||
/**
|
||||
* Decorates another <code>Collection</code> to ensure it can't be altered.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/05/15 12:39:13 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:58:06 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public final class UnmodifiableCollection extends AbstractCollectionDecorator implements Unmodifiable {
|
||||
public final class UnmodifiableCollection
|
||||
extends AbstractSerializableCollectionDecorator
|
||||
implements Unmodifiable {
|
||||
|
||||
/**
|
||||
* Factory method to create an unmodifiable collection.
|
||||
|
|
|
@ -27,12 +27,20 @@ import org.apache.commons.collections.collection.AbstractCollectionDecorator;
|
|||
* Methods are forwarded directly to the decorated list.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:12:26 $
|
||||
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:02 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public abstract class AbstractListDecorator extends AbstractCollectionDecorator implements List {
|
||||
|
||||
/**
|
||||
* Constructor only used in deserialization, do not use otherwise.
|
||||
* @since Commons Collections 3.1
|
||||
*/
|
||||
protected AbstractListDecorator() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that wraps (not copies).
|
||||
*
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright 2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections.list;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Serializable subclass of AbstractListDecorator.
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @since Commons Collections 3.1
|
||||
*/
|
||||
public abstract class AbstractSerializableListDecorator
|
||||
extends AbstractListDecorator
|
||||
implements Serializable {
|
||||
|
||||
/** Serialization version */
|
||||
private static final long serialVersionUID = 2684959196747496299L;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
protected AbstractSerializableListDecorator(List list) {
|
||||
super(list);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Write the list out using a custom routine.
|
||||
*
|
||||
* @param out the output stream
|
||||
* @throws IOException
|
||||
*/
|
||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||
out.defaultWriteObject();
|
||||
out.writeObject(collection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the list in using a custom routine.
|
||||
*
|
||||
* @param in the input stream
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
collection = (Collection) in.readObject();
|
||||
}
|
||||
|
||||
}
|
|
@ -29,14 +29,18 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||
* <p>
|
||||
* The add, remove, clear and retain operations are unsupported.
|
||||
* The set method is allowed (as it doesn't change the list size).
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:12:26 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:59:49 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Paul Jack
|
||||
*/
|
||||
public class FixedSizeList extends AbstractListDecorator implements BoundedCollection {
|
||||
public class FixedSizeList
|
||||
extends AbstractSerializableListDecorator
|
||||
implements BoundedCollection {
|
||||
|
||||
/**
|
||||
* Factory method to create a fixed size list.
|
||||
|
|
|
@ -45,15 +45,17 @@ import org.apache.commons.collections.Factory;
|
|||
* a new <code>Date</code> instance. Furthermore, that <code>Date</code>
|
||||
* instance is the fourth element in the list. The first, second,
|
||||
* and third element are all set to <code>null</code>.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.4 $ $Date: 2004/02/18 01:12:26 $
|
||||
* @version $Revision: 1.5 $ $Date: 2004/06/02 21:59:49 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Arron Bates
|
||||
* @author Paul Jack
|
||||
*/
|
||||
public class LazyList extends AbstractListDecorator {
|
||||
public class LazyList extends AbstractSerializableListDecorator {
|
||||
|
||||
/** The factory to use to lazily instantiate the objects */
|
||||
protected final Factory factory;
|
||||
|
|
|
@ -34,9 +34,11 @@ import org.apache.commons.collections.iterators.AbstractListIteratorDecorator;
|
|||
* <p>
|
||||
* One usage would be to ensure that no null entries are added to the list.
|
||||
* <pre>List list = PredicatedList.decorate(new ArrayList(), NotNullPredicate.INSTANCE);</pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.4 $ $Date: 2004/05/21 21:38:40 $
|
||||
* @version $Revision: 1.5 $ $Date: 2004/06/02 21:59:49 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Paul Jack
|
||||
|
|
|
@ -39,14 +39,16 @@ import org.apache.commons.collections.set.UnmodifiableSet;
|
|||
* The {@link org.apache.commons.collections.set.ListOrderedSet ListOrderedSet}
|
||||
* class provides an alternative approach, by wrapping an existing Set and
|
||||
* retaining insertion order in the iterator.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:12:26 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 21:59:49 $
|
||||
*
|
||||
* @author Matthew Hawthorne
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public class SetUniqueList extends AbstractListDecorator {
|
||||
public class SetUniqueList extends AbstractSerializableListDecorator {
|
||||
|
||||
/**
|
||||
* Internal Set to maintain uniqueness.
|
||||
|
|
|
@ -30,9 +30,11 @@ import org.apache.commons.collections.iterators.AbstractListIteratorDecorator;
|
|||
* Thus objects must be removed or searched for using their transformed form.
|
||||
* For example, if the transformation converts Strings to Integers, you must
|
||||
* use the Integer form to remove objects.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:12:26 $
|
||||
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:59:49 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
|
|
@ -26,13 +26,17 @@ import org.apache.commons.collections.iterators.UnmodifiableListIterator;
|
|||
|
||||
/**
|
||||
* Decorates another <code>List</code> to ensure it can't be altered.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2004/02/18 01:12:26 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/06/02 21:59:49 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public final class UnmodifiableList extends AbstractListDecorator implements Unmodifiable {
|
||||
public final class UnmodifiableList
|
||||
extends AbstractSerializableListDecorator
|
||||
implements Unmodifiable {
|
||||
|
||||
/**
|
||||
* Factory method to create an unmodifiable list.
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* Copyright 2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections.set;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Serializable subclass of AbstractSetDecorator.
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @since Commons Collections 3.1
|
||||
*/
|
||||
public abstract class AbstractSerializableSetDecorator
|
||||
extends AbstractSetDecorator
|
||||
implements Serializable {
|
||||
|
||||
/** Serialization version */
|
||||
private static final long serialVersionUID = 1229469966212206107L;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
protected AbstractSerializableSetDecorator(Set set) {
|
||||
super(set);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Write the set out using a custom routine.
|
||||
*
|
||||
* @param out the output stream
|
||||
* @throws IOException
|
||||
*/
|
||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||
out.defaultWriteObject();
|
||||
out.writeObject(collection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the set in using a custom routine.
|
||||
*
|
||||
* @param in the input stream
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
collection = (Collection) in.readObject();
|
||||
}
|
||||
|
||||
}
|
|
@ -25,12 +25,20 @@ import org.apache.commons.collections.collection.AbstractCollectionDecorator;
|
|||
* Methods are forwarded directly to the decorated set.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:14:27 $
|
||||
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:03 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public abstract class AbstractSetDecorator extends AbstractCollectionDecorator implements Set {
|
||||
|
||||
/**
|
||||
* Constructor only used in deserialization, do not use otherwise.
|
||||
* @since Commons Collections 3.1
|
||||
*/
|
||||
protected AbstractSetDecorator() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that wraps (not copies).
|
||||
*
|
||||
|
|
|
@ -25,12 +25,20 @@ import java.util.SortedSet;
|
|||
* Methods are forwarded directly to the decorated set.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:14:27 $
|
||||
* @version $Revision: 1.4 $ $Date: 2004/06/02 21:53:03 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public abstract class AbstractSortedSetDecorator extends AbstractSetDecorator implements SortedSet {
|
||||
|
||||
/**
|
||||
* Constructor only used in deserialization, do not use otherwise.
|
||||
* @since Commons Collections 3.1
|
||||
*/
|
||||
protected AbstractSortedSetDecorator() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that wraps (not copies).
|
||||
*
|
||||
|
|
|
@ -40,14 +40,16 @@ import org.apache.commons.collections.list.UnmodifiableList;
|
|||
* <p>
|
||||
* This class cannot implement the <code>List</code> interface directly as
|
||||
* various interface methods (notably equals/hashCode) are incompatable with a set.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:14:27 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:02:34 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Henning P. Schmiedehausen
|
||||
*/
|
||||
public class ListOrderedSet extends AbstractSetDecorator implements Set {
|
||||
public class ListOrderedSet extends AbstractSerializableSetDecorator implements Set {
|
||||
|
||||
/** Internal list to hold the sequence of objects */
|
||||
protected final List setOrder;
|
||||
|
|
|
@ -30,9 +30,11 @@ import org.apache.commons.collections.collection.PredicatedCollection;
|
|||
* <p>
|
||||
* One usage would be to ensure that no null entries are added to the set.
|
||||
* <pre>Set set = PredicatedSet.decorate(new HashSet(), NotNullPredicate.INSTANCE);</pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.4 $ $Date: 2004/05/21 21:38:42 $
|
||||
* @version $Revision: 1.5 $ $Date: 2004/06/02 22:02:34 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Paul Jack
|
||||
|
|
|
@ -30,9 +30,11 @@ import org.apache.commons.collections.Predicate;
|
|||
* <p>
|
||||
* One usage would be to ensure that no null entries are added to the set.
|
||||
* <pre>SortedSet set = PredicatedSortedSet.decorate(new TreeSet(), NotNullPredicate.INSTANCE);</pre>
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.4 $ $Date: 2004/05/21 21:38:42 $
|
||||
* @version $Revision: 1.5 $ $Date: 2004/06/02 22:02:34 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Paul Jack
|
||||
|
|
|
@ -27,9 +27,11 @@ import org.apache.commons.collections.collection.TransformedCollection;
|
|||
* Thus objects must be removed or searched for using their transformed form.
|
||||
* For example, if the transformation converts Strings to Integers, you must
|
||||
* use the Integer form to remove objects.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:14:27 $
|
||||
* @version $Revision: 1.4 $ $Date: 2004/06/02 22:02:34 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
|
|
@ -27,9 +27,11 @@ import org.apache.commons.collections.Transformer;
|
|||
* Thus objects must be removed or searched for using their transformed form.
|
||||
* For example, if the transformation converts Strings to Integers, you must
|
||||
* use the Integer form to remove objects.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:14:27 $
|
||||
* @version $Revision: 1.4 $ $Date: 2004/06/02 22:02:34 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
|
|
@ -24,13 +24,17 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||
|
||||
/**
|
||||
* Decorates another <code>Set</code> to ensure it can't be altered.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2004/02/18 01:14:27 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/06/02 22:02:34 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public final class UnmodifiableSet extends AbstractSetDecorator implements Unmodifiable {
|
||||
public final class UnmodifiableSet
|
||||
extends AbstractSerializableSetDecorator
|
||||
implements Unmodifiable {
|
||||
|
||||
/**
|
||||
* Factory method to create an unmodifiable set.
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
*/
|
||||
package org.apache.commons.collections.set;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.SortedSet;
|
||||
|
@ -24,13 +28,20 @@ import org.apache.commons.collections.iterators.UnmodifiableIterator;
|
|||
|
||||
/**
|
||||
* Decorates another <code>SortedSet</code> to ensure it can't be altered.
|
||||
* <p>
|
||||
* This class is Serializable from Commons Collections 3.1.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2004/02/18 01:14:27 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/06/02 22:02:34 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public final class UnmodifiableSortedSet extends AbstractSortedSetDecorator implements Unmodifiable {
|
||||
public final class UnmodifiableSortedSet
|
||||
extends AbstractSortedSetDecorator
|
||||
implements Unmodifiable, Serializable {
|
||||
|
||||
/** Serialization version */
|
||||
private static final long serialVersionUID = -725356885467962424L;
|
||||
|
||||
/**
|
||||
* Factory method to create an unmodifiable set.
|
||||
|
@ -45,6 +56,30 @@ public final class UnmodifiableSortedSet extends AbstractSortedSetDecorator impl
|
|||
return new UnmodifiableSortedSet(set);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Write the collection out using a custom routine.
|
||||
*
|
||||
* @param out the output stream
|
||||
* @throws IOException
|
||||
*/
|
||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||
out.defaultWriteObject();
|
||||
out.writeObject(collection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the collection in using a custom routine.
|
||||
*
|
||||
* @param in the input stream
|
||||
* @throws IOException
|
||||
* @throws ClassNotFoundException
|
||||
*/
|
||||
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
|
||||
in.defaultReadObject();
|
||||
collection = (Collection) in.readObject();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Constructor that wraps (not copies).
|
||||
|
|
|
@ -15,18 +15,14 @@
|
|||
*/
|
||||
package org.apache.commons.collections;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import junit.framework.Test;
|
||||
|
||||
import org.apache.commons.collections.buffer.PredicatedBuffer;
|
||||
import org.apache.commons.collections.collection.AbstractTestCollection;
|
||||
|
||||
/**
|
||||
* Tests for BufferUtils.
|
||||
*
|
||||
* @version $Revision: 1.12 $ $Date: 2004/02/18 01:20:35 $
|
||||
* @version $Revision: 1.13 $ $Date: 2004/06/02 22:12:14 $
|
||||
*
|
||||
* @author Unknown
|
||||
*/
|
||||
|
@ -67,38 +63,4 @@ public class TestBufferUtils extends BulkTest {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public BulkTest bulkTestUnmodifiableBuffer() {
|
||||
return new AbstractTestCollection("") {
|
||||
public boolean isAddSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isRemoveSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Collection makeCollection() {
|
||||
return BufferUtils.unmodifiableBuffer(new ArrayStack());
|
||||
}
|
||||
|
||||
public Collection makeFullCollection() {
|
||||
ArrayStack a = new ArrayStack();
|
||||
a.addAll(Arrays.asList(getFullElements()));
|
||||
return BufferUtils.unmodifiableBuffer(a);
|
||||
}
|
||||
|
||||
|
||||
public Collection makeConfirmedCollection() {
|
||||
return new ArrayStack();
|
||||
}
|
||||
|
||||
public Collection makeConfirmedFullCollection() {
|
||||
ArrayStack a = new ArrayStack();
|
||||
a.addAll(Arrays.asList(getFullElements()));
|
||||
return a;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,13 +22,12 @@ import java.util.List;
|
|||
|
||||
import junit.framework.Test;
|
||||
|
||||
import org.apache.commons.collections.list.AbstractTestList;
|
||||
import org.apache.commons.collections.list.PredicatedList;
|
||||
|
||||
/**
|
||||
* Tests for ListUtils.
|
||||
*
|
||||
* @version $Revision: 1.18 $ $Date: 2004/02/18 01:20:35 $
|
||||
* @version $Revision: 1.19 $ $Date: 2004/06/02 22:12:14 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Neil O'Toole
|
||||
|
@ -73,34 +72,6 @@ public class TestListUtils extends BulkTest {
|
|||
}
|
||||
}
|
||||
|
||||
public BulkTest bulkTestTypedList() {
|
||||
return new TestTypedCollection("") {
|
||||
|
||||
public Collection typedCollection() {
|
||||
Class type = getType();
|
||||
return ListUtils.typedList(new ArrayList(), type);
|
||||
}
|
||||
|
||||
public BulkTest bulkTestAll() {
|
||||
return new AbstractTestList("") {
|
||||
public List makeEmptyList() {
|
||||
return (List)typedCollection();
|
||||
}
|
||||
|
||||
public Object[] getFullElements() {
|
||||
return getFullNonNullStringElements();
|
||||
}
|
||||
|
||||
public Object[] getOtherElements() {
|
||||
return getOtherNonNullStringElements();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public void testLazyList() {
|
||||
List list = ListUtils.lazyList(new ArrayList(), new Factory() {
|
||||
|
||||
|
|
|
@ -22,13 +22,12 @@ import java.util.Set;
|
|||
|
||||
import junit.framework.Test;
|
||||
|
||||
import org.apache.commons.collections.set.AbstractTestSet;
|
||||
import org.apache.commons.collections.set.PredicatedSet;
|
||||
|
||||
/**
|
||||
* Tests for SetUtils.
|
||||
*
|
||||
* @version $Revision: 1.15 $ $Date: 2004/02/18 01:20:35 $
|
||||
* @version $Revision: 1.16 $ $Date: 2004/06/02 22:12:14 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Neil O'Toole
|
||||
|
@ -70,33 +69,6 @@ public class TestSetUtils extends BulkTest {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public BulkTest bulkTestTypedSet() {
|
||||
return new TestTypedCollection("") {
|
||||
|
||||
public Collection typedCollection() {
|
||||
Class type = getType();
|
||||
return SetUtils.typedSet(new HashSet(), type);
|
||||
}
|
||||
|
||||
public BulkTest bulkTestAll() {
|
||||
return new AbstractTestSet("") {
|
||||
public Set makeEmptySet() {
|
||||
return (Set)typedCollection();
|
||||
}
|
||||
|
||||
public Object[] getFullElements() {
|
||||
return getFullNonNullStringElements();
|
||||
}
|
||||
|
||||
public Object[] getOtherElements() {
|
||||
return getOtherNonNullStringElements();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void testEquals() {
|
||||
Collection data = Arrays.asList( new String[] { "a", "b", "c" });
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.apache.commons.collections.PredicateUtils;
|
|||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:39 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:05:03 $
|
||||
*
|
||||
* @author Phil Steitz
|
||||
*/
|
||||
|
@ -123,4 +123,21 @@ public class TestPredicatedBag extends AbstractTestBag {
|
|||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// Bag bag = makeBag();
|
||||
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/PredicatedBag.emptyCollection.version3.1.obj");
|
||||
// bag = makeBag();
|
||||
// bag.add("A");
|
||||
// bag.add("A");
|
||||
// bag.add("B");
|
||||
// bag.add("B");
|
||||
// bag.add("C");
|
||||
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/PredicatedBag.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.apache.commons.collections.SortedBag;
|
|||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.7 $ $Date: 2004/02/18 01:20:39 $
|
||||
* @version $Revision: 1.8 $ $Date: 2004/06/02 22:05:03 $
|
||||
*
|
||||
* @author Phil Steitz
|
||||
*/
|
||||
|
@ -103,4 +103,21 @@ public class TestPredicatedSortedBag extends AbstractTestSortedBag {
|
|||
Comparator c = bag.comparator();
|
||||
assertTrue("natural order, so comparator should be null", c == null);
|
||||
}
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// Bag bag = makeBag();
|
||||
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/PredicatedSortedBag.emptyCollection.version3.1.obj");
|
||||
// bag = makeBag();
|
||||
// bag.add("A");
|
||||
// bag.add("A");
|
||||
// bag.add("B");
|
||||
// bag.add("B");
|
||||
// bag.add("C");
|
||||
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/PredicatedSortedBag.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.apache.commons.collections.collection.TestTransformedCollection;
|
|||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:39 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:05:03 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
@ -64,4 +64,21 @@ public class TestTransformedBag extends AbstractTestBag {
|
|||
assertEquals(true, bag.remove(new Integer((String) els[0])));
|
||||
|
||||
}
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// Bag bag = makeBag();
|
||||
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/TransformedBag.emptyCollection.version3.1.obj");
|
||||
// bag = makeBag();
|
||||
// bag.add("A");
|
||||
// bag.add("A");
|
||||
// bag.add("B");
|
||||
// bag.add("B");
|
||||
// bag.add("C");
|
||||
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/TransformedBag.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.apache.commons.collections.collection.TestTransformedCollection;
|
|||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:39 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:05:03 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
@ -62,4 +62,21 @@ public class TestTransformedSortedBag extends AbstractTestSortedBag {
|
|||
assertEquals(true, bag.remove(new Integer((String) els[0])));
|
||||
|
||||
}
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// Bag bag = makeBag();
|
||||
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/TransformedSortedBag.emptyCollection.version3.1.obj");
|
||||
// bag = makeBag();
|
||||
// bag.add("A");
|
||||
// bag.add("A");
|
||||
// bag.add("B");
|
||||
// bag.add("B");
|
||||
// bag.add("C");
|
||||
// writeExternalFormToDisk((java.io.Serializable) bag, "D:/dev/collections/data/test/TransformedSortedBag.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.apache.commons.collections.Bag;
|
|||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:39 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:05:03 $
|
||||
*
|
||||
* @author Phil Steitz
|
||||
*/
|
||||
|
@ -115,4 +115,9 @@ public class TestTypedBag extends AbstractTestBag {
|
|||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean skipSerializedCanonicalTests() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.apache.commons.collections.SortedBag;
|
|||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.7 $ $Date: 2004/02/18 01:20:39 $
|
||||
* @version $Revision: 1.8 $ $Date: 2004/06/02 22:05:03 $
|
||||
*
|
||||
* @author Phil Steitz
|
||||
*/
|
||||
|
@ -93,4 +93,9 @@ public class TestTypedSortedBag extends AbstractTestSortedBag {
|
|||
Comparator c = bag.comparator();
|
||||
assertTrue("natural order, so comparator should be null", c == null);
|
||||
}
|
||||
|
||||
protected boolean skipSerializedCanonicalTests() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import junit.framework.TestSuite;
|
|||
* Entry point for tests.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/02/18 01:20:37 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:05:54 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
@ -49,7 +49,9 @@ public class TestAll extends TestCase {
|
|||
|
||||
suite.addTest(TestBlockingBuffer.suite());
|
||||
suite.addTest(TestPredicatedBuffer.suite());
|
||||
suite.addTest(TestSynchronizedBuffer.suite());
|
||||
suite.addTest(TestTransformedBuffer.suite());
|
||||
suite.addTest(TestUnmodifiableBuffer.suite());
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.apache.commons.collections.collection.TestPredicatedCollection;
|
|||
* {@link PredicatedBuffer} implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:20:37 $
|
||||
* @version $Revision: 1.4 $ $Date: 2004/06/02 22:05:54 $
|
||||
*
|
||||
* @author Phil Steitz
|
||||
*/
|
||||
|
@ -101,4 +101,16 @@ public class TestPredicatedBuffer extends TestPredicatedCollection {
|
|||
// expected
|
||||
}
|
||||
}
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// resetEmpty();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/PredicatedBuffer.emptyCollection.version3.1.obj");
|
||||
// resetFull();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/PredicatedBuffer.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* Copyright 2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections.buffer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.apache.commons.collections.ArrayStack;
|
||||
import org.apache.commons.collections.Buffer;
|
||||
import org.apache.commons.collections.collection.AbstractTestCollection;
|
||||
|
||||
/**
|
||||
* Extension of {@link AbstractTestCollection} for exercising the
|
||||
* {@link SynchronizedBuffer} implementation.
|
||||
*
|
||||
* @since Commons Collections 3.1
|
||||
* @version $Revision: 1.1 $ $Date: 2004/06/02 22:05:54 $
|
||||
*
|
||||
* @author Phil Steitz
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public class TestSynchronizedBuffer extends AbstractTestCollection {
|
||||
|
||||
public TestSynchronizedBuffer(String testName) {
|
||||
super(testName);
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
return new TestSuite(TestSynchronizedBuffer.class);
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
String[] testCaseName = { TestSynchronizedBuffer.class.getName()};
|
||||
junit.textui.TestRunner.main(testCaseName);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
public Collection makeCollection() {
|
||||
return SynchronizedBuffer.decorate(new UnboundedFifoBuffer());
|
||||
}
|
||||
|
||||
public Collection makeFullCollection() {
|
||||
Buffer buffer = new UnboundedFifoBuffer();
|
||||
buffer.addAll(Arrays.asList(getFullElements()));
|
||||
return SynchronizedBuffer.decorate(buffer);
|
||||
}
|
||||
|
||||
public Collection makeConfirmedCollection() {
|
||||
ArrayStack list = new ArrayStack();
|
||||
return list;
|
||||
}
|
||||
|
||||
public Collection makeConfirmedFullCollection() {
|
||||
ArrayStack list = new ArrayStack();
|
||||
list.addAll(Arrays.asList(getFullElements()));
|
||||
return list;
|
||||
}
|
||||
|
||||
public boolean isNullSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// resetEmpty();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/SynchronizedBuffer.emptyCollection.version3.1.obj");
|
||||
// resetFull();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/SynchronizedBuffer.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
/*
|
||||
* Copyright 2004 The Apache Software Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.commons.collections.buffer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.apache.commons.collections.ArrayStack;
|
||||
import org.apache.commons.collections.Buffer;
|
||||
import org.apache.commons.collections.collection.AbstractTestCollection;
|
||||
|
||||
/**
|
||||
* Extension of {@link AbstractTestCollection} for exercising the
|
||||
* {@link UnmodifiableBuffer} implementation.
|
||||
*
|
||||
* @since Commons Collections 3.1
|
||||
* @version $Revision: 1.1 $ $Date: 2004/06/02 22:05:54 $
|
||||
*
|
||||
* @author Phil Steitz
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public class TestUnmodifiableBuffer extends AbstractTestCollection {
|
||||
|
||||
public TestUnmodifiableBuffer(String testName) {
|
||||
super(testName);
|
||||
}
|
||||
|
||||
public static Test suite() {
|
||||
return new TestSuite(TestUnmodifiableBuffer.class);
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
String[] testCaseName = { TestUnmodifiableBuffer.class.getName()};
|
||||
junit.textui.TestRunner.main(testCaseName);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
public Collection makeCollection() {
|
||||
return UnmodifiableBuffer.decorate(new UnboundedFifoBuffer());
|
||||
}
|
||||
|
||||
public Collection makeFullCollection() {
|
||||
Buffer buffer = new UnboundedFifoBuffer();
|
||||
buffer.addAll(Arrays.asList(getFullElements()));
|
||||
return UnmodifiableBuffer.decorate(buffer);
|
||||
}
|
||||
|
||||
public Collection makeConfirmedCollection() {
|
||||
ArrayStack list = new ArrayStack();
|
||||
return list;
|
||||
}
|
||||
|
||||
public Collection makeConfirmedFullCollection() {
|
||||
ArrayStack list = new ArrayStack();
|
||||
list.addAll(Arrays.asList(getFullElements()));
|
||||
return list;
|
||||
}
|
||||
|
||||
public boolean isAddSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isRemoveSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isNullSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void testBufferRemove() {
|
||||
resetEmpty();
|
||||
Buffer buffer = (Buffer) collection;
|
||||
try {
|
||||
buffer.remove();
|
||||
fail();
|
||||
} catch (UnsupportedOperationException ex) {}
|
||||
}
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// resetEmpty();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/UnmodifiableBuffer.emptyCollection.version3.1.obj");
|
||||
// resetFull();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/UnmodifiableBuffer.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
|
@ -31,7 +31,7 @@ import org.apache.commons.collections.PredicateUtils;
|
|||
* {@link PredicatedCollection} implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2004/02/18 01:20:40 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/06/02 22:06:33 $
|
||||
*
|
||||
* @author Phil Steitz
|
||||
*/
|
||||
|
@ -50,7 +50,7 @@ public class TestPredicatedCollection extends AbstractTestCollection {
|
|||
junit.textui.TestRunner.main(testCaseName);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
protected Predicate truePredicate = PredicateUtils.truePredicate();
|
||||
|
||||
|
@ -131,4 +131,15 @@ public class TestPredicatedCollection extends AbstractTestCollection {
|
|||
!c.contains("four"));
|
||||
}
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// resetEmpty();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/PredicatedCollection.emptyCollection.version3.1.obj");
|
||||
// resetFull();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/PredicatedCollection.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.apache.commons.collections.TransformerUtils;
|
|||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.6 $ $Date: 2004/04/10 22:22:57 $
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:06:33 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
@ -103,5 +103,16 @@ public class TestTransformedCollection extends AbstractTestCollection {
|
|||
|
||||
assertEquals(true, coll.remove(new Integer((String) els[0])));
|
||||
}
|
||||
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// resetEmpty();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/TransformedCollection.emptyCollection.version3.1.obj");
|
||||
// resetFull();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/TransformedCollection.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import junit.framework.TestSuite;
|
|||
* {@link UnmodifiableCollection} implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2004/02/18 01:20:40 $
|
||||
* @version $Revision: 1.4 $ $Date: 2004/06/02 22:06:33 $
|
||||
*
|
||||
* @author Phil Steitz
|
||||
* @author Stephen Colebourne
|
||||
|
@ -78,4 +78,15 @@ public class TestUnmodifiableCollection extends AbstractTestCollection {
|
|||
return false;
|
||||
}
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// resetEmpty();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/UnmodifiableCollection.emptyCollection.version3.1.obj");
|
||||
// resetFull();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/UnmodifiableCollection.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import junit.framework.TestSuite;
|
|||
* Entry point for tests.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.7 $ $Date: 2004/06/01 23:08:04 $
|
||||
* @version $Revision: 1.8 $ $Date: 2004/06/02 22:07:53 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
@ -50,7 +50,7 @@ public class TestAll extends TestCase {
|
|||
suite.addTest(TestSetUniqueList.suite());
|
||||
suite.addTest(TestSynchronizedList.suite());
|
||||
suite.addTest(TestTransformedList.suite());
|
||||
// suite.addTest(TestTypedList.suite());
|
||||
suite.addTest(TestTypedList.suite());
|
||||
suite.addTest(TestUnmodifiableList.suite());
|
||||
|
||||
return suite;
|
||||
|
|
|
@ -27,7 +27,7 @@ import junit.framework.TestSuite;
|
|||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.5 $ $Date: 2004/02/18 01:20:34 $
|
||||
* @version $Revision: 1.6 $ $Date: 2004/06/02 22:07:53 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
|
@ -64,4 +64,15 @@ public class TestFixedSizeList extends AbstractTestList {
|
|||
return false;
|
||||
}
|
||||
|
||||
public String getCompatibilityVersion() {
|
||||
return "3.1";
|
||||
}
|
||||
|
||||
// public void testCreate() throws Exception {
|
||||
// resetEmpty();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/FixedSizeList.emptyCollection.version3.1.obj");
|
||||
// resetFull();
|
||||
// writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/FixedSizeList.fullCollection.version3.1.obj");
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue