use of io.atlasmap.spi.AtlasConversionInfo in project atlasmap by atlasmap.
the class StringConverterTest method checkAnnotations.
@Test
public void checkAnnotations() throws Exception {
Class<?> aClass = StringConverter.class;
Method[] methods = aClass.getMethods();
for (Method method : methods) {
if (method.isSynthetic()) {
// We are running in Eclipse or jacoco
continue;
}
if (method.getName().startsWith("convert")) {
Annotation[] annotations = method.getDeclaredAnnotations();
assertNotNull(annotations);
assertTrue(annotations.length > 0);
for (Annotation annotation : annotations) {
assertTrue(AtlasConversionInfo.class.isAssignableFrom(annotation.annotationType()));
AtlasConversionInfo atlasConversionInfo = (AtlasConversionInfo) annotation;
assertNotNull(atlasConversionInfo.sourceType());
assertTrue(atlasConversionInfo.sourceType().compareTo(FieldType.STRING) == 0);
assertNotNull(atlasConversionInfo.targetType());
for (AtlasConversionConcern atlasConversionConcern : atlasConversionInfo.concerns()) {
assertNotNull(atlasConversionConcern.getMessage(atlasConversionInfo));
assertNotNull(atlasConversionConcern.value());
}
}
}
}
}
use of io.atlasmap.spi.AtlasConversionInfo in project atlasmap by atlasmap.
the class ShortConverterTest method checkAnnotations.
@Test
public void checkAnnotations() throws Exception {
Class<?> aClass = ShortConverter.class;
Method[] methods = aClass.getMethods();
for (Method method : methods) {
if (method.isSynthetic()) {
// We are running in Eclipse or jacoco
continue;
}
if (method.getName().startsWith("convert")) {
Annotation[] annotations = method.getDeclaredAnnotations();
assertNotNull(annotations);
assertTrue(annotations.length > 0);
for (Annotation annotation : annotations) {
assertTrue(AtlasConversionInfo.class.isAssignableFrom(annotation.annotationType()));
AtlasConversionInfo atlasConversionInfo = (AtlasConversionInfo) annotation;
assertNotNull(atlasConversionInfo.sourceType());
assertTrue(atlasConversionInfo.sourceType().compareTo(FieldType.SHORT) == 0);
assertNotNull(atlasConversionInfo.targetType());
for (AtlasConversionConcern atlasConversionConcern : atlasConversionInfo.concerns()) {
assertNotNull(atlasConversionConcern.getMessage(atlasConversionInfo));
assertNotNull(atlasConversionConcern.value());
}
}
}
}
}
use of io.atlasmap.spi.AtlasConversionInfo in project atlasmap by atlasmap.
the class ByteConverterTest method checkAnnotations.
@Test
public void checkAnnotations() throws Exception {
Class<?> aClass = ByteConverter.class;
Method[] methods = aClass.getMethods();
for (Method method : methods) {
if (method.isSynthetic()) {
// We are running in Eclipse or jacoco
continue;
}
if (method.getName().startsWith("convert")) {
Annotation[] annotations = method.getDeclaredAnnotations();
assertNotNull(annotations);
assertTrue(annotations.length > 0);
for (Annotation annotation : annotations) {
assertTrue(AtlasConversionInfo.class.isAssignableFrom(annotation.annotationType()));
AtlasConversionInfo atlasConversionInfo = (AtlasConversionInfo) annotation;
assertNotNull(atlasConversionInfo.sourceType());
assertTrue(atlasConversionInfo.sourceType().compareTo(FieldType.BYTE) == 0);
assertNotNull(atlasConversionInfo.targetType());
for (AtlasConversionConcern atlasConversionConcern : atlasConversionInfo.concerns()) {
assertNotNull(atlasConversionConcern.getMessage(atlasConversionInfo));
assertNotNull(atlasConversionConcern.value());
}
}
}
}
}
use of io.atlasmap.spi.AtlasConversionInfo in project atlasmap by atlasmap.
the class CharSequenceConverterTest method checkAnnotations.
@Test
public void checkAnnotations() throws Exception {
Class<?> aClass = CharSequenceConverter.class;
Method[] methods = aClass.getMethods();
for (Method method : methods) {
if (method.isSynthetic()) {
// We are running in Eclipse or jacoco
continue;
}
if (method.getName().startsWith("convert")) {
Annotation[] annotations = method.getDeclaredAnnotations();
assertNotNull(annotations);
assertTrue(annotations.length > 0);
for (Annotation annotation : annotations) {
assertTrue(AtlasConversionInfo.class.isAssignableFrom(annotation.annotationType()));
AtlasConversionInfo atlasConversionInfo = (AtlasConversionInfo) annotation;
assertNotNull(atlasConversionInfo.sourceType());
assertTrue(atlasConversionInfo.sourceType().compareTo(FieldType.STRING) == 0);
assertNotNull(atlasConversionInfo.targetType());
for (AtlasConversionConcern atlasConversionConcern : atlasConversionInfo.concerns()) {
assertNotNull(atlasConversionConcern.getMessage(atlasConversionInfo));
assertNotNull(atlasConversionConcern.value());
}
}
}
}
}
use of io.atlasmap.spi.AtlasConversionInfo in project atlasmap by atlasmap.
the class CharacterConverterTest method checkAnnotations.
@Test
public void checkAnnotations() throws Exception {
Class<?> aClass = CharacterConverter.class;
Method[] methods = aClass.getMethods();
for (Method method : methods) {
if (method.isSynthetic()) {
// We are running in Eclipse or jacoco
continue;
}
if (method.getName().startsWith("convert")) {
Annotation[] annotations = method.getDeclaredAnnotations();
assertNotNull(annotations);
assertTrue(annotations.length > 0);
for (Annotation annotation : annotations) {
assertTrue(AtlasConversionInfo.class.isAssignableFrom(annotation.annotationType()));
AtlasConversionInfo atlasConversionInfo = (AtlasConversionInfo) annotation;
assertNotNull(atlasConversionInfo.sourceType());
assertTrue(atlasConversionInfo.sourceType().compareTo(FieldType.CHAR) == 0);
assertNotNull(atlasConversionInfo.targetType());
for (AtlasConversionConcern atlasConversionConcern : atlasConversionInfo.concerns()) {
assertNotNull(atlasConversionConcern.getMessage(atlasConversionInfo));
assertNotNull(atlasConversionConcern.value());
}
}
}
}
}
Aggregations