@Test public void testProcessPropertyFieldMappingDefinedEmptyRuntime() throws Exception { PropertyField propField = AtlasModelFactory.createPropertyField(); propField.setName("prop-int"); propStrategy.readProperty(AtlasTestData.generateAtlasSession(), propField); assertNotNull(propField); assertNotNull(propField.getValue()); assertTrue(propField.getValue() instanceof Integer); assertEquals(new Integer(Integer.MIN_VALUE), new Integer((Integer) propField.getValue())); }
@Override public void readProperty(AtlasSession session, PropertyField propertyField) throws AtlasUnsupportedException, AtlasConversionException { if (propertyField == null || propertyField.getName() == null || propertyField.getName().trim().length() == 0) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Null or empty PropertyField specified popertyField=%s", AtlasModelFactory.toString(propertyField))); } return; } for (AtlasPropertyType propType : getPropertyOrder()) { switch (propType) { case RUNTIME_PROPERTIES: if (session != null && processRuntimeProperties(propertyField, session.getSourceProperties())) { return; } break; case JAVA_SYSTEM_PROPERTIES: if (processJavaSystemProperty(propertyField)) { return; } break; case ENVIRONMENT_VARIABLES: if (processEnvironmentVariable(propertyField)) { return; } break; case MAPPING_DEFINED_PROPERTIES: if (session != null && processMappingDefinedProperties(propertyField, session.getMapping())) { return; } break; default: throw new AtlasUnsupportedException( String.format("Unsupported PropertyType detected type=%s for field=%s", propType, AtlasModelFactory.toString(propertyField))); } } }
DefaultAtlasPropertyStrategy implements AtlasPropertyStrategy { @Override public void readProperty(AtlasSession session, PropertyField propertyField) throws AtlasUnsupportedException, AtlasConversionException { if (propertyField == null || propertyField.getName() == null || propertyField.getName().trim().length() == 0) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Null or empty PropertyField specified popertyField=%s", AtlasModelFactory.toString(propertyField))); } return; } for (AtlasPropertyType propType : getPropertyOrder()) { switch (propType) { case RUNTIME_PROPERTIES: if (session != null && processRuntimeProperties(propertyField, session.getSourceProperties())) { return; } break; case JAVA_SYSTEM_PROPERTIES: if (processJavaSystemProperty(propertyField)) { return; } break; case ENVIRONMENT_VARIABLES: if (processEnvironmentVariable(propertyField)) { return; } break; case MAPPING_DEFINED_PROPERTIES: if (session != null && processMappingDefinedProperties(propertyField, session.getMapping())) { return; } break; default: throw new AtlasUnsupportedException( String.format("Unsupported PropertyType detected type=%s for field=%s", propType, AtlasModelFactory.toString(propertyField))); } } } }
DefaultAtlasPropertyStrategy implements AtlasPropertyStrategy { @Override public void readProperty(AtlasSession session, PropertyField propertyField) throws AtlasUnsupportedException, AtlasConversionException { if (propertyField == null || propertyField.getName() == null || propertyField.getName().trim().length() == 0) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Null or empty PropertyField specified popertyField=%s", AtlasModelFactory.toString(propertyField))); } return; } for (AtlasPropertyType propType : getPropertyOrder()) { switch (propType) { case RUNTIME_PROPERTIES: if (session != null && processRuntimeProperties(propertyField, session.getSourceProperties())) { return; } break; case JAVA_SYSTEM_PROPERTIES: if (processJavaSystemProperty(propertyField)) { return; } break; case ENVIRONMENT_VARIABLES: if (processEnvironmentVariable(propertyField)) { return; } break; case MAPPING_DEFINED_PROPERTIES: if (session != null && processMappingDefinedProperties(propertyField, session.getMapping())) { return; } break; default: throw new AtlasUnsupportedException( String.format("Unsupported PropertyType detected type=%s for field=%s", propType, AtlasModelFactory.toString(propertyField))); } } }  }
DefaultAtlasPropertyStrategy implements AtlasPropertyStrategy { @Override public void readProperty(AtlasSession session, PropertyField propertyField) throws AtlasUnsupportedException, AtlasConversionException { if (propertyField == null || propertyField.getName() == null || propertyField.getName().trim().length() == 0) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Null or empty PropertyField specified popertyField=%s", AtlasModelFactory.toString(propertyField))); } return; } for (AtlasPropertyType propType : getPropertyOrder()) { switch (propType) { case RUNTIME_PROPERTIES: if (session != null && processRuntimeProperties(propertyField, session.getSourceProperties())) { return; } break; case JAVA_SYSTEM_PROPERTIES: if (processJavaSystemProperty(propertyField)) { return; } break; case ENVIRONMENT_VARIABLES: if (processEnvironmentVariable(propertyField)) { return; } break; case MAPPING_DEFINED_PROPERTIES: if (session != null && processMappingDefinedProperties(propertyField, session.getMapping())) { return; } break; default: throw new AtlasUnsupportedException( String.format("Unsupported PropertyType detected type=%s for field=%s", propType, AtlasModelFactory.toString(propertyField))); } } }  @Override void readProperty(AtlasSession session, PropertyField propertyField); @Override void writeProperty(AtlasSession session, PropertyField propertyField); void setPropertyOrderValue(List<String> propertyValues); boolean isEnvironmentPropertiesEnabled(); void setEnvironmentPropertiesEnabled(boolean environmentPropertiesEnabled); boolean isSystemPropertiesEnabled(); void setSystemPropertiesEnabled(boolean systemPropertiesEnabled); boolean isMappingDefinedPropertiesEnabled(); void setMappingDefinedPropertiesEnabled(boolean mappingDefinedPropertiesEnabled); boolean isRuntimePropertiesEnabled(); void setRuntimePropertiesEnabled(boolean runtimePropertiesEnabled); List<AtlasPropertyType> getPropertyOrder(); void setPropertyOrder(List<AtlasPropertyType> propertyOrder); AtlasConversionService getAtlasConversionService(); void setAtlasConversionService(AtlasConversionService atlasConversionService); }
DefaultAtlasPropertyStrategy implements AtlasPropertyStrategy { @Override public void readProperty(AtlasSession session, PropertyField propertyField) throws AtlasUnsupportedException, AtlasConversionException { if (propertyField == null || propertyField.getName() == null || propertyField.getName().trim().length() == 0) { if (LOG.isDebugEnabled()) { LOG.debug(String.format("Null or empty PropertyField specified popertyField=%s", AtlasModelFactory.toString(propertyField))); } return; } for (AtlasPropertyType propType : getPropertyOrder()) { switch (propType) { case RUNTIME_PROPERTIES: if (session != null && processRuntimeProperties(propertyField, session.getSourceProperties())) { return; } break; case JAVA_SYSTEM_PROPERTIES: if (processJavaSystemProperty(propertyField)) { return; } break; case ENVIRONMENT_VARIABLES: if (processEnvironmentVariable(propertyField)) { return; } break; case MAPPING_DEFINED_PROPERTIES: if (session != null && processMappingDefinedProperties(propertyField, session.getMapping())) { return; } break; default: throw new AtlasUnsupportedException( String.format("Unsupported PropertyType detected type=%s for field=%s", propType, AtlasModelFactory.toString(propertyField))); } } }  @Override void readProperty(AtlasSession session, PropertyField propertyField); @Override void writeProperty(AtlasSession session, PropertyField propertyField); void setPropertyOrderValue(List<String> propertyValues); boolean isEnvironmentPropertiesEnabled(); void setEnvironmentPropertiesEnabled(boolean environmentPropertiesEnabled); boolean isSystemPropertiesEnabled(); void setSystemPropertiesEnabled(boolean systemPropertiesEnabled); boolean isMappingDefinedPropertiesEnabled(); void setMappingDefinedPropertiesEnabled(boolean mappingDefinedPropertiesEnabled); boolean isRuntimePropertiesEnabled(); void setRuntimePropertiesEnabled(boolean runtimePropertiesEnabled); List<AtlasPropertyType> getPropertyOrder(); void setPropertyOrder(List<AtlasPropertyType> propertyOrder); AtlasConversionService getAtlasConversionService(); void setAtlasConversionService(AtlasConversionService atlasConversionService);  }