<s> import unittest <EOL> import string <EOL> import wdr <EOL> from wdr . app import * <EOL> from wdr . config import * <EOL> from wdr . control import * <EOL> from wdr . manifest import * <EOL> from wdr . util import * <EOL> from wdrtest . topology import topology <EOL> ( <EOL> AdminApp , AdminConfig , AdminControl , AdminTask , Help <EOL> ) = wdr . WsadminObjects ( ) . getObjects ( ) <EOL> class AbstractConfigTest ( unittest . TestCase ) : <EOL> def tearDown ( self ) : <EOL> reset ( ) <EOL> def assertTrue ( self , value , msg = None ) : <EOL> self . assertNotEqual ( <NUM_LIT:0> , value , msg ) <EOL> def assertFalse ( self , value , msg = None ) : <EOL> self . assertEqual ( <NUM_LIT:0> , value , msg ) <EOL> def assertNone ( self , value , msg = None ) : <EOL> if value is not None : <EOL> raise AssertionError ( msg or '<STR_LIT>' % value ) <EOL> def assertNotNone ( self , value , msg = None ) : <EOL> if value is None : <EOL> raise AssertionError ( msg or '<STR_LIT>' % value ) <EOL> class VariableSubstitutionTest ( unittest . TestCase ) : <EOL> def testSimple ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( '<STR_LIT>' , { '<STR_LIT:name>' : '<STR_LIT>' } ) <EOL> ) <EOL> def testWithMixedCase ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( '<STR_LIT>' , { '<STR_LIT:Name>' : '<STR_LIT>' } ) <EOL> ) <EOL> def testWithDigits ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> ) <EOL> def testWithUnderscores ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> ) <EOL> def testWithUnderscorePrefix ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> ) <EOL> def testWithUnderscoreOnly ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( '<STR_LIT>' , { '<STR_LIT:_>' : '<STR_LIT>' } ) <EOL> ) <EOL> def testWithNestedDictionary ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( <EOL> '<STR_LIT>' , { '<STR_LIT>' : { '<STR_LIT:name>' : '<STR_LIT>' } } <EOL> ) <EOL> ) <EOL> def testWithDoubleNestedDictionary ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT:name>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> } <EOL> } <EOL> ) <EOL> ) <EOL> def testNone ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( '<STR_LIT>' , { '<STR_LIT:name>' : None } ) <EOL> ) <EOL> def testNumber ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( '<STR_LIT>' , { '<STR_LIT:name>' : <NUM_LIT> } ) <EOL> ) <EOL> def testList ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( '<STR_LIT>' , { '<STR_LIT:name>' : [ <NUM_LIT> , <NUM_LIT> ] } ) <EOL> ) <EOL> def testTuple ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( '<STR_LIT>' , { '<STR_LIT:name>' : ( <NUM_LIT> , <NUM_LIT> ) } ) <EOL> ) <EOL> def testCallable ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( <EOL> '<STR_LIT>' , <EOL> { '<STR_LIT:name>' : lambda expression , variables : '<STR_LIT>' } <EOL> ) <EOL> ) <EOL> def testCallableReturningNone ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( <EOL> '<STR_LIT>' , <EOL> { '<STR_LIT:name>' : lambda expression , variables : None } <EOL> ) <EOL> ) <EOL> def testWithExtraSpaces ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( <EOL> '<STR_LIT>' , <EOL> { '<STR_LIT>' : { '<STR_LIT:name>' : '<STR_LIT>' } } <EOL> ) <EOL> ) <EOL> class VariableSubstitutionWithFilteringTest ( unittest . TestCase ) : <EOL> def testUpper ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( <EOL> '<STR_LIT>' , <EOL> { '<STR_LIT:name>' : '<STR_LIT>' , '<STR_LIT>' : string . upper } <EOL> ) <EOL> ) <EOL> def testListProcessing ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( <EOL> '<STR_LIT>' , <EOL> { '<STR_LIT:name>' : [ '<STR_LIT>' , '<STR_LIT>' ] , '<STR_LIT>' : string . join } <EOL> ) <EOL> ) <EOL> def testListWithLambdaOnList ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT:[>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT:]>' , <EOL> substituteVariables ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : [ <EOL> [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] , <EOL> [ <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ] <EOL> ] , <EOL> '<STR_LIT>' : <EOL> lambda targetList : ( '<STR_LIT:+>' . join ( <EOL> [ <EOL> '<STR_LIT>' <EOL> + '<STR_LIT:U+002C>' . join ( <EOL> [ '<STR_LIT:=>' . join ( attList ) for attList in target ] <EOL> ) <EOL> for target in targetList <EOL> ] <EOL> ) <EOL> ) <EOL> } <EOL> ) <EOL> ) <EOL> def testListWithLambdaOnDict ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT:[>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT:]>' , <EOL> substituteVariables ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : [ <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> ] , <EOL> '<STR_LIT>' : <EOL> lambda targetList : ( <EOL> '<STR_LIT:+>' . join ( <EOL> [ <EOL> '<STR_LIT>' <EOL> % t <EOL> for t in filter ( <EOL> lambda e : e . get ( '<STR_LIT>' ) , targetList <EOL> ) <EOL> ] <EOL> + <EOL> [ <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % t <EOL> for t in filter ( <EOL> lambda e : e . get ( '<STR_LIT>' ) and e . get ( '<STR_LIT>' ) , <EOL> targetList <EOL> ) <EOL> ] <EOL> ) <EOL> ) <EOL> } <EOL> ) <EOL> ) <EOL> def testWithExtraSpaces ( self ) : <EOL> self . assertEquals ( <EOL> '<STR_LIT>' , <EOL> substituteVariables ( <EOL> '<STR_LIT>' , <EOL> { '<STR_LIT:name>' : '<STR_LIT>' , '<STR_LIT>' : string . upper } <EOL> ) <EOL> ) <EOL> class BasicManifestImportTest ( AbstractConfigTest ) : <EOL> def testUpdateStrings ( self ) : <EOL> """<STR_LIT>""" <EOL> srv = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertEquals ( srv . changeUserAfterStartup , '<STR_LIT>' ) <EOL> self . assertEquals ( srv . changeGroupAfterStartup , '<STR_LIT>' ) <EOL> def testUpdateBooleans ( self ) : <EOL> """<STR_LIT>""" <EOL> srv = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertFalse ( srv . developmentMode ) <EOL> self . assertTrue ( srv . parallelStartEnabled ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertTrue ( srv . developmentMode ) <EOL> self . assertFalse ( srv . parallelStartEnabled ) <EOL> def testUpdateBooleanWithInvalidValue ( self ) : <EOL> """<STR_LIT>""" <EOL> srv = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertTrue ( srv . parallelStartEnabled ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertFalse ( srv . developmentMode ) <EOL> def testUpdateInteger ( self ) : <EOL> """<STR_LIT>""" <EOL> jvm = getid1 ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( jvm . initialHeapSize , <NUM_LIT:0> ) <EOL> self . assertEquals ( jvm . maximumHeapSize , <NUM_LIT:0> ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertEquals ( jvm . initialHeapSize , <NUM_LIT> ) <EOL> self . assertEquals ( jvm . maximumHeapSize , <NUM_LIT> ) <EOL> def testUpdateEnum ( self ) : <EOL> """<STR_LIT>""" <EOL> cell = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( cell . cellDiscoveryProtocol , '<STR_LIT>' ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertEquals ( cell . cellDiscoveryProtocol , '<STR_LIT>' ) <EOL> def testUpdateEnumWithInvalidValue ( self ) : <EOL> """<STR_LIT>""" <EOL> cell = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( cell . cellDiscoveryProtocol , '<STR_LIT>' ) <EOL> failure = <NUM_LIT:0> <EOL> try : <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> failure = <NUM_LIT:1> <EOL> except : <EOL> pass <EOL> self . assertFalse ( failure , '<STR_LIT>' ) <EOL> self . assertEquals ( cell . cellDiscoveryProtocol , '<STR_LIT>' ) <EOL> def testFailOnInvalidType ( self ) : <EOL> """<STR_LIT>""" <EOL> failure = <NUM_LIT:0> <EOL> try : <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> failure = <NUM_LIT:1> <EOL> except : <EOL> pass <EOL> self . assertFalse ( failure , '<STR_LIT>' ) <EOL> def testFailOnInvalidKey ( self ) : <EOL> """<STR_LIT>""" <EOL> failure = <NUM_LIT:0> <EOL> try : <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> failure = <NUM_LIT:1> <EOL> except : <EOL> pass <EOL> self . assertFalse ( failure , '<STR_LIT>' ) <EOL> def testFailOnInvalidAttribute ( self ) : <EOL> """<STR_LIT>""" <EOL> failure = <NUM_LIT:0> <EOL> try : <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , <EOL> topology <EOL> ) <EOL> failure = <NUM_LIT:1> <EOL> except : <EOL> pass <EOL> self . assertFalse ( failure , '<STR_LIT>' ) <EOL> def testCommentsValid ( self ) : <EOL> """<STR_LIT>""" <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> def testCommentIndented ( self ) : <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertFalse ( hasChanges ( ) ) <EOL> def testNoChanges ( self ) : <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertFalse ( hasChanges ( ) ) <EOL> class HierarchiesManifestImportTest ( AbstractConfigTest ) : <EOL> def testOneChild ( self ) : <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( providers , [ ] ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( providers ) , <NUM_LIT:1> ) <EOL> db2provider = providers [ <NUM_LIT:0> ] <EOL> self . assertEquals ( db2provider . name , '<STR_LIT>' ) <EOL> self . assertEquals ( db2provider . classpath , [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT:c>' ] ) <EOL> self . assertTrue ( db2provider . xa ) <EOL> def testMultipleChildren ( self ) : <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( providers , [ ] ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( providers ) , <NUM_LIT:2> ) <EOL> db2provider = providers [ <NUM_LIT:0> ] <EOL> self . assertEquals ( db2provider . name , '<STR_LIT>' ) <EOL> self . assertEquals ( db2provider . classpath , [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT:c>' ] ) <EOL> self . assertFalse ( db2provider . xa ) <EOL> db2provider = providers [ <NUM_LIT:1> ] <EOL> self . assertEquals ( db2provider . name , '<STR_LIT>' ) <EOL> self . assertEquals ( db2provider . classpath , [ '<STR_LIT:d>' , '<STR_LIT:e>' , '<STR_LIT:f>' ] ) <EOL> self . assertTrue ( db2provider . xa ) <EOL> def testMultipleChildrenInList ( self ) : <EOL> cellVariables = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> variableCount = len ( cellVariables . entries ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , <EOL> topology <EOL> ) <EOL> self . assertEquals ( len ( cellVariables . entries ) , variableCount + <NUM_LIT:2> ) <EOL> def testMultipleChildrenInAttribute ( self ) : <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( providers , [ ] ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , <EOL> topology <EOL> ) <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( providers ) , <NUM_LIT:1> ) <EOL> db2provider = providers [ <NUM_LIT:0> ] <EOL> self . assertEquals ( db2provider . name , '<STR_LIT>' ) <EOL> self . assertEquals ( len ( db2provider . propertySet . resourceProperties ) , <NUM_LIT:2> ) <EOL> def testRepeatedObjects ( self ) : <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> server = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> referenceList = server . lookup1 ( <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT>' <EOL> ) <EOL> class IncludesAndImportsTest ( AbstractConfigTest ) : <EOL> def testImportValid ( self ) : <EOL> cellVariables = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> variableCount = len ( cellVariables . entries ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertEquals ( len ( cellVariables . entries ) , variableCount + <NUM_LIT:2> ) <EOL> def testIncludeWithPath ( self ) : <EOL> cellVariables = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> variableCount = len ( cellVariables . entries ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertEquals ( len ( cellVariables . entries ) , variableCount + <NUM_LIT:3> ) <EOL> def testIncludeWithoutPath ( self ) : <EOL> cellVariables = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> variableCount = len ( cellVariables . entries ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertEquals ( len ( cellVariables . entries ) , variableCount + <NUM_LIT:2> ) <EOL> class VariablesAndFiltersTest ( AbstractConfigTest ) : <EOL> def testCallables ( self ) : <EOL> d = { } <EOL> d . update ( topology ) <EOL> d [ '<STR_LIT:list>' ] = [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT:c>' , '<STR_LIT:d>' ] <EOL> d [ '<STR_LIT>' ] = lambda x : x [ <NUM_LIT:0> ] <EOL> d [ '<STR_LIT>' ] = lambda x : x [ - <NUM_LIT:1> ] <EOL> cellVariables = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> variableCount = len ( cellVariables . entries ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , <EOL> d <EOL> ) <EOL> self . assertEquals ( len ( cellVariables . entries ) , variableCount + <NUM_LIT:2> ) <EOL> self . assertEquals ( cellVariables . entries [ - <NUM_LIT:2> ] . symbolicName , '<STR_LIT:a>' ) <EOL> self . assertEquals ( cellVariables . entries [ - <NUM_LIT:2> ] . value , '<STR_LIT>' ) <EOL> self . assertEquals ( cellVariables . entries [ - <NUM_LIT:1> ] . symbolicName , '<STR_LIT:d>' ) <EOL> self . assertEquals ( cellVariables . entries [ - <NUM_LIT:1> ] . value , '<STR_LIT>' ) <EOL> class ReferencesTest ( AbstractConfigTest ) : <EOL> def testMailProtocolProvider ( self ) : <EOL> """<STR_LIT>""" <EOL> smtpProtocol = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) . lookup1 ( <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT>' <EOL> ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> mailSession = getid1 ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( <EOL> str ( mailSession . mailTransportProtocol ) , str ( smtpProtocol ) <EOL> ) <EOL> self . assertEquals ( mailSession . name , '<STR_LIT>' ) <EOL> self . assertEquals ( mailSession . jndiName , '<STR_LIT>' ) <EOL> self . assertEquals ( mailSession . mailTransportHost , '<STR_LIT>' ) <EOL> def testDependentService ( self ) : <EOL> """<STR_LIT>""" <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> server = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> referenceList = server . lookup1 ( <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT>' <EOL> ) . prerequisiteServices <EOL> self . assertEquals ( len ( referenceList ) , <NUM_LIT:3> ) <EOL> self . assertEquals ( referenceList [ <NUM_LIT:0> ] . displayName , '<STR_LIT>' ) <EOL> self . assertEquals ( referenceList [ <NUM_LIT:1> ] . displayName , '<STR_LIT>' ) <EOL> self . assertEquals ( referenceList [ <NUM_LIT:2> ] . displayName , '<STR_LIT>' ) <EOL> def testDependentServiceExtension ( self ) : <EOL> """<STR_LIT>""" <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> server = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> referenceList = server . lookup1 ( <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT>' <EOL> ) . prerequisiteServices <EOL> self . assertEquals ( len ( referenceList ) , <NUM_LIT:5> ) <EOL> self . assertEquals ( referenceList [ <NUM_LIT:0> ] . displayName , '<STR_LIT>' ) <EOL> self . assertEquals ( referenceList [ <NUM_LIT:1> ] . displayName , '<STR_LIT>' ) <EOL> self . assertEquals ( referenceList [ <NUM_LIT:2> ] . displayName , '<STR_LIT>' ) <EOL> self . assertEquals ( referenceList [ <NUM_LIT:3> ] . displayName , '<STR_LIT>' ) <EOL> self . assertEquals ( referenceList [ <NUM_LIT:4> ] . displayName , '<STR_LIT>' ) <EOL> class RemovalTest ( AbstractConfigTest ) : <EOL> def testJdbcProvider ( self ) : <EOL> """<STR_LIT>""" <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( providers ) , <NUM_LIT:1> ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( providers ) , <NUM_LIT:0> ) <EOL> def testJvmProperty ( self ) : <EOL> """<STR_LIT>""" <EOL> prop = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( prop ) , <NUM_LIT:1> ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> prop = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( prop ) , <NUM_LIT:0> ) <EOL> def testMailTransportProtocol ( self ) : <EOL> """<STR_LIT>""" <EOL> smtpProtocol = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) . lookup1 ( <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT>' <EOL> ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> mailSession = getid1 ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( <EOL> str ( mailSession . mailTransportProtocol ) , str ( smtpProtocol ) <EOL> ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertNone ( mailSession . mailTransportProtocol ) <EOL> def testDependentService ( self ) : <EOL> """<STR_LIT>""" <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> server = getid1 ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> referenceList = server . lookup1 ( <EOL> '<STR_LIT>' , <EOL> { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT>' <EOL> ) . prerequisiteServices <EOL> self . assertEquals ( len ( referenceList ) , <NUM_LIT:2> ) <EOL> self . assertEquals ( referenceList [ <NUM_LIT:0> ] . displayName , '<STR_LIT>' ) <EOL> self . assertEquals ( referenceList [ <NUM_LIT:1> ] . displayName , '<STR_LIT>' ) <EOL> class CustomizeTest ( AbstractConfigTest ) : <EOL> def testJvmProperty ( self ) : <EOL> """<STR_LIT>""" <EOL> prop = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( prop ) , <NUM_LIT:1> ) <EOL> self . assertEquals ( prop [ <NUM_LIT:0> ] . value , '<STR_LIT>' ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> prop = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( prop ) , <NUM_LIT:1> ) <EOL> self . assertEquals ( prop [ <NUM_LIT:0> ] . value , '<STR_LIT>' ) <EOL> def testMissingJvmProperty ( self ) : <EOL> """<STR_LIT>""" <EOL> prop = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( prop ) , <NUM_LIT:1> ) <EOL> prop [ <NUM_LIT:0> ] . remove ( ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> prop = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( prop ) , <NUM_LIT:0> ) <EOL> def testExistingDataSource ( self ) : <EOL> """<STR_LIT>""" <EOL> dataSource = getid1 ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( dataSource . jndiName , '<STR_LIT>' ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> self . assertEquals ( dataSource . jndiName , '<STR_LIT>' ) <EOL> def testNonexistentDataSource ( self ) : <EOL> """<STR_LIT>""" <EOL> provider = getid1 ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> dataSource = getid1 ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( dataSource . jndiName , '<STR_LIT>' ) <EOL> self . assertEquals ( <EOL> provider . description , '<STR_LIT>' <EOL> ) <EOL> dataSource . remove ( ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> dataSources = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( dataSources ) , <NUM_LIT:1> ) <EOL> self . assertEquals ( dataSources [ <NUM_LIT:0> ] . jndiName , '<STR_LIT>' ) <EOL> self . assertEquals ( <EOL> provider . description , '<STR_LIT>' <EOL> ) <EOL> def testNonexistentProvider ( self ) : <EOL> """<STR_LIT>""" <EOL> provider = getid1 ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> dataSource = getid1 ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( dataSource . jndiName , '<STR_LIT>' ) <EOL> provider . remove ( ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( providers , [ ] ) <EOL> dataSources = getid ( <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( dataSources , [ ] ) <EOL> class TemplatesTest ( AbstractConfigTest ) : <EOL> def test_db2_ibm_jcc_xa ( self ) : <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( providers , [ ] ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , topology <EOL> ) <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( providers ) , <NUM_LIT:1> ) <EOL> db2provider = providers [ <NUM_LIT:0> ] <EOL> self . assertEquals ( <EOL> db2provider . name , <EOL> '<STR_LIT>' <EOL> ) <EOL> self . assertEquals ( <EOL> db2provider . description , <EOL> '<STR_LIT>' <EOL> ) <EOL> self . assertEquals ( <EOL> db2provider . providerType , '<STR_LIT>' <EOL> ) <EOL> self . assertTrue ( db2provider . xa ) <EOL> def test_db2_ibm_jcc_xa_using_full_id ( self ) : <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( providers , [ ] ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , <EOL> topology <EOL> ) <EOL> providers = getid ( <EOL> '<STR_LIT>' <EOL> % topology <EOL> ) <EOL> self . assertEquals ( len ( providers ) , <NUM_LIT:1> ) <EOL> db2provider = providers [ <NUM_LIT:0> ] <EOL> self . assertEquals ( <EOL> db2provider . name , <EOL> '<STR_LIT>' <EOL> ) <EOL> self . assertEquals ( <EOL> db2provider . description , <EOL> '<STR_LIT>' <EOL> ) <EOL> self . assertEquals ( <EOL> db2provider . providerType , '<STR_LIT>' <EOL> ) <EOL> self . assertTrue ( db2provider . xa ) <EOL> def test_non_unique_template ( self ) : <EOL> try : <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , <EOL> topology <EOL> ) <EOL> except : <EOL> return <EOL> self . fail ( '<STR_LIT>' ) <EOL> def test_web_server ( self ) : <EOL> self . assertEqual ( <NUM_LIT:0> , len ( getid ( '<STR_LIT>' ) ) ) <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , <EOL> topology <EOL> ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( getid ( '<STR_LIT>' ) ) ) <EOL> def test_non_existent_template ( self ) : <EOL> try : <EOL> importConfigurationManifest ( <EOL> '<STR_LIT>' , <EOL> topology <EOL> ) <EOL> except : <EOL> return <EOL> self . fail ( '<STR_LIT>' ) </s>
