use of com.axway.ats.rbv.model.MetaDataIncorrectException in project ats-framework by Axway.
the class Test_MetaDataIncorrectException method constructors.
@Test
public void constructors() {
MetaDataIncorrectException exception;
exception = new MetaDataIncorrectException("test");
assertEquals("test", exception.getMessage());
assertNull(exception.getCause());
Exception helperException = new Exception();
exception = new MetaDataIncorrectException("test", helperException);
assertEquals("test", exception.getMessage());
assertEquals(helperException, exception.getCause());
exception = new MetaDataIncorrectException(helperException);
assertEquals("java.lang.Exception", exception.getMessage());
assertEquals(helperException, exception.getCause());
}
use of com.axway.ats.rbv.model.MetaDataIncorrectException in project ats-framework by Axway.
the class DbBinaryFieldRule method performMatch.
@Override
protected boolean performMatch(MetaData metaData) throws RbvException {
boolean actualResult = false;
//this cast is safe, as isMatch has already checked the type of meta data
DbMetaData dbMetaData = (DbMetaData) metaData;
byte[] actualValue;
try {
actualValue = (byte[]) dbMetaData.getProperty(expectedMetaDataKey.toString());
} catch (ClassCastException cce) {
throw new MetaDataIncorrectException("Meta data is incorrect - expected byte[]");
}
if (Arrays.equals((byte[]) expectedValue, actualValue)) {
actualResult = true;
}
return actualResult;
}
Aggregations