target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void convertToShort() throws Exception { Float df = 0.0f; Short s = converter.toShort(df); assertNotNull(s); assertEquals(0, s, 0.0); } | @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short.MIN_VALUE) { throw new AtlasConversionException( ... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... |
@Test public void convertToShortNull() throws Exception { Float df = null; Short s = converter.toShort(df); assertNull(s); } | @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short.MIN_VALUE) { throw new AtlasConversionException( ... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... |
@Test(expected = AtlasConversionException.class) public void convertToShortExceptionMAX() throws Exception { Float df = Float.MAX_VALUE; converter.toShort(df); } | @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short.MIN_VALUE) { throw new AtlasConversionException( ... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.SHORT, concerns = AtlasConversionConcern.RANGE) public Short toShort(Float value) throws AtlasConversionException { if (value == null) { return null; } if (value > Short.MAX_VALUE || value < Short... |
@Test public void testIsSupportedField() { assertTrue(module.isSupportedField(new XmlField())); assertFalse(module.isSupportedField(new PropertyField())); assertFalse(module.isSupportedField(new ConstantField())); assertTrue(module.isSupportedField(new SimpleField())); } | @Override public Boolean isSupportedField(Field field) { if (super.isSupportedField(field)) { return true; } return field instanceof XmlField; } | XmlModule extends BaseAtlasModule { @Override public Boolean isSupportedField(Field field) { if (super.isSupportedField(field)) { return true; } return field instanceof XmlField; } } | XmlModule extends BaseAtlasModule { @Override public Boolean isSupportedField(Field field) { if (super.isSupportedField(field)) { return true; } return field instanceof XmlField; } } | XmlModule extends BaseAtlasModule { @Override public Boolean isSupportedField(Field field) { if (super.isSupportedField(field)) { return true; } return field instanceof XmlField; } @Override void init(); @Override void processPreValidation(AtlasInternalSession atlasSession); @Override void processPreSourceExecution(At... | XmlModule extends BaseAtlasModule { @Override public Boolean isSupportedField(Field field) { if (super.isSupportedField(field)) { return true; } return field instanceof XmlField; } @Override void init(); @Override void processPreValidation(AtlasInternalSession atlasSession); @Override void processPreSourceExecution(At... |
@Test public void convertToString() { Float df = 0.0f; String s = converter.toString(df); assertNotNull(s); assertTrue("0.0".equals(s)); } | @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.STRING) public String toString(Float value) { return value != null ? String.valueOf(value) : null; } | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.STRING) public String toString(Float value) { return value != null ? String.valueOf(value) : null; } } | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.STRING) public String toString(Float value) { return value != null ? String.valueOf(value) : null; } } | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.STRING) public String toString(Float value) { return value != null ? String.valueOf(value) : null; } @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.DECIMAL) BigDecimal ... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.STRING) public String toString(Float value) { return value != null ? String.valueOf(value) : null; } @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.DECIMAL) BigDecimal ... |
@Test public void convertToStringNull() { Float df = null; String s = converter.toString(df); assertNull(s); } | @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.STRING) public String toString(Float value) { return value != null ? String.valueOf(value) : null; } | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.STRING) public String toString(Float value) { return value != null ? String.valueOf(value) : null; } } | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.STRING) public String toString(Float value) { return value != null ? String.valueOf(value) : null; } } | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.STRING) public String toString(Float value) { return value != null ? String.valueOf(value) : null; } @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.DECIMAL) BigDecimal ... | FloatConverter implements AtlasConverter<Float> { @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.STRING) public String toString(Float value) { return value != null ? String.valueOf(value) : null; } @AtlasConversionInfo(sourceType = FieldType.FLOAT, targetType = FieldType.DECIMAL) BigDecimal ... |
@Test public void convertFromGregorianCalendar() { Date date = converter.toDate((GregorianCalendar) GregorianCalendar.getInstance()); assertNotNull(date); } | @AtlasConversionInfo(sourceType = FieldType.DATE_TIME_TZ, targetType = FieldType.DATE_TIME) public Date toDate(GregorianCalendar calendar) { return zdtConverter.toDate(calendar.toZonedDateTime()); } | GregorianCalendarConverter implements AtlasConverter<GregorianCalendar> { @AtlasConversionInfo(sourceType = FieldType.DATE_TIME_TZ, targetType = FieldType.DATE_TIME) public Date toDate(GregorianCalendar calendar) { return zdtConverter.toDate(calendar.toZonedDateTime()); } } | GregorianCalendarConverter implements AtlasConverter<GregorianCalendar> { @AtlasConversionInfo(sourceType = FieldType.DATE_TIME_TZ, targetType = FieldType.DATE_TIME) public Date toDate(GregorianCalendar calendar) { return zdtConverter.toDate(calendar.toZonedDateTime()); } } | GregorianCalendarConverter implements AtlasConverter<GregorianCalendar> { @AtlasConversionInfo(sourceType = FieldType.DATE_TIME_TZ, targetType = FieldType.DATE_TIME) public Date toDate(GregorianCalendar calendar) { return zdtConverter.toDate(calendar.toZonedDateTime()); } @AtlasConversionInfo(sourceType = FieldType.DA... | GregorianCalendarConverter implements AtlasConverter<GregorianCalendar> { @AtlasConversionInfo(sourceType = FieldType.DATE_TIME_TZ, targetType = FieldType.DATE_TIME) public Date toDate(GregorianCalendar calendar) { return zdtConverter.toDate(calendar.toZonedDateTime()); } @AtlasConversionInfo(sourceType = FieldType.DA... |
@Test public void convertToBoolean() { Short f = 0; Short t = 1; Boolean b = converter.toBoolean(t); assertNotNull(b); assertTrue(b); b = converter.toBoolean(f); assertNotNull(b); assertFalse(b); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } @AtlasConver... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } @AtlasConver... |
@Test public void convertToBooleanNull() { Short l = null; Boolean b = converter.toBoolean(l); assertNull(b); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } @AtlasConver... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } @AtlasConver... |
@Test public void convertToBooleanNegative() { Short dt = -1; Boolean b = converter.toBoolean(dt); assertTrue(b); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } @AtlasConver... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BOOLEAN, concerns = AtlasConversionConcern.CONVENTION) public Boolean toBoolean(Short value) { if (value == null) { return null; } return value == 0 ? Boolean.FALSE : Boolean.TRUE; } @AtlasConver... |
@Test public void convertToByte() throws Exception { Short l = 0; Byte value = (byte) 0; assertEquals(value, converter.toByte(l)); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) { return value.byteValue(); } throw new A... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... |
@Test(expected = AtlasConversionException.class) public void convertToByteOutOfRange() throws Exception { converter.toByte(Short.MAX_VALUE); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) { return value.byteValue(); } throw new A... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... |
@Test public void convertToByteNull() throws Exception { assertNull(converter.toByte(null)); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MAX_VALUE) { return value.byteValue(); } throw new A... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.BYTE, concerns = AtlasConversionConcern.RANGE) public Byte toByte(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value >= Byte.MIN_VALUE && value <= Byte.MA... |
@Test public void convertToCharacter() throws Exception { Short shorty = new Short((short) 4); Character character = converter.toCharacter(shorty); assertNotNull(character); assertEquals(Character.valueOf((char) shorty.shortValue()), character); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value < Character.MIN_VALUE || value > Chara... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... |
@Test public void testWriteValueToDefaultDocument() throws Exception { writeValue("/orders/order/id", "3333333354"); final String expected = "<orders><order><id>3333333354</id></order></orders>"; checkResult(expected); } | private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(true, parentNode)); } String value = convertValue(field); if (segment.isAt... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... |
@Test public void convertToCharacterNull() throws Exception { Short s = null; Character c = converter.toCharacter(s); assertNull(c); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value < Character.MIN_VALUE || value > Chara... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... |
@Test public void convertToCharacterMAX() throws Exception { Short s = Short.MAX_VALUE; Character c = converter.toCharacter(s); assertNotNull(c); assertEquals(Character.valueOf((char) s.shortValue()), c); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value < Character.MIN_VALUE || value > Chara... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... |
@Test(expected = AtlasConversionException.class) public void convertToCharacterMIN() throws Exception { Short s = Short.MIN_VALUE; converter.toCharacter(s); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; } if (value < Character.MIN_VALUE || value > Chara... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.CHAR, concerns = { AtlasConversionConcern.RANGE, AtlasConversionConcern.CONVENTION }) public Character toCharacter(Short value) throws AtlasConversionException { if (value == null) { return null; ... |
@Test public void convertToDouble() { Short s = 0; Double d = converter.toDouble(s); assertNotNull(d); assertEquals(0.0, d, 0.0); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) ... |
@Test public void convertToDoubleNull() { Short s = null; Double d = converter.toDouble(s); assertNull(d); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) ... |
@Test public void convertToDoubleMAX() { Short s = Short.MAX_VALUE; Double d = converter.toDouble(s); assertNotNull(d); assertEquals(Short.MAX_VALUE, s, 0.0); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DOUBLE) public Double toDouble(Short value) { if (value == null) { return null; } return value.doubleValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) ... |
@Test public void convertToFloat() { Short s = 0; Float f = converter.toFloat(s); assertNotNull(f); assertEquals(0.0f, f, 0.0); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigD... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigD... |
@Test public void convertToFloatNull() { assertNull(converter.toFloat(null)); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigD... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigD... |
@Test public void convertToFloatMAX() { Short s = Short.MAX_VALUE; Float f = converter.toFloat(s); assertNotNull(f); assertEquals(Short.MAX_VALUE, s, 0.0); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigD... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.FLOAT) public Float toFloat(Short value) { if (value == null) { return null; } return value.floatValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigD... |
@Test public void convertToInteger() { Short s = 0; Integer i = converter.toInteger(s); assertNotNull(i); assertEquals(0, i, 0.0); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.INTEGER) public Integer toInteger(Short value) { if (value == null) { return null; } return value.intValue(); } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.INTEGER) public Integer toInteger(Short value) { if (value == null) { return null; } return value.intValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.INTEGER) public Integer toInteger(Short value) { if (value == null) { return null; } return value.intValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.INTEGER) public Integer toInteger(Short value) { if (value == null) { return null; } return value.intValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.INTEGER) public Integer toInteger(Short value) { if (value == null) { return null; } return value.intValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) ... |
@Test public void testWriteValueToAttributeWithDefaultDocument() throws Exception { writeValue("/orders/order/id/@custId", "b"); final String expected = "<orders><order><id custId=\"b\"/></order></orders>"; checkResult(expected); } | private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(true, parentNode)); } String value = convertValue(field); if (segment.isAt... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... |
@Test public void testIsSupportedField() { assertTrue(module.isSupportedField(new JavaField())); assertTrue(module.isSupportedField(new JavaEnumField())); assertFalse(module.isSupportedField(new PropertyField())); assertFalse(module.isSupportedField(new ConstantField())); assertTrue(module.isSupportedField(new SimpleFi... | @Override public Boolean isSupportedField(Field field) { if (super.isSupportedField(field)) { return true; } return field instanceof JavaField || field instanceof JavaEnumField; } | JavaModule extends BaseAtlasModule { @Override public Boolean isSupportedField(Field field) { if (super.isSupportedField(field)) { return true; } return field instanceof JavaField || field instanceof JavaEnumField; } } | JavaModule extends BaseAtlasModule { @Override public Boolean isSupportedField(Field field) { if (super.isSupportedField(field)) { return true; } return field instanceof JavaField || field instanceof JavaEnumField; } JavaModule(); } | JavaModule extends BaseAtlasModule { @Override public Boolean isSupportedField(Field field) { if (super.isSupportedField(field)) { return true; } return field instanceof JavaField || field instanceof JavaEnumField; } JavaModule(); @Override void init(); @Override void destroy(); @Override void processPreValidation(Atla... | JavaModule extends BaseAtlasModule { @Override public Boolean isSupportedField(Field field) { if (super.isSupportedField(field)) { return true; } return field instanceof JavaField || field instanceof JavaEnumField; } JavaModule(); @Override void init(); @Override void destroy(); @Override void processPreValidation(Atla... |
@Test public void convertToIntegerNull() { Short l = null; Integer i = converter.toInteger(l); assertNull(i); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.INTEGER) public Integer toInteger(Short value) { if (value == null) { return null; } return value.intValue(); } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.INTEGER) public Integer toInteger(Short value) { if (value == null) { return null; } return value.intValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.INTEGER) public Integer toInteger(Short value) { if (value == null) { return null; } return value.intValue(); } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.INTEGER) public Integer toInteger(Short value) { if (value == null) { return null; } return value.intValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.INTEGER) public Integer toInteger(Short value) { if (value == null) { return null; } return value.intValue(); } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) ... |
@Test public void convertToLong() { Short s = 1; Long l = converter.toLong(s); assertNotNull(l); assertEquals(1, l, 0.0); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDecim... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDecim... |
@Test public void convertToLongNull() { Short s = null; Long l = converter.toLong(s); assertNull(l); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDecim... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDecim... |
@Test public void convertToLongMAX() { Short s = Short.MAX_VALUE; Long l = converter.toLong(s); assertNotNull(l); assertEquals(32767.0, l, 0.0); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDecim... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDecim... |
@Test public void convertToLongMIN() { Short s = Short.MIN_VALUE; Long l = converter.toLong(s); assertNotNull(l); assertEquals(-32768.0, l, 0.0); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDecim... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.LONG) public Long toLong(Short value) { return value != null ? value.longValue() : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDecim... |
@Test public void convertToShort() { Short aShort = 0; Short s = converter.toShort(aShort); assertNotNull(s); assertNotSame(aShort, s); assertEquals(0, s, 0.0); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.SHORT) public Short toShort(Short value) { return value != null ? new Short(value) : null; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.SHORT) public Short toShort(Short value) { return value != null ? new Short(value) : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.SHORT) public Short toShort(Short value) { return value != null ? new Short(value) : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.SHORT) public Short toShort(Short value) { return value != null ? new Short(value) : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDec... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.SHORT) public Short toShort(Short value) { return value != null ? new Short(value) : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDec... |
@Test public void convertToShortNull() { Short l = null; Short s = converter.toShort(l); assertNull(s); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.SHORT) public Short toShort(Short value) { return value != null ? new Short(value) : null; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.SHORT) public Short toShort(Short value) { return value != null ? new Short(value) : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.SHORT) public Short toShort(Short value) { return value != null ? new Short(value) : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.SHORT) public Short toShort(Short value) { return value != null ? new Short(value) : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDec... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.SHORT) public Short toShort(Short value) { return value != null ? new Short(value) : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal toBigDec... |
@Test public void convertToString() { Short l = 0; String s = converter.toString(l); assertNotNull(s); assertTrue("0".equals(s)); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.STRING) public String toString(Short value) { return value != null ? String.valueOf(value) : null; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.STRING) public String toString(Short value) { return value != null ? String.valueOf(value) : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.STRING) public String toString(Short value) { return value != null ? String.valueOf(value) : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.STRING) public String toString(Short value) { return value != null ? String.valueOf(value) : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.STRING) public String toString(Short value) { return value != null ? String.valueOf(value) : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal ... |
@Test public void convertToStringNull() { Short l = null; String s = converter.toString(l); assertNull(s); } | @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.STRING) public String toString(Short value) { return value != null ? String.valueOf(value) : null; } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.STRING) public String toString(Short value) { return value != null ? String.valueOf(value) : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.STRING) public String toString(Short value) { return value != null ? String.valueOf(value) : null; } } | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.STRING) public String toString(Short value) { return value != null ? String.valueOf(value) : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal ... | ShortConverter implements AtlasConverter<Short> { @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.STRING) public String toString(Short value) { return value != null ? String.valueOf(value) : null; } @AtlasConversionInfo(sourceType = FieldType.SHORT, targetType = FieldType.DECIMAL) BigDecimal ... |
@Test public void testSupported() { validator = new StringPatternValidator(ValidationScope.ALL, "Must match .*", ".*"); assertTrue(validator.supports(String.class)); } | @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } | StringPatternValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } } | StringPatternValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(ValidationScope scope, String violationMessage, String pat... | StringPatternValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(ValidationScope scope, String violationMessage, String pat... | StringPatternValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(ValidationScope scope, String violationMessage, String pat... |
@Test public void testWriteValueWithSeedDocument() throws Exception { seedDocument = "<orders/>"; writeValue("/orders/order/id/@custId", "b"); writeValue("/orders/order/id", "3333333354"); final String expected = "<orders><order><id custId=\"b\">3333333354</id></order></orders>"; checkResult(expected); } | private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(true, parentNode)); } String value = convertValue(field); if (segment.isAt... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... |
@Test public void testUnsupported() { validator = new StringPatternValidator(ValidationScope.DATA_SOURCE, "Must match [0-9_.]", "[0-9_.]"); assertFalse(validator.supports(Double.class)); } | @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } | StringPatternValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } } | StringPatternValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(ValidationScope scope, String violationMessage, String pat... | StringPatternValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(ValidationScope scope, String violationMessage, String pat... | StringPatternValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(ValidationScope scope, String violationMessage, String pat... |
@Test public void testValidate() { validator = new StringPatternValidator(ValidationScope.MAPPING, "Must match [^A-Za-z0-9_.]", "[^A-Za-z0-9_.]"); validator.validate("This. &* should result in an error", validations, "testValidate"); assertTrue(validationHelper.hasErrors()); validations.clear(); assertFalse(validationH... | @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } | StringPatternValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } } | StringPatternValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(Validat... | StringPatternValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(Validat... | StringPatternValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(Validat... |
@Test public void testValidateUsingMatch() { validator = new StringPatternValidator(ValidationScope.LOOKUP_TABLE, "Must match [0-9]+", "[0-9]+", true); validator.validate("0333", validations, "testValidateUsingMatch"); assertFalse(validationHelper.hasErrors()); validator = new StringPatternValidator(ValidationScope.PRO... | @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } | StringPatternValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } } | StringPatternValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(Validat... | StringPatternValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(Validat... | StringPatternValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringPatternValidator(ValidationScope scope, String violationMessage, String pattern); StringPatternValidator(Validat... |
@Test public void testSupports() { NotEmptyValidator notEmptyValidator = new NotEmptyValidator(ValidationScope.ALL, "violationMessage"); assertTrue(notEmptyValidator.supports(new HashSet<String>())); assertTrue(notEmptyValidator.supports(new ArrayList<String>())); assertTrue(notEmptyValidator.supports(new HashMap<Strin... | @Override public boolean supports(Class<?> clazz) { for (AtlasValidator validator : validators) { if (validator.supports(clazz)) { return true; } } return false; } | CompositeValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { for (AtlasValidator validator : validators) { if (validator.supports(clazz)) { return true; } } return false; } } | CompositeValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { for (AtlasValidator validator : validators) { if (validator.supports(clazz)) { return true; } } return false; } CompositeValidator(List<AtlasValidator> validators); CompositeValidator(AtlasValidator... validators); } | CompositeValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { for (AtlasValidator validator : validators) { if (validator.supports(clazz)) { return true; } } return false; } CompositeValidator(List<AtlasValidator> validators); CompositeValidator(AtlasValidator... validators); @Over... | CompositeValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { for (AtlasValidator validator : validators) { if (validator.supports(clazz)) { return true; } } return false; } CompositeValidator(List<AtlasValidator> validators); CompositeValidator(AtlasValidator... validators); @Over... |
@Test public void testSupportsLookupTables() { LookupTables lookupTables = makeLookupTables(); assertTrue(validator.supports(lookupTables.getClass())); } | @Override public boolean supports(Class<?> clazz) { return LookupTables.class.isAssignableFrom(clazz); } | LookupTableNameValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return LookupTables.class.isAssignableFrom(clazz); } } | LookupTableNameValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return LookupTables.class.isAssignableFrom(clazz); } LookupTableNameValidator(String violationMessage); } | LookupTableNameValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return LookupTables.class.isAssignableFrom(clazz); } LookupTableNameValidator(String violationMessage); @Override boolean supports(Class<?> clazz); @Override void validate(Object target, List<Validation> validations... | LookupTableNameValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return LookupTables.class.isAssignableFrom(clazz); } LookupTableNameValidator(String violationMessage); @Override boolean supports(Class<?> clazz); @Override void validate(Object target, List<Validation> validations... |
@Test public void testValidateDuplicatedNames() { LookupTables lookupTables = makeLookupTables(); validator.validate(lookupTables, validations, null); assertTrue(validationHelper.hasErrors()); assertEquals(ValidationScope.LOOKUP_TABLE, validationHelper.getValidation().get(0).getScope()); assertNull(validationHelper.get... | @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } | LookupTableNameValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } } | LookupTableNameValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } LookupTableNameValidator(String violationMessage); } | LookupTableNameValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } LookupTableNameValidator(String violationMessage); @Override boolean supports(Class<?> clazz); @Override void validat... | LookupTableNameValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } LookupTableNameValidator(String violationMessage); @Override boolean supports(Class<?> clazz); @Override void validat... |
@Test public void testValidateNoDuplicateNames() { LookupTables lookupTables = makeLookupTables(); lookupTables.getLookupTable().remove(2); validator.validate(lookupTables, validations, null); assertFalse(validationHelper.hasErrors()); } | @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } | LookupTableNameValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } } | LookupTableNameValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } LookupTableNameValidator(String violationMessage); } | LookupTableNameValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } LookupTableNameValidator(String violationMessage); @Override boolean supports(Class<?> clazz); @Override void validat... | LookupTableNameValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } LookupTableNameValidator(String violationMessage); @Override boolean supports(Class<?> clazz); @Override void validat... |
@Test public void testSupported() { assertTrue(validator.supports(Map.class)); assertTrue(validator.supports(List.class)); assertTrue(validator.supports(Set.class)); assertTrue(validator.supports(Collection.class)); } | @Override public boolean supports(Class<?> clazz) { return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Map.class) || clazz.isAssignableFrom(Set.class) || clazz.isAssignableFrom(Collection.class); } | NotEmptyValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Map.class) || clazz.isAssignableFrom(Set.class) || clazz.isAssignableFrom(Collection.class); } } | NotEmptyValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Map.class) || clazz.isAssignableFrom(Set.class) || clazz.isAssignableFrom(Collection.class); } NotEmptyValidator(ValidationScope scope, String violationMe... | NotEmptyValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Map.class) || clazz.isAssignableFrom(Set.class) || clazz.isAssignableFrom(Collection.class); } NotEmptyValidator(ValidationScope scope, String violationMe... | NotEmptyValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Map.class) || clazz.isAssignableFrom(Set.class) || clazz.isAssignableFrom(Collection.class); } NotEmptyValidator(ValidationScope scope, String violationMe... |
@Test public void testUnsupported() { assertFalse(validator.supports(HashMap.class)); } | @Override public boolean supports(Class<?> clazz) { return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Map.class) || clazz.isAssignableFrom(Set.class) || clazz.isAssignableFrom(Collection.class); } | NotEmptyValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Map.class) || clazz.isAssignableFrom(Set.class) || clazz.isAssignableFrom(Collection.class); } } | NotEmptyValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Map.class) || clazz.isAssignableFrom(Set.class) || clazz.isAssignableFrom(Collection.class); } NotEmptyValidator(ValidationScope scope, String violationMe... | NotEmptyValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Map.class) || clazz.isAssignableFrom(Set.class) || clazz.isAssignableFrom(Collection.class); } NotEmptyValidator(ValidationScope scope, String violationMe... | NotEmptyValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return clazz.isAssignableFrom(List.class) || clazz.isAssignableFrom(Map.class) || clazz.isAssignableFrom(Set.class) || clazz.isAssignableFrom(Collection.class); } NotEmptyValidator(ValidationScope scope, String violationMe... |
@Test public void testValidate() { List<String> stuff = new ArrayList<>(); stuff.add("one"); stuff.add("two"); validator.validate(stuff, validations, "testValidate-1"); assertFalse(validationHelper.hasErrors()); validator.validate(stuff, validations, "testValidate-2", ValidationStatus.WARN); assertFalse(validationHelpe... | @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } | NotEmptyValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } } | NotEmptyValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NotEmptyValidator(ValidationScope scope, String violationMessage); } | NotEmptyValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NotEmptyValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); boolean suppo... | NotEmptyValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NotEmptyValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); boolean suppo... |
@Test public void testWriteValueWithSeedDocumentWithNamespaces() throws Exception { seedDocument = "<orders xmlns:x=\"http: writeValue("/orders/order/x:id/@custId", "b"); writeValue("/orders/order/x:id", "3333333354"); final String expected = "<orders xmlns:x=\"http: checkResult(expected); } | private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(true, parentNode)); } String value = convertValue(field); if (segment.isAt... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... |
@Test public void testValidateInvalid() { List<String> stuff = new ArrayList<>(); validator.validate(stuff, validations, "testValidateInvalid"); assertTrue(validationHelper.hasErrors()); assertEquals(new Integer(1), new Integer(validationHelper.getCount())); assertEquals(ValidationScope.MAPPING, validationHelper.getVal... | @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } | NotEmptyValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } } | NotEmptyValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NotEmptyValidator(ValidationScope scope, String violationMessage); } | NotEmptyValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NotEmptyValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); boolean suppo... | NotEmptyValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NotEmptyValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); boolean suppo... |
@Test public void testSupported() { assertTrue(validator.supports(String.class)); } | @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } | StringLengthValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } } | StringLengthValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); } | StringLengthValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); @Override boolean supports(Class<?> clazz); @Override void validate(Ob... | StringLengthValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); @Override boolean supports(Class<?> clazz); @Override void validate(Ob... |
@Test public void testUnsupported() { assertFalse(validator.supports(Integer.class)); } | @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } | StringLengthValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } } | StringLengthValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); } | StringLengthValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); @Override boolean supports(Class<?> clazz); @Override void validate(Ob... | StringLengthValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return String.class.isAssignableFrom(clazz); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); @Override boolean supports(Class<?> clazz); @Override void validate(Ob... |
@Test public void testValidate() { String pass = "1112332"; validator.validate(pass, validations, "testValidate"); assertFalse(validationHelper.hasErrors()); } | @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } | StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } } | StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); } | StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); @Override boolean s... | StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); @Override boolean s... |
@Test public void testValidateInvalid() { String pass = ""; validator.validate(pass, validations, "testValidateInvalid"); assertTrue(validationHelper.hasErrors()); assertEquals(new Integer(1), new Integer(validationHelper.getAllValidations().size())); Validation validation = validations.get(0); assertNotNull(validation... | @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } | StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } } | StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); } | StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); @Override boolean s... | StringLengthValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } StringLengthValidator(ValidationScope scope, String violationMessage, int minLength, int maxLength); @Override boolean s... |
@Test public void testSupports() { assertTrue(validator.supports(String.class)); assertTrue(validator.supports(Integer.class)); assertTrue(validator.supports(Double.class)); } | @Override public boolean supports(Class<?> clazz) { return true; } | NonNullValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return true; } } | NonNullValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return true; } NonNullValidator(ValidationScope scope, String violationMessage); } | NonNullValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return true; } NonNullValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); @Override void validate(Object target, List<Validation> validations, String id); @Override void va... | NonNullValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return true; } NonNullValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); @Override void validate(Object target, List<Validation> validations, String id); @Override void va... |
@Test public void testValidate() { String notNull = "notNull"; validator.validate(notNull, validations, null); assertFalse(validationHelper.hasErrors()); } | @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } | NonNullValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } } | NonNullValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NonNullValidator(ValidationScope scope, String violationMessage); } | NonNullValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NonNullValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); @Override void ... | NonNullValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NonNullValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); @Override void ... |
@Test public void testValidateInvalid() { validator.validate(null, validations, null); assertTrue(validationHelper.hasErrors()); assertEquals(new Integer(1), new Integer(validationHelper.getCount())); Validation validation = validationHelper.getAllValidations().get(0); assertNotNull(validation); assertTrue("Cannot be n... | @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } | NonNullValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } } | NonNullValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NonNullValidator(ValidationScope scope, String violationMessage); } | NonNullValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NonNullValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); @Override void ... | NonNullValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { validate(target, validations, id, ValidationStatus.ERROR); } NonNullValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); @Override void ... |
@Test public void testSupported() { assertTrue(validator.supports(Integer.class)); assertTrue(validator.supports(String.class)); } | @Override public boolean supports(Class<?> clazz) { return Integer.class.isAssignableFrom(clazz) || String.class.isAssignableFrom(clazz); } | PositiveIntegerValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return Integer.class.isAssignableFrom(clazz) || String.class.isAssignableFrom(clazz); } } | PositiveIntegerValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return Integer.class.isAssignableFrom(clazz) || String.class.isAssignableFrom(clazz); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); } | PositiveIntegerValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return Integer.class.isAssignableFrom(clazz) || String.class.isAssignableFrom(clazz); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); @Override... | PositiveIntegerValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return Integer.class.isAssignableFrom(clazz) || String.class.isAssignableFrom(clazz); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); @Override... |
@Test public void testUnsupported() { assertFalse(validator.supports(Boolean.class)); } | @Override public boolean supports(Class<?> clazz) { return Integer.class.isAssignableFrom(clazz) || String.class.isAssignableFrom(clazz); } | PositiveIntegerValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return Integer.class.isAssignableFrom(clazz) || String.class.isAssignableFrom(clazz); } } | PositiveIntegerValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return Integer.class.isAssignableFrom(clazz) || String.class.isAssignableFrom(clazz); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); } | PositiveIntegerValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return Integer.class.isAssignableFrom(clazz) || String.class.isAssignableFrom(clazz); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); @Override... | PositiveIntegerValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { return Integer.class.isAssignableFrom(clazz) || String.class.isAssignableFrom(clazz); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> clazz); @Override... |
@Test public void testWriteValueWithSeedDocumentWithDefaultNamespace() throws Exception { seedDocument = "<orders xmlns=\"http: writeValue("/orders/order/id/@custId", "b"); writeValue("/orders/order/id", "3333333354"); final String expected = "<orders xmlns=\"http: checkResult(expected); } | private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(true, parentNode)); } String value = convertValue(field); if (segment.isAt... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... |
@Test public void testValidate() { validator.validate(0, validations, null); validator.validate(1222, validations, null); assertFalse(validationHelper.hasErrors()); } | @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> cl... | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> cl... |
@Test public void testValidateInvalid() { validator.validate(-1, validations, "testValidateInvalid"); assertTrue(validationHelper.hasErrors()); assertEquals(new Integer(1), new Integer(validationHelper.getCount())); assertEquals("testValidateInvalid", validationHelper.getValidation().get(0).getId()); } | @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> cl... | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> cl... |
@Test public void testValidateInvalidWarn() { validator.validate(-1, validations, "testValidateInvalidWarn", ValidationStatus.WARN); assertFalse(validationHelper.hasErrors()); assertTrue(validationHelper.hasWarnings()); assertEquals(new Integer(1), new Integer(validationHelper.getCount())); assertEquals("testValidateIn... | @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> cl... | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> cl... |
@Test public void testValidateInvalidInfo() { validator.validate(-1, validations, "testValidateInvalidInfo", ValidationStatus.INFO); assertFalse(validationHelper.hasErrors()); assertFalse(validationHelper.hasWarnings()); assertTrue(validationHelper.hasInfos()); assertEquals(new Integer(1), new Integer(validationHelper.... | @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> cl... | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> cl... |
@Test public void testValidateWithErrorLevel() { validator.validate(0, validations, "testValidateWithErrorLevel", ValidationStatus.WARN); assertFalse(validationHelper.hasErrors()); assertFalse(validationHelper.hasWarnings()); assertFalse(validationHelper.hasInfos()); } | @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); } | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> cl... | PositiveIntegerValidator implements AtlasValidator { @Override public void validate(Object target, List<Validation> validations, String id) { this.validate(target, validations, id, ValidationStatus.ERROR); } PositiveIntegerValidator(ValidationScope scope, String violationMessage); @Override boolean supports(Class<?> cl... |
@Test public void testGetLastSegmentParent() { AtlasPath p = new AtlasPath("/orders/contact/firstName"); assertEquals("contact", p.getLastSegmentParent().getName()); assertTrue(new AtlasPath("orders").getLastSegmentParent().isRoot()); } | public SegmentContext getLastSegmentParent() { if (this.segmentContexts.isEmpty() || this.segmentContexts.size() == 1) { return null; } return this.segmentContexts.get(this.segmentContexts.size() - 2); } | AtlasPath { public SegmentContext getLastSegmentParent() { if (this.segmentContexts.isEmpty() || this.segmentContexts.size() == 1) { return null; } return this.segmentContexts.get(this.segmentContexts.size() - 2); } } | AtlasPath { public SegmentContext getLastSegmentParent() { if (this.segmentContexts.isEmpty() || this.segmentContexts.size() == 1) { return null; } return this.segmentContexts.get(this.segmentContexts.size() - 2); } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); } | AtlasPath { public SegmentContext getLastSegmentParent() { if (this.segmentContexts.isEmpty() || this.segmentContexts.size() == 1) { return null; } return this.segmentContexts.get(this.segmentContexts.size() - 2); } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); static F... | AtlasPath { public SegmentContext getLastSegmentParent() { if (this.segmentContexts.isEmpty() || this.segmentContexts.size() == 1) { return null; } return this.segmentContexts.get(this.segmentContexts.size() - 2); } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); static F... |
@Test public void testGetLastSegmentParentPath() { AtlasPath p = new AtlasPath("/orders[]/contact/firstName"); assertEquals("/orders[]/contact", p.getLastSegmentParentPath().toString()); assertEquals("/", new AtlasPath("orders").getLastSegmentParentPath().toString()); } | public AtlasPath getLastSegmentParentPath() { if (this.segmentContexts.isEmpty() || this.segmentContexts.size() == 1) { return null; } AtlasPath parentPath = new AtlasPath(); for (int i = 0; i < this.segmentContexts.size() - 1; i++) { parentPath.appendField(this.segmentContexts.get(i).getExpression()); } return parentP... | AtlasPath { public AtlasPath getLastSegmentParentPath() { if (this.segmentContexts.isEmpty() || this.segmentContexts.size() == 1) { return null; } AtlasPath parentPath = new AtlasPath(); for (int i = 0; i < this.segmentContexts.size() - 1; i++) { parentPath.appendField(this.segmentContexts.get(i).getExpression()); } re... | AtlasPath { public AtlasPath getLastSegmentParentPath() { if (this.segmentContexts.isEmpty() || this.segmentContexts.size() == 1) { return null; } AtlasPath parentPath = new AtlasPath(); for (int i = 0; i < this.segmentContexts.size() - 1; i++) { parentPath.appendField(this.segmentContexts.get(i).getExpression()); } re... | AtlasPath { public AtlasPath getLastSegmentParentPath() { if (this.segmentContexts.isEmpty() || this.segmentContexts.size() == 1) { return null; } AtlasPath parentPath = new AtlasPath(); for (int i = 0; i < this.segmentContexts.size() - 1; i++) { parentPath.appendField(this.segmentContexts.get(i).getExpression()); } re... | AtlasPath { public AtlasPath getLastSegmentParentPath() { if (this.segmentContexts.isEmpty() || this.segmentContexts.size() == 1) { return null; } AtlasPath parentPath = new AtlasPath(); for (int i = 0; i < this.segmentContexts.size() - 1; i++) { parentPath.appendField(this.segmentContexts.get(i).getExpression()); } re... |
@Test public void testIsIndexedCollection() { AtlasPath p = null; p = new AtlasPath("order"); assertFalse(p.isIndexedCollection()); p = new AtlasPath("/order/contact/firstName"); assertFalse(p.isIndexedCollection()); p = new AtlasPath("order[]"); assertFalse(p.isIndexedCollection()); p = new AtlasPath("/orders[4]/conta... | public boolean isIndexedCollection() { boolean hasIndexedCollection = false; for (SegmentContext sc : this.segmentContexts) { if (sc.getCollectionType() != CollectionType.NONE) { if (sc.getCollectionIndex() != null) { hasIndexedCollection = true; } } } return hasIndexedCollection; } | AtlasPath { public boolean isIndexedCollection() { boolean hasIndexedCollection = false; for (SegmentContext sc : this.segmentContexts) { if (sc.getCollectionType() != CollectionType.NONE) { if (sc.getCollectionIndex() != null) { hasIndexedCollection = true; } } } return hasIndexedCollection; } } | AtlasPath { public boolean isIndexedCollection() { boolean hasIndexedCollection = false; for (SegmentContext sc : this.segmentContexts) { if (sc.getCollectionType() != CollectionType.NONE) { if (sc.getCollectionIndex() != null) { hasIndexedCollection = true; } } } return hasIndexedCollection; } AtlasPath(String p); pro... | AtlasPath { public boolean isIndexedCollection() { boolean hasIndexedCollection = false; for (SegmentContext sc : this.segmentContexts) { if (sc.getCollectionType() != CollectionType.NONE) { if (sc.getCollectionIndex() != null) { hasIndexedCollection = true; } } } return hasIndexedCollection; } AtlasPath(String p); pro... | AtlasPath { public boolean isIndexedCollection() { boolean hasIndexedCollection = false; for (SegmentContext sc : this.segmentContexts) { if (sc.getCollectionType() != CollectionType.NONE) { if (sc.getCollectionIndex() != null) { hasIndexedCollection = true; } } } return hasIndexedCollection; } AtlasPath(String p); pro... |
@Test public void testGetLastSegment() { AtlasPath p = new AtlasPath("/order/contact/firstName"); assertEquals("firstName", p.getLastSegment().getName()); assertEquals("firstName", p.getLastSegment().getExpression()); assertTrue((new AtlasPath("")).getLastSegment().isRoot()); assertNotNull(p.getOriginalPath()); } | public SegmentContext getLastSegment() { return this.segmentContexts.get(this.segmentContexts.size()-1); } | AtlasPath { public SegmentContext getLastSegment() { return this.segmentContexts.get(this.segmentContexts.size()-1); } } | AtlasPath { public SegmentContext getLastSegment() { return this.segmentContexts.get(this.segmentContexts.size()-1); } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); } | AtlasPath { public SegmentContext getLastSegment() { return this.segmentContexts.get(this.segmentContexts.size()-1); } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); static Field extractChildren(Field f, String path); static void setCollectionIndexRecursively(FieldGroup ... | AtlasPath { public SegmentContext getLastSegment() { return this.segmentContexts.get(this.segmentContexts.size()-1); } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); static Field extractChildren(Field f, String path); static void setCollectionIndexRecursively(FieldGroup ... |
@Test public void testHasCollection() { AtlasPath p = new AtlasPath("/order/contact/firstName"); assertFalse(p.hasCollection()); } | public boolean hasCollection() { for (SegmentContext sc : this.segmentContexts) { if (sc.getCollectionType() != CollectionType.NONE) { return true; } } return false; } | AtlasPath { public boolean hasCollection() { for (SegmentContext sc : this.segmentContexts) { if (sc.getCollectionType() != CollectionType.NONE) { return true; } } return false; } } | AtlasPath { public boolean hasCollection() { for (SegmentContext sc : this.segmentContexts) { if (sc.getCollectionType() != CollectionType.NONE) { return true; } } return false; } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); } | AtlasPath { public boolean hasCollection() { for (SegmentContext sc : this.segmentContexts) { if (sc.getCollectionType() != CollectionType.NONE) { return true; } } return false; } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); static Field extractChildren(Field f, String... | AtlasPath { public boolean hasCollection() { for (SegmentContext sc : this.segmentContexts) { if (sc.getCollectionType() != CollectionType.NONE) { return true; } } return false; } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); static Field extractChildren(Field f, String... |
@Test public void testWriteValueWithSeedDocumentWithNamespacesAddNamespace() throws Exception { seedDocument = "<orders xmlns:x=\"http: namespaces.put("y", "http: writeValue("/orders/y:order/x:id/@custId", "b"); writeValue("/orders/y:order/x:id", "3333333354"); final String expected = "<orders xmlns:x=\"http: checkResu... | private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(true, parentNode)); } String value = convertValue(field); if (segment.isAt... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... |
@Test public void testIsCollectionRoot() { AtlasPath p = new AtlasPath("/order/contact/firstName"); assertFalse(p.isCollectionRoot()); p = new AtlasPath("/order/contact/phone<>"); assertFalse(p.isCollectionRoot()); p = new AtlasPath("/order<>/contact/phone"); assertFalse(p.isCollectionRoot()); p = new AtlasPath("/<>/or... | public Boolean isCollectionRoot() { return this.segmentContexts.size() == 1 && this.segmentContexts.get(0).getCollectionType() != CollectionType.NONE; } | AtlasPath { public Boolean isCollectionRoot() { return this.segmentContexts.size() == 1 && this.segmentContexts.get(0).getCollectionType() != CollectionType.NONE; } } | AtlasPath { public Boolean isCollectionRoot() { return this.segmentContexts.size() == 1 && this.segmentContexts.get(0).getCollectionType() != CollectionType.NONE; } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); } | AtlasPath { public Boolean isCollectionRoot() { return this.segmentContexts.size() == 1 && this.segmentContexts.get(0).getCollectionType() != CollectionType.NONE; } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); static Field extractChildren(Field f, String path); static ... | AtlasPath { public Boolean isCollectionRoot() { return this.segmentContexts.size() == 1 && this.segmentContexts.get(0).getCollectionType() != CollectionType.NONE; } AtlasPath(String p); protected AtlasPath(List<SegmentContext> segments); private AtlasPath(); static Field extractChildren(Field f, String path); static ... |
@Test public void testIsAttributeSegment() { assertFalse(new AtlasPath((String)null).getSegments(true).get(0).isAttribute()); assertFalse(new AtlasPath("order").getSegments(false).get(0).isAttribute()); assertTrue(new AtlasPath("@order").getSegments(false).get(0).isAttribute()); } | public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyList(); } | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... |
@Test public void testGetCollectionIndex() { AtlasPath p = new AtlasPath("orders/order[1]"); assertEquals(new Integer(1), p.getSegments(false).get(1).getCollectionIndex()); p = new AtlasPath("order"); assertEquals(null, p.getSegments(false).get(0).getCollectionIndex()); p = new AtlasPath("orders/order<2>"); assertEqual... | public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyList(); } | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... |
@Test public void testGetSegments() { AtlasPath path = new AtlasPath("/orders"); assertNotNull(path.getSegments(true)); List<SegmentContext> segmentContexts = path.getSegments(true); assertNotNull(segmentContexts); assertEquals(2, segmentContexts.size()); SegmentContext sc = segmentContexts.get(1); assertEquals("orders... | public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyList(); } | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... | AtlasPath { public List<SegmentContext> getSegments(boolean includeRoot) { if (includeRoot) { return Collections.unmodifiableList(this.segmentContexts); } if (this.segmentContexts.size() > 1) { return Collections.unmodifiableList(this.segmentContexts.subList(1, this.segmentContexts.size())); } return Collections.emptyL... |
@Test public void testGetParentSegmentOf() throws Exception { AtlasPath path = new AtlasPath("/orders/order<4>/product<6>/name"); List<SegmentContext> segments = path.getSegments(true); assertEquals(null, path.getParentSegmentOf(segments.get(0))); assertEquals(segments.get(0), path.getParentSegmentOf(segments.get(1)));... | public SegmentContext getParentSegmentOf(SegmentContext sc) { for (int i=0; i<this.segmentContexts.size(); i++) { if (this.segmentContexts.get(i) == sc) { if (sc.isRoot()) { return null; } return this.segmentContexts.get(i-1); } } return null; } | AtlasPath { public SegmentContext getParentSegmentOf(SegmentContext sc) { for (int i=0; i<this.segmentContexts.size(); i++) { if (this.segmentContexts.get(i) == sc) { if (sc.isRoot()) { return null; } return this.segmentContexts.get(i-1); } } return null; } } | AtlasPath { public SegmentContext getParentSegmentOf(SegmentContext sc) { for (int i=0; i<this.segmentContexts.size(); i++) { if (this.segmentContexts.get(i) == sc) { if (sc.isRoot()) { return null; } return this.segmentContexts.get(i-1); } } return null; } AtlasPath(String p); protected AtlasPath(List<SegmentContext>... | AtlasPath { public SegmentContext getParentSegmentOf(SegmentContext sc) { for (int i=0; i<this.segmentContexts.size(); i++) { if (this.segmentContexts.get(i) == sc) { if (sc.isRoot()) { return null; } return this.segmentContexts.get(i-1); } } return null; } AtlasPath(String p); protected AtlasPath(List<SegmentContext>... | AtlasPath { public SegmentContext getParentSegmentOf(SegmentContext sc) { for (int i=0; i<this.segmentContexts.size(); i++) { if (this.segmentContexts.get(i) == sc) { if (sc.isRoot()) { return null; } return this.segmentContexts.get(i-1); } } return null; } AtlasPath(String p); protected AtlasPath(List<SegmentContext>... |
@Test public void testProcessWithoutMappings() throws AtlasException { recreateSession(); context.process(session); assertFalse(printAudit(session), session.hasErrors()); assertTrue(printAudit(session), session.hasWarns()); assertEquals(1, session.getAudits().getAudit().size()); assertEquals("Field mappings should not ... | @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.equals(userSession.getAtlasContext())) { throw new AtlasException(... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... |
@Test public void testProcessValidationWithoutMappings() throws AtlasException { recreateSession(); context.processValidation(session); assertFalse(printAudit(session), session.hasErrors()); assertFalse(printAudit(session), session.hasWarns()); } | @Override public void processValidation(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.equals(userSession.getAtlasContext())) { throw new Atlas... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void processValidation(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } ... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void processValidation(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } ... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void processValidation(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } ... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void processValidation(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } ... |
@Test public void testDefaultAtlasContext() throws AtlasException { File file = Paths.get( "src" + File.separator + "test" + File.separator + "resources" + File.separator + "atlasmapping.json") .toFile(); DefaultAtlasContextFactory factory = DefaultAtlasContextFactory.getInstance(); factory.init(); DefaultAtlasContext ... | public DefaultAtlasContext(URI atlasMappingUri) { this(DefaultAtlasContextFactory.getInstance(), atlasMappingUri); } | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { public DefaultAtlasContext(URI atlasMappingUri) { this(DefaultAtlasContextFactory.getInstance(), atlasMappingUri); } } | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { public DefaultAtlasContext(URI atlasMappingUri) { this(DefaultAtlasContextFactory.getInstance(), atlasMappingUri); } DefaultAtlasContext(URI atlasMappingUri); DefaultAtlasContext(DefaultAtlasContextFactory factory, URI atlasMappingUri); DefaultAtlasCon... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { public DefaultAtlasContext(URI atlasMappingUri) { this(DefaultAtlasContextFactory.getInstance(), atlasMappingUri); } DefaultAtlasContext(URI atlasMappingUri); DefaultAtlasContext(DefaultAtlasContextFactory factory, URI atlasMappingUri); DefaultAtlasCon... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { public DefaultAtlasContext(URI atlasMappingUri) { this(DefaultAtlasContextFactory.getInstance(), atlasMappingUri); } DefaultAtlasContext(URI atlasMappingUri); DefaultAtlasContext(DefaultAtlasContextFactory factory, URI atlasMappingUri); DefaultAtlasCon... |
@Test public void testCreateSession() throws Exception { assertNotNull(context.createSession(mapping)); File file = Paths.get( "src" + File.separator + "test" + File.separator + "resources" + File.separator + "atlasmapping.json") .toFile(); DefaultAtlasContext ctx = new DefaultAtlasContext(file.toURI()); assertNotNull(... | @Override public AtlasSession createSession() throws AtlasException { init(); return doCreateSession(); } | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public AtlasSession createSession() throws AtlasException { init(); return doCreateSession(); } } | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public AtlasSession createSession() throws AtlasException { init(); return doCreateSession(); } DefaultAtlasContext(URI atlasMappingUri); DefaultAtlasContext(DefaultAtlasContextFactory factory, URI atlasMappingUri); DefaultAtlasContext(Defaul... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public AtlasSession createSession() throws AtlasException { init(); return doCreateSession(); } DefaultAtlasContext(URI atlasMappingUri); DefaultAtlasContext(DefaultAtlasContextFactory factory, URI atlasMappingUri); DefaultAtlasContext(Defaul... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public AtlasSession createSession() throws AtlasException { init(); return doCreateSession(); } DefaultAtlasContext(URI atlasMappingUri); DefaultAtlasContext(DefaultAtlasContextFactory factory, URI atlasMappingUri); DefaultAtlasContext(Defaul... |
@Test public void testInit() throws AtlasException { File file = Paths.get( "src" + File.separator + "test" + File.separator + "resources" + File.separator + "atlasmapping.json") .toFile(); DefaultAtlasContext ctx = new DefaultAtlasContext(DefaultAtlasContextFactory.getInstance(), file.toURI()); ctx.init(); DataSource ... | protected synchronized void init() throws AtlasException { if (this.initialized) { return; } registerJmx(this); if (this.atlasMappingUri != null) { this.admHandler = new ADMArchiveHandler(factory.getClassLoader()); this.admHandler.setIgnoreLibrary(true); this.admHandler.load(Paths.get(this.atlasMappingUri)); this.dataS... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { protected synchronized void init() throws AtlasException { if (this.initialized) { return; } registerJmx(this); if (this.atlasMappingUri != null) { this.admHandler = new ADMArchiveHandler(factory.getClassLoader()); this.admHandler.setIgnoreLibrary(true);... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { protected synchronized void init() throws AtlasException { if (this.initialized) { return; } registerJmx(this); if (this.atlasMappingUri != null) { this.admHandler = new ADMArchiveHandler(factory.getClassLoader()); this.admHandler.setIgnoreLibrary(true);... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { protected synchronized void init() throws AtlasException { if (this.initialized) { return; } registerJmx(this); if (this.atlasMappingUri != null) { this.admHandler = new ADMArchiveHandler(factory.getClassLoader()); this.admHandler.setIgnoreLibrary(true);... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { protected synchronized void init() throws AtlasException { if (this.initialized) { return; } registerJmx(this); if (this.atlasMappingUri != null) { this.admHandler = new ADMArchiveHandler(factory.getClassLoader()); this.admHandler.setIgnoreLibrary(true);... |
@Test public void testWriteValueToDefaultDocumentComplex() throws Exception { this.seedDocument = new String(Files.readAllBytes(Paths.get("src/test/resources/complex_example_write.xml"))); writeValue("/orders/order[2]/id[2]", "54554555"); checkResultFromFile("complex_example.xml"); } | private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(true, parentNode)); } String value = convertValue(field); if (segment.isAt... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... |
@Test(expected = AtlasException.class) public void testProcessAtlasExceptionUnspported() throws AtlasException { AtlasSession session = spy(AtlasSession.class); context.process(session); } | @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.equals(userSession.getAtlasContext())) { throw new AtlasException(... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... |
@Test(expected = AtlasException.class) public void testProcessAtlasExceptionOtherContext() throws AtlasException { DefaultAtlasContext context = new DefaultAtlasContext(DefaultAtlasContextFactory.getInstance(), mapping); AtlasSession session = new DefaultAtlasSession(context); new DefaultAtlasContext(DefaultAtlasContex... | @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.equals(userSession.getAtlasContext())) { throw new AtlasException(... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... |
@Test public void testProcess() throws AtlasException { DefaultAtlasSession session = mock(DefaultAtlasSession.class); when(session.getAtlasContext()).thenReturn(context); Head head = mock(Head.class); when(session.head()).thenReturn(head); when(head.setMapping(any(Mapping.class))).thenReturn(head); when(head.setLookup... | @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.equals(userSession.getAtlasContext())) { throw new AtlasException(... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public void process(AtlasSession userSession) throws AtlasException { if (!(userSession instanceof DefaultAtlasSession)) { throw new AtlasException(String.format("Unsupported session class '%s'", userSession.getClass().getName())); } if (!this.... |
@Test public void testProcessPreviewConverter() throws AtlasException { Mapping m = new Mapping(); m.setMappingType(MappingType.MAP); Field source = new SimpleField(); source.setFieldType(FieldType.STRING); source.setValue("404"); Field target = new SimpleField(); target.setFieldType(FieldType.INTEGER); m.getInputField... | @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); List<Field> sourceFields = mapping.getInputField(); List<Field> tar... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... |
@Test public void testProcessPreviewSourceFieldAction() throws AtlasException { Mapping m = new Mapping(); m.setMappingType(MappingType.MAP); Field source = new SimpleField(); source.setFieldType(FieldType.STRING); source.setValue("abc"); ArrayList<Action> actions = new ArrayList<Action>(); actions.add(new Uppercase())... | @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); List<Field> sourceFields = mapping.getInputField(); List<Field> tar... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... |
@Test public void testProcessPreviewTargetFieldAction() throws AtlasException { Mapping m = new Mapping(); m.setMappingType(MappingType.MAP); Field source = new SimpleField(); source.setFieldType(FieldType.STRING); source.setValue("abc"); Field target = new SimpleField(); target.setFieldType(FieldType.STRING); ArrayLis... | @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); List<Field> sourceFields = mapping.getInputField(); List<Field> tar... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... |
@Test public void testProcessPreviewCombine() throws AtlasException { Mapping m = new Mapping(); m.setMappingType(MappingType.COMBINE); Field source1 = new SimpleField(); source1.setFieldType(FieldType.STRING); source1.setIndex(0); source1.setValue("1"); Field source2 = new SimpleField(); source2.setFieldType(FieldType... | @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); List<Field> sourceFields = mapping.getInputField(); List<Field> tar... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... |
@Test public void testProcessPreviewSeparate() throws AtlasException { Mapping m = new Mapping(); m.setMappingType(MappingType.SEPARATE); Field source = new SimpleField(); source.setFieldType(FieldType.STRING); source.setValue("1 2"); Field target1 = new SimpleField(); target1.setFieldType(FieldType.STRING); target1.se... | @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); List<Field> sourceFields = mapping.getInputField(); List<Field> tar... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... |
@Test public void testProcessPreviewSourceFieldGroup() throws AtlasException { Mapping m = new Mapping(); Field source1 = new SimpleField(); source1.setFieldType(FieldType.STRING); source1.setIndex(0); source1.setValue("one"); Field source2 = new SimpleField(); source2.setFieldType(FieldType.STRING); source2.setIndex(1... | @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); List<Field> sourceFields = mapping.getInputField(); List<Field> tar... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... |
@Test public void testProcessPreviewConcatenate() throws AtlasException { Mapping m = new Mapping(); Field source1 = new SimpleField(); source1.setFieldType(FieldType.STRING); source1.setIndex(1); source1.setValue("one"); Field source2 = new SimpleField(); source2.setFieldType(FieldType.STRING); source2.setIndex(3); so... | @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); List<Field> sourceFields = mapping.getInputField(); List<Field> tar... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... |
@Test public void testWriteNewNodeWithAttrToDocumentComplex() throws Exception { this.seedDocument = new String( Files.readAllBytes(Paths.get("src/test/resources/complex_example_write_attr.xml"))); writeValue("/orders/order[2]/id[2]", "54554555"); writeValue("/orders/order[2]/id[2]/@custId", "c"); checkResultFromFile("... | private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(true, parentNode)); } String value = convertValue(field); if (segment.isAt... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... | XmlFieldWriter extends XmlFieldTransformer implements AtlasFieldWriter { private void writeValue(Element parentNode, XmlSegmentContext segment, Field field) throws AtlasException { if (LOG.isDebugEnabled()) { LOG.debug("Writing field value in parent node '{}', parentNode: {}", segment, xmlHelper.writeDocumentToString(t... |
@Test public void testProcessPreviewSplit() throws AtlasException { Mapping m = new Mapping(); Field source = new SimpleField(); source.setFieldType(FieldType.STRING); source.setValue("one two three four"); source.setActions(new ArrayList<>()); Split action = new Split(); action.setDelimiter(" "); source.getActions().a... | @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); List<Field> sourceFields = mapping.getInputField(); List<Field> tar... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... |
@Test public void testProcessPreviewSourceCollection() throws AtlasException { Mapping m = new Mapping(); Field source = new SimpleField(); source.setFieldType(FieldType.STRING); source.setIndex(0); source.setPath("/this<>/is/collection"); source.setValue("one"); source.setActions(new ArrayList<>()); Concatenate action... | @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); List<Field> sourceFields = mapping.getInputField(); List<Field> tar... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... | DefaultAtlasContext implements AtlasContext, AtlasContextMXBean { @Override public Audits processPreview(Mapping mapping) throws AtlasException { DefaultAtlasSession session = new DefaultAtlasSession(this); MappingType mappingType = mapping.getMappingType(); FieldGroup sourceFieldGroup = mapping.getInputFieldGroup(); L... |
@Test public void testValidateAtlasMappingFileHappyPath() { AtlasMapping mapping = getAtlasMappingFullValid(); assertNotNull(mapping); validations.addAll(validationService.validateMapping(mapping)); assertFalse(validationHelper.hasErrors()); assertFalse(validationHelper.hasWarnings()); assertFalse(validationHelper.hasI... | @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource(); for (DataSource ds : dataSources) { switch (ds.getDataSourceTy... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... |
@Test public void testValidateAtlasMappingFileHappyPath2() { AtlasMapping mapping = getAtlasMappingFullValid(); assertNotNull(mapping); validations.addAll(validationService.validateMapping(mapping)); assertFalse(validationHelper.hasErrors()); assertFalse(validationHelper.hasWarnings()); assertFalse(validationHelper.has... | @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource(); for (DataSource ds : dataSources) { switch (ds.getDataSourceTy... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... |
@Test public void testValidateAtlasMappingFileInvalidName() { AtlasMapping mapping = new AtlasMapping(); mapping.setName("thisis in_valid.name"); validations.addAll(validationService.validateMapping(mapping)); assertTrue(validationHelper.hasErrors()); assertFalse(validationHelper.hasWarnings()); assertFalse(validationH... | @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource(); for (DataSource ds : dataSources) { switch (ds.getDataSourceTy... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... |
@Test public void testValidateAtlasMappingFileLookupTablesDuplicateNames() { AtlasMapping mapping = getAtlasMappingWithLookupTables("duplicate_name", "duplicate_name"); validations.addAll(validationService.validateMapping(mapping)); assertTrue(validationHelper.hasErrors()); assertFalse(validationHelper.hasWarnings()); ... | @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource(); for (DataSource ds : dataSources) { switch (ds.getDataSourceTy... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... |
@Test public void testValidateAtlasMappingFileLookupFieldMappingRefNonExistentNames() { AtlasMapping mapping = getAtlasMappingWithLookupTables("table1", "table2"); Mapping lookupFieldMapping = AtlasModelFactory.createMapping(MappingType.LOOKUP); lookupFieldMapping.setLookupTableName("table3"); Field inputField = create... | @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource(); for (DataSource ds : dataSources) { switch (ds.getDataSourceTy... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... | DefaultAtlasValidationService implements AtlasValidationService { @Override public List<Validation> validateMapping(AtlasMapping mapping) { List<Validation> validations = new ArrayList<>(); Validators.MAPPING_NAME.get().validate(mapping.getName(), validations, null); List<DataSource> dataSources = mapping.getDataSource... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.