Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
///////////////////////////////////////////////////////////////////////////////////////////////////
// Assertions library provides facilities for the unit testing.
// Copyright (C) 2017 Dmitry Shapovalov.
//
// This file is part of assertions library.
//
// Assertions library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Assertions library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see .
///////////////////////////////////////////////////////////////////////////////////////////////////
package ru.d_shap.assertions;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.Reader;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.LongBuffer;
import java.nio.ShortBuffer;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;
import javax.xml.namespace.QName;
import org.hamcrest.Matcher;
import org.w3c.dom.Attr;
import org.w3c.dom.CharacterData;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import ru.d_shap.assertions.asimp.array.BooleanArrayAssertion;
import ru.d_shap.assertions.asimp.array.ByteArrayAssertion;
import ru.d_shap.assertions.asimp.array.CharArrayAssertion;
import ru.d_shap.assertions.asimp.array.DoubleArrayAssertion;
import ru.d_shap.assertions.asimp.array.FloatArrayAssertion;
import ru.d_shap.assertions.asimp.array.IntArrayAssertion;
import ru.d_shap.assertions.asimp.array.LongArrayAssertion;
import ru.d_shap.assertions.asimp.array.ObjectArrayAssertion;
import ru.d_shap.assertions.asimp.array.ShortArrayAssertion;
import ru.d_shap.assertions.asimp.java.io.BufferedReaderAssertion;
import ru.d_shap.assertions.asimp.java.io.InputStreamAssertion;
import ru.d_shap.assertions.asimp.java.io.ReaderAssertion;
import ru.d_shap.assertions.asimp.java.lang.CharSequenceAssertion;
import ru.d_shap.assertions.asimp.java.lang.ClassAssertion;
import ru.d_shap.assertions.asimp.java.lang.ComparableAssertion;
import ru.d_shap.assertions.asimp.java.lang.IterableAssertion;
import ru.d_shap.assertions.asimp.java.lang.ObjectAssertion;
import ru.d_shap.assertions.asimp.java.lang.ThrowableAssertion;
import ru.d_shap.assertions.asimp.java.nio.ByteBufferAssertion;
import ru.d_shap.assertions.asimp.java.nio.CharBufferAssertion;
import ru.d_shap.assertions.asimp.java.nio.DoubleBufferAssertion;
import ru.d_shap.assertions.asimp.java.nio.FloatBufferAssertion;
import ru.d_shap.assertions.asimp.java.nio.IntBufferAssertion;
import ru.d_shap.assertions.asimp.java.nio.LongBufferAssertion;
import ru.d_shap.assertions.asimp.java.nio.ShortBufferAssertion;
import ru.d_shap.assertions.asimp.java.util.IteratorAssertion;
import ru.d_shap.assertions.asimp.java.util.ListAssertion;
import ru.d_shap.assertions.asimp.java.util.MapAssertion;
import ru.d_shap.assertions.asimp.java.util.SetAssertion;
import ru.d_shap.assertions.asimp.java.util.SortedMapAssertion;
import ru.d_shap.assertions.asimp.java.util.SortedSetAssertion;
import ru.d_shap.assertions.asimp.javax.xml.namespace.QNameAssertion;
import ru.d_shap.assertions.asimp.org.w3c.dom.AttrAssertion;
import ru.d_shap.assertions.asimp.org.w3c.dom.CharacterDataAssertion;
import ru.d_shap.assertions.asimp.org.w3c.dom.DocumentAssertion;
import ru.d_shap.assertions.asimp.org.w3c.dom.ElementAssertion;
import ru.d_shap.assertions.asimp.org.w3c.dom.NodeAssertion;
import ru.d_shap.assertions.asimp.primitive.BooleanAssertion;
import ru.d_shap.assertions.asimp.primitive.ByteAssertion;
import ru.d_shap.assertions.asimp.primitive.CharAssertion;
import ru.d_shap.assertions.asimp.primitive.DoubleAssertion;
import ru.d_shap.assertions.asimp.primitive.FloatAssertion;
import ru.d_shap.assertions.asimp.primitive.IntAssertion;
import ru.d_shap.assertions.asimp.primitive.LongAssertion;
import ru.d_shap.assertions.asimp.primitive.ShortAssertion;
/**
* Entry point of all assertions with the message.
*
* @author Dmitry Shapovalov
*/
public final class MessageAssertion {
private final String _message;
MessageAssertion(final String message) {
super();
_message = message;
}
/**
* Make assertion about the byte.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public ByteAssertion that(final byte actual) {
ByteAssertion assertion = Raw.byteAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the byte.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public ByteAssertion that(final Byte actual) {
ByteAssertion assertion = Raw.byteAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the short.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public ShortAssertion that(final short actual) {
ShortAssertion assertion = Raw.shortAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the short.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public ShortAssertion that(final Short actual) {
ShortAssertion assertion = Raw.shortAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the int.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public IntAssertion that(final int actual) {
IntAssertion assertion = Raw.intAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the int.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public IntAssertion that(final Integer actual) {
IntAssertion assertion = Raw.intAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the long.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public LongAssertion that(final long actual) {
LongAssertion assertion = Raw.longAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the long.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public LongAssertion that(final Long actual) {
LongAssertion assertion = Raw.longAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the float.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public FloatAssertion that(final float actual) {
FloatAssertion assertion = Raw.floatAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the float.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public FloatAssertion that(final Float actual) {
FloatAssertion assertion = Raw.floatAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the double.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public DoubleAssertion that(final double actual) {
DoubleAssertion assertion = Raw.doubleAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the double.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public DoubleAssertion that(final Double actual) {
DoubleAssertion assertion = Raw.doubleAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the boolean.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public BooleanAssertion that(final boolean actual) {
BooleanAssertion assertion = Raw.booleanAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the boolean.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public BooleanAssertion that(final Boolean actual) {
BooleanAssertion assertion = Raw.booleanAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the char.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public CharAssertion that(final char actual) {
CharAssertion assertion = Raw.charAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the char.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public CharAssertion that(final Character actual) {
CharAssertion assertion = Raw.charAssertion();
((BaseAssertion) assertion).initialize(actual, Messages.SIMPLE_MESSAGE, _message);
return assertion;
}
/**
* Make assertion about the object.
*
* @param actual the actual value.
*
* @return the assertion.
*/
public ObjectAssertion that(final Object actual) {
ObjectAssertion assertion = Raw.objectAssertion();
((BaseAssertion