Skip to content

Updated WLST data type compatibility check method to see "class java.… #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions core/src/main/python/wlsdeploy/tool/validate/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The Universal Permissive License (UPL), Version 1.0
"""
import os
import copy

from oracle.weblogic.deploy.util import WLSDeployArchive
from oracle.weblogic.deploy.util import VariableException
Expand Down Expand Up @@ -108,9 +109,15 @@ def validate_in_standalone_mode(self, model_dict, variables_file_name=None, arch
"""
_method_name = 'validate_in_standalone_mode'

# We need to make a deep copy of model_dict here, to ensure it's
# treated as a "read-only'" reference variable, during the variable
# file validation process. The variable file validation process could
# actually require changes to be made to the cloned model dictionary
cloned_model_dict = copy.deepcopy(model_dict)

self._logger.entering(variables_file_name, archive_file_name, class_name=_class_name, method_name=_method_name)
self._validation_mode = _ValidationModes.STANDALONE
self.__validate_model_file(model_dict, variables_file_name, archive_file_name)
self.__validate_model_file(cloned_model_dict, variables_file_name, archive_file_name)

self._logger.exiting(class_name=_class_name, method_name=_method_name)
return self._validation_results
Expand All @@ -137,10 +144,16 @@ def validate_in_tool_mode(self, model_dict, variables_file_name=None, archive_fi
"""
_method_name = 'validate_in_tool_mode'

# We need to make a deep copy of model_dict here, to ensure it's
# treated as a "read-only'" reference variable, during the variable
# file validation process. The variable file validation process could
# actually require changes to be made to the cloned model dictionary
cloned_model_dict = copy.deepcopy(model_dict)

self._logger.entering(variables_file_name, archive_file_name, class_name=_class_name, method_name=_method_name)
return_code = Validator.ReturnCode.STOP
self._validation_mode = _ValidationModes.TOOL
self.__validate_model_file(model_dict, variables_file_name, archive_file_name)
self.__validate_model_file(cloned_model_dict, variables_file_name, archive_file_name)

status = Validator.ValidationStatus.VALID

Expand Down Expand Up @@ -212,8 +225,7 @@ def __validate_model_file(self, model_dict, variables_file_name, archive_file_na
if variables_file_name is not None:
self._logger.info('WLSDPLY-05004', variables_file_name, class_name=_class_name, method_name=_method_name)
try:
if self._model_context.get_variable_file():
self._variable_properties = variables.load_variables(self._model_context.get_variable_file())
self._variable_properties = variables.load_variables(variables_file_name)
variables.substitute(model_dict, self._variable_properties)
except VariableException, ve:
ex = exception_helper.create_validate_exception('WLSDPLY-20004', 'validateModel',
Expand Down
10 changes: 7 additions & 3 deletions core/src/test/python/validation_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ def setUp(self):
self.wls_helper = WebLogicHelper(self._logger)

def testModelValidation(self):

_model_file = self._resources_dir + '/test_jms_mail.json'
_method_name = 'testModelValidation'

_model_file = self._resources_dir + '/variablestest.yaml'
_variable_file = self._resources_dir + '/variablestest.properties'
_archive_file = self._resources_dir + '/variablestest.zip'

mw_home = os.environ['MW_HOME']
args_map = {
'-oracle_home': mw_home,
'-model_file': _model_file
'-model_file': _model_file,
'-variable_file': _variable_file,
'-archive_file': _archive_file
}

model_context = ModelContext('ValidationTestCase', args_map)
Expand Down
18 changes: 18 additions & 0 deletions core/src/test/resources/variablestest.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SecurityConfiguration.CredentialEncrypted=welcome1
SecurityConfiguration.NodeManagerUsername=weblogic
SecurityConfiguration.NodeManagerPasswordEncrypted=welcome1
JDBCSystemResource.MyPersistentStoreDS.JdbcResource.JDBCDriverParams.PasswordEncrypted=welcome1
JDBCSystemResource.MyPersistentStoreDS.JdbcResource.JDBCDriverParams.Properties.user.Value=weblogic
JDBCSystemResource.MyDataSource.JdbcResource.JDBCDriverParams.PasswordEncrypted=welcome1
JDBCSystemResource.MyDataSource.JdbcResource.JDBCDriverParams.Properties.user.Value=weblogic
MailSession.MyMailSession.SessionPasswordEncrypted=welcome1
MailSession.MyMailSession.SessionUsername=weblogic
MailSession.MailSession-0.SessionPasswordEncrypted=welcome1
MailSession.MailSession-0.SessionUsername=weblogic
JMSSystemResource.MyJmsModule.JmsResource.ForeignServer.MyForeignServer.JNDIPropertiesCredentialEncrypted=welcome1
JMSSystemResource.MyJmsModule.JmsResource.SAFRemoteContext.MyRemoteSAFcontext.SAFLoginContext.PasswordEncrypted=welcome1
JMSSystemResource.MyJmsModule.JmsResource.SAFRemoteContext.MyRemoteSAFcontext.SAFLoginContext.Username=weblogic
JMSBridgeDestination.JMS-Bridge-Remote-Destination.UserName=weblogic
JMSBridgeDestination.JMS-Bridge-Remote-Destination.UserPasswordEncrypted=welcome1
WLDFSystemResource.MyWldfModule.WLDFResource.WatchNotification.RestNotification.MyRestAction.HttpAuthenticationPasswordEncrypted=welcome1
WLDFSystemResource.MyWldfModule.WLDFResource.WatchNotification.RestNotification.MyRestAction.HttpAuthenticationUserName=weblogic
Loading