congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AbstractTestCollection.makeCollection
Code IndexAdd Tabnine to your IDE (free)

How to use
makeCollection
method
in
org.apache.commons.collections.collection.AbstractTestCollection

Best Java code snippets using org.apache.commons.collections.collection.AbstractTestCollection.makeCollection (Showing top 4 results out of 315)

origin: commons-collections/commons-collections

/**
 *  Returns an empty collection for Object tests.
 */
public Object makeObject() {
  return makeCollection();
}
origin: commons-collections/commons-collections

/**
 *  Returns a full collection to be used for testing.  The collection
 *  returned by this method should contain every element returned by
 *  {@link #getFullElements()}.  The default implementation, in fact,
 *  simply invokes <code>addAll</code> on an empty collection with
 *  the results of {@link #getFullElements()}.  Override this default
 *  if your collection doesn't support addAll.
 */
public Collection makeFullCollection() {
  Collection c = makeCollection();
  c.addAll(Arrays.asList(getFullElements()));
  return c;
}
origin: commons-collections/commons-collections

/**
 *  Resets the {@link #collection} and {@link #confirmed} fields to empty
 *  collections.  Invoke this method before performing a modification
 *  test.
 */
public void resetEmpty() {
  this.collection = makeCollection();
  this.confirmed = makeConfirmedCollection();
}
origin: commons-collections/commons-collections

public void testSerializeDeserializeThenCompare() throws Exception {
  Object obj = makeCollection();
  if (obj instanceof Serializable && isTestSerialization()) {
    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    ObjectOutputStream out = new ObjectOutputStream(buffer);
    out.writeObject(obj);
    out.close();
    ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()));
    Object dest = in.readObject();
    in.close();
    if (isEqualsCheckable()) {
      assertEquals("obj != deserialize(serialize(obj)) - EMPTY Collection", obj, dest);
    }
  }
  obj = makeFullCollection();
  if (obj instanceof Serializable && isTestSerialization()) {
    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    ObjectOutputStream out = new ObjectOutputStream(buffer);
    out.writeObject(obj);
    out.close();
    ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()));
    Object dest = in.readObject();
    in.close();
    if (isEqualsCheckable()) {
      assertEquals("obj != deserialize(serialize(obj)) - FULL Collection", obj, dest);
    }
  }
}

org.apache.commons.collections.collectionAbstractTestCollectionmakeCollection

Javadoc

Return a new, empty Collection to be used for testing.

Popular methods of AbstractTestCollection

  • areEqualElementsDistinguishable
    Specifies whether equal elements in the collection are, in fact, distinguishable with information no
  • assertEquals
  • assertTrue
  • cloneMapEntry
    Creates a new Map Entry that is independent of the first and the map.
  • fail
  • getFullElements
    Returns an array of objects that are contained in a collection produced by #makeFullCollection(). Ev
  • getFullNonNullElements
    Returns a list of elements suitable for return by #getFullElements(). The array returned by this met
  • getOtherElements
    Returns an array of elements that are not contained in a full collection. Every element in the retur
  • getOtherNonNullElements
    Returns the default list of objects returned by #getOtherElements(). Includes many objects of differ
  • isAddSupported
    Returns true if the collections produced by #makeCollection() and #makeFullCollection()support the a
  • isEqualsCheckable
    Returns true to indicate that the collection supports equals() comparisons. This implementation retu
  • isFailFastSupported
    Returns true to indicate that the collection supports fail fast iterators. The default implementatio
  • isEqualsCheckable,
  • isFailFastSupported,
  • isNullSupported,
  • isRemoveSupported,
  • isTestSerialization,
  • makeConfirmedCollection,
  • makeConfirmedFullCollection,
  • makeFullCollection,
  • resetEmpty

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • JTable (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now