Top Inners Fields Constructors Methods
org.junit.jupiter.params.provider

pack-priv Class CsvFileArgumentsProvider

extends AnnotationBasedArgumentsProvider<CsvFileSource>
Class Inheritance
Imports
java.io.IOException, .InputStream, java.nio.charset.Charset, java.nio.file.Files, .Path, java.util.Arrays, .List, .Spliterator, java.util.function.Consumer, java.util.stream.Stream, .StreamSupport, de.siegmar.fastcsv.reader.CsvReader, .CsvRecord, org.junit.jupiter.api.extension.ExtensionContext, org.junit.jupiter.params.support.ParameterDeclarations, org.junit.platform.commons.JUnitException, .PreconditionViolationException, org.junit.platform.commons.util.Preconditions

Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
private static class
pack-priv static interface
pack-priv static interface

Field Summary

Modifier and TypeField and Description
private final CsvFileArgumentsProvider.InputStreamProvider

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static Charset
protected Stream<? extends Arguments>
provideArguments(ParameterDeclarations parameters, ExtensionContext context, CsvFileSource csvFileSource)

Overrides org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider.provideArguments.

The returned Stream will be properly closed by the default implementation of provideArguments(ParameterDeclarations, ExtensionContext), making it safe to use a resource such as Files.lines().

private static Stream<Arguments>
toStream(CsvReader<? extends CsvRecord> reader, CsvFileSource csvFileSource)

Inherited from org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider:
acceptprovideArgumentsprovideArguments

Field Detail

inputStreamProviderback to summary
private final CsvFileArgumentsProvider.InputStreamProvider inputStreamProvider

Constructor Detail

CsvFileArgumentsProviderback to summary
pack-priv CsvFileArgumentsProvider()
CsvFileArgumentsProviderback to summary
pack-priv CsvFileArgumentsProvider(CsvFileArgumentsProvider.InputStreamProvider inputStreamProvider)

Method Detail

getCharsetFromback to summary
private static Charset getCharsetFrom(CsvFileSource csvFileSource)
provideArgumentsback to summary
protected Stream<? extends Arguments> provideArguments(ParameterDeclarations parameters, ExtensionContext context, CsvFileSource csvFileSource)

Overrides org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider.provideArguments.

Doc from org.junit.jupiter.params.provider.AnnotationBasedArgumentsProvider.provideArguments.

The returned Stream will be properly closed by the default implementation of provideArguments(ParameterDeclarations, ExtensionContext), making it safe to use a resource such as Files.lines().

Annotations
@Override
toStreamback to summary
private static Stream<Arguments> toStream(CsvReader<? extends CsvRecord> reader, CsvFileSource csvFileSource)
org.junit.jupiter.params.provider back to summary

private final Record CsvFileArgumentsProvider.CsvExceptionHandlingSpliterator<T>

extends Record
implements Spliterator<T>
Class Inheritance
All Implemented Interfaces
java.util.Spliterator
Record Components
delegate:Spliterator<T> 
csvFileSource:CsvFileSource 

Field Summary

Modifier and TypeField and Description
private final CsvFileSource
csvFileSource

Record Component accessed by csvFileSource().

private final Spliterator<T>
delegate

Record Component accessed by delegate().

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
characteristics()

Implements java.util.Spliterator.characteristics.

Returns a set of characteristics of this Spliterator and its elements.

public CsvFileSource
csvFileSource()

Record Component getter of csvFileSource.

public Spliterator<T>
delegate()

Record Component getter of delegate.

pack-priv static <T> CsvFileArgumentsProvider.CsvExceptionHandlingSpliterator<T>
delegatingTo(Spliterator<T> delegate, CsvFileSource csvFileSource)

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public long
estimateSize()

Implements java.util.Spliterator.estimateSize.

Returns an estimate of the number of elements that would be encountered by a forEachRemaining traversal, or returns Long#MAX_VALUE if infinite, unknown, or too expensive to compute.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

public boolean
tryAdvance(final Consumer<? super T> action)

Implements java.util.Spliterator.tryAdvance.

If a remaining element exists: performs the given action on it, returning true; else returns false.

public Spliterator<T>
trySplit()

Implements java.util.Spliterator.trySplit.

If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.

Field Detail

csvFileSourceback to summary
private final CsvFileSource csvFileSource

Record Component accessed by csvFileSource().

delegateback to summary
private final Spliterator<T> delegate

Record Component accessed by delegate().

Constructor Detail

CsvExceptionHandlingSpliteratorback to summary
private CsvExceptionHandlingSpliterator(Spliterator<T> delegate, CsvFileSource csvFileSource)

Method Detail

characteristicsback to summary
public int characteristics()

Implements java.util.Spliterator.characteristics.

Doc from java.util.Spliterator.characteristics.

Returns a set of characteristics of this Spliterator and its elements. The result is represented as ORed values from ORDERED, DISTINCT, SORTED, SIZED, NONNULL, IMMUTABLE, CONCURRENT, SUBSIZED. Repeated calls to characteristics() on a given spliterator, prior to or in-between calls to trySplit, should always return the same result.

