# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at legal-notices/CDDLv1_0.txt.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information:
# Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2007-2009 Sun Microsystems, Inc.
# Portions Copyright 2011-2012 ForgeRock AS.
# $Source$
# public symbols
"directory_server_information",
"test_time",
"report_generation",
"compare_file",
"is_windows_platform",
"create_property_table",
"compare_property_table",
"exception_thrown",
"directory_server",
"test_env",
"staf_service",
"get_test_name",
"parse_stax_result",
"dn2list",
"list2dn",
"dn2rfcmailaddr",
"java_properties",
"xmldoc_service" ,
"xml_create_report" ,
"group_to_run" ,
"get_last_attr_from_entry" ,
"list_matches" ,
"count_attr" ,
"host_is_localhost" ,
"md5_hash" ,
"value_not_string" ,
"get_system_uid" ,
"date_compare" ,
"tail_logfile"
]
class format_testcase:
'Format the Test name objects'
class directory_server_information:
'Container for Information about Directory Servers'
self.VersionList=[]
self.SystemList=[]
self.ServerDict={}
self.SystemDict={}
class test_time:
'Simple time related manipulation objects'
class basic_utils:
'Some simple basic utilities'
class report_generation:
'Test Report Generation'
try:
finally:
class exception_thrown:
'User defined exceptions handlers'
class compare_file:
'Compare two files'
try:
ret_str = ""
return ret_str
finally:
if winNdx != -1:
else:
'Create a table from an output'
table = {}
try:
except IndexError:
value = ''
return table
'Compare two tables'
import re
result = ''
else:
return result
class directory_server:
'Container to hold DS instance objects'
return location
return name
return port
return adminport
return dn
return pswd
return sfx
return be
class staf_service:
'Container to hold staf service instance objects'
try:
except STAFException, e:
pass
return self.executable
class test_env:
'Container to hold test environment instance objects'
class staf:
'Container to hold staf objects'
__cmd = 'Version'
'Container to hold stax service objects'
__cmd = 'Version'
'Container to hold event service objects'
__cmd = 'Version'
'Container to hold event manager service objects'
__cmd = 'Version'
'Container to hold email service objects'
__cmd = 'Version'
return self.recipients
'Container to hold http service objects'
'Container to hold dsml service objects'
class source:
'Container to hold source data instance objects'
class logs:
'Container to hold test log instance objects'
class data:
'Container to hold local and remote test data instance objects'
i=2
__name=''
i=i+1
try:
except AttributeError:
_functionString='Unable to parse result.'
else:
_functionString='Unable to parse result.'
return _functionString
return __list
__addr=[]
'Update java.properties file'
import fileinput
import string
import sys
try:
for item in optionList:
else:
return 0
except:
return 1
class xmldoc_service:
try:
return builderFactory.newDocumentBuilder()
except:
try:
except:
try:
except:
try:
except:
try:
except:
i=0
i += 1
# Identification
# Test Results
class group_to_run:
attrVal=''
for changeAttr in changeEntry:
#print changeAttr
#print 'get_last_attr_from_entry: %s' % changeAttr
else:
print 'get_last_attr_from_entry: %s' % lastAttr
return lastAttr
mycomp = 'True'
itemnum = 0
if not item:
# TODO: list item is empty do WARNING or ERROR
print "list_matches: WARNING: list item %s is empty." % itemnum
mycomp = 'False'
itemnum += 1
return mycomp
attrnum = 0
if result != None:
print "Hit: attr (%s)" % attr
attrnum += 1
return attrnum
return 1
else:
return 0
return 1
else:
return 0
def md5_hash():
try:
import hashlib
except ImportError:
import md5
return m
try:
except ImportError:
# Unicode is NOT supported in this version of Jython
print "WARNING: Jython version does not support Unicode."
return 1
else:
return 0
# Unicode is supported in this version of Jython
return 1
else:
return 0
def get_system_uid():
return "Greater"
return "Less"
else:
return "Equal"
import re
if mymatch:
print line