use of io.atlasmap.spi.AtlasConversionConcern 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.AtlasConversionConcern in project atlasmap by atlasmap.
the class IntegerConverterTest method checkAnnotations.
@Test
public void checkAnnotations() throws Exception {
Class<?> aClass = IntegerConverter.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.INTEGER) == 0);
assertNotNull(atlasConversionInfo.targetType());
for (AtlasConversionConcern atlasConversionConcern : atlasConversionInfo.concerns()) {
assertNotNull(atlasConversionConcern.getMessage(atlasConversionInfo));
assertNotNull(atlasConversionConcern.value());
}
}
}
}
}
use of io.atlasmap.spi.AtlasConversionConcern in project atlasmap by atlasmap.
the class LongConverterTest method checkAnnotations.
@Test
public void checkAnnotations() throws Exception {
Class<?> aClass = LongConverter.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.LONG) == 0);
assertNotNull(atlasConversionInfo.targetType());
for (AtlasConversionConcern atlasConversionConcern : atlasConversionInfo.concerns()) {
assertNotNull(atlasConversionConcern.getMessage(atlasConversionInfo));
assertNotNull(atlasConversionConcern.value());
}
}
}
}
}
use of io.atlasmap.spi.AtlasConversionConcern 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.AtlasConversionConcern 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