public abstract class AbstractZipSubject<S extends com.google.common.truth.Subject<S,T>,T extends Zip>
extends com.google.common.truth.Subject<S,T>
implements java.io.Closeable
| Constructor and Description |
|---|
AbstractZipSubject(com.google.common.truth.FailureStrategy failureStrategy,
T subject) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
abstract void |
contains(java.lang.String path)
Asserts the zip file contains a file with the specified path.
|
void |
containsFileWithContent(java.lang.String path,
byte[] content)
Asserts the zip file contains a file with the specified byte array content.
|
void |
containsFileWithContent(java.lang.String path,
java.lang.String content)
Asserts the zip file contains a file with the specified String content.
|
void |
containsFileWithMatch(java.lang.String path,
java.lang.String pattern) |
void |
containsFileWithoutContent(java.lang.String path,
java.lang.String sub)
Asserts the zip file contains a file without the specified byte sequence
anywhere in the file
|
abstract void |
doesNotContain(java.lang.String path)
Asserts the zip file does not contains a file with the specified path.
|
void |
doesNotExist() |
com.google.common.truth.IterableSubject<? extends com.google.common.truth.IterableSubject<?,java.lang.String,java.util.List<java.lang.String>>,java.lang.String,java.util.List<java.lang.String>> |
entries(java.lang.String conformingTo)
Returns a
IterableSubject of all the Zip entries which name matches the passed
regular expression. |
void |
exists() |
protected byte[] |
extractContentAsBytes(java.lang.String path) |
protected java.lang.String |
extractContentAsString(java.lang.String path) |
check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutSubject, failWithRawMessage, getDisplaySubject, getSubject, hashCode, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, namedpublic AbstractZipSubject(@NonNull
com.google.common.truth.FailureStrategy failureStrategy,
@NonNull
T subject)
public abstract void contains(@NonNull
java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic abstract void doesNotContain(@NonNull
java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic final com.google.common.truth.IterableSubject<? extends com.google.common.truth.IterableSubject<?,java.lang.String,java.util.List<java.lang.String>>,java.lang.String,java.util.List<java.lang.String>> entries(@NonNull
java.lang.String conformingTo)
throws java.io.IOException
IterableSubject of all the Zip entries which name matches the passed
regular expression.conformingTo - a regular expression to match entries we are interested in.IterableSubject propositions for matching entries.java.io.IOException - of the zip file cannot be opened.public final void containsFileWithContent(@NonNull
java.lang.String path,
@NonNull
java.lang.String content)
throws java.io.IOException
Content is trimmed when compared.
java.io.IOExceptionpublic final void containsFileWithMatch(@NonNull
java.lang.String path,
@NonNull
java.lang.String pattern)
throws java.io.IOException
java.io.IOExceptionpublic final void containsFileWithContent(@NonNull
java.lang.String path,
@NonNull
byte[] content)
throws java.io.IOException
java.io.IOExceptionpublic final void containsFileWithoutContent(@NonNull
java.lang.String path,
@NonNull
java.lang.String sub)
public final void exists()
public final void doesNotExist()
public final void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableprotected final java.lang.String extractContentAsString(@NonNull
java.lang.String path)
@Nullable
protected final byte[] extractContentAsBytes(@NonNull
java.lang.String path)