If a Spliterator reports an inconsistent set of characteristics (either those returned from a single invocation or across multiple invocations), no guarantees can be made about any computation using this Spliterator.

Annotations
@Override
csvFileSourceback to summary
public CsvFileSource csvFileSource()

Record Component getter of csvFileSource.

delegateback to summary
public Spliterator<T> delegate()

Record Component getter of delegate.

delegatingToback to summary
pack-priv static <T> CsvFileArgumentsProvider.CsvExceptionHandlingSpliterator<T> delegatingTo(Spliterator<T> delegate, CsvFileSource csvFileSource)
equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
estimateSizeback to summary
public long estimateSize()

Implements java.util.Spliterator.estimateSize.

Doc from java.util.Spliterator.estimateSize.

Returns an estimate of the number of elements that would be encountered by a forEachRemaining traversal, or returns Long#MAX_VALUE if infinite, unknown, or too expensive to compute.

If this Spliterator is SIZED and has not yet been partially traversed or split, or this Spliterator is SUBSIZED and has not yet been partially traversed, this estimate must be an accurate count of elements that would be encountered by a complete traversal. Otherwise, this estimate may be arbitrarily inaccurate, but must decrease as specified across invocations of trySplit.

Annotations
@Override
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

tryAdvanceback to summary
public boolean tryAdvance(final Consumer<? super T> action)

Implements java.util.Spliterator.tryAdvance.

Doc from java.util.Spliterator.tryAdvance.

If a remaining element exists: performs the given action on it, returning true; else returns false. If this Spliterator is ORDERED the action is performed on the next element in encounter order. Exceptions thrown by the action are relayed to the caller.

Subsequent behavior of a spliterator is unspecified if the action throws an exception.

Annotations
@Override
trySplitback to summary
public Spliterator<T> trySplit()

Implements java.util.Spliterator.trySplit.

Doc from java.util.Spliterator.trySplit.

If this spliterator can be partitioned, returns a Spliterator covering elements, that will, upon return from this method, not be covered by this Spliterator.

If this Spliterator is ORDERED, the returned Spliterator must cover a strict prefix of the elements.

Unless this Spliterator covers an infinite number of elements, repeated calls to trySplit() must eventually return null. Upon non-null return:

  • the value reported for estimateSize() before splitting, must, after splitting, be greater than or equal to estimateSize() for this and the returned Spliterator; and
  • if this Spliterator is SUBSIZED, then estimateSize() for this spliterator before splitting must be equal to the sum of estimateSize() for this and the returned Spliterator after splitting.

This method may return null for any reason, including emptiness, inability to split after traversal has commenced, data structure constraints, and efficiency considerations.

Annotations
@Override
org.junit.jupiter.params.provider back to summary

private Class CsvFileArgumentsProvider.DefaultInputStreamProvider

extends Object
implements InputStreamProvider
Class Inheritance
  • java.lang.Object
  • org.junit.jupiter.params.provider.CsvFileArgumentsProvider.DefaultInputStreamProvider
All Implemented Interfaces
org.junit.jupiter.params.provider.CsvFileArgumentsProvider.InputStreamProvider

Field Summary

Modifier and TypeField and Description
private static final CsvFileArgumentsProvider.DefaultInputStreamProvider

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public InputStream
public InputStream
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
private static final CsvFileArgumentsProvider.DefaultInputStreamProvider INSTANCE

Constructor Detail

DefaultInputStreamProviderback to summary
private DefaultInputStreamProvider()

Method Detail

openClasspathResourceback to summary
public InputStream openClasspathResource(Class<?> baseClass, String path)

Implements org.junit.jupiter.params.provider.CsvFileArgumentsProvider.InputStreamProvider.openClasspathResource.

Annotations
@Override
openFileback to summary
public InputStream openFile(String path)

Implements org.junit.jupiter.params.provider.CsvFileArgumentsProvider.InputStreamProvider.openFile.

Annotations
@Override
org.junit.jupiter.params.provider back to summary

pack-priv Interface CsvFileArgumentsProvider.InputStreamProvider

Known Direct Implementers
org.junit.jupiter.params.provider.CsvFileArgumentsProvider.DefaultInputStreamProvider

Method Summary

Modifier and TypeMethod and Description
public default CsvFileArgumentsProvider.Source
public default CsvFileArgumentsProvider.Source
file(String path)

public InputStream
openClasspathResource(Class<?> baseClass, String path)

public InputStream

Method Detail

classpathResourceback to summary
public default CsvFileArgumentsProvider.Source classpathResource(String path)
fileback to summary
public default CsvFileArgumentsProvider.Source file(String path)
openClasspathResourceback to summary
public InputStream openClasspathResource(Class<?> baseClass, String path)
openFileback to summary
public InputStream openFile(String path)
org.junit.jupiter.params.provider back to summary

pack-priv Interface CsvFileArgumentsProvider.Source

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public InputStream

Method Detail

openback to summary
public InputStream open(ExtensionContext context)