def testEmptyAdminName(self): strId = ('' + '(' + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' + '|' + 'resources.xml' + '#' + 'DataSource_1234567890123' + ')') self.assert_(_isConfigId(strId)) cfgId = _parseConfigId(strId) self.assertEquals(cfgId.name, '') self.assertEquals(cfgId.xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer') self.assertEquals(cfgId.xmlDoc, 'resources.xml') self.assertEquals(cfgId.xmlId, 'DataSource_1234567890123')
def testQuotedParenthesisInAdminName(self): strId = ('' + '"' + 'Derby JDBC Provider (XA)' + '(' + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' + '|' + 'resources.xml' + '#' + 'builtin_jdbcprovider' + ')' + '"') self.assert_(_isConfigId(strId)) cfgId = _parseConfigId(strId) self.assertEquals(cfgId.name, 'Derby JDBC Provider (XA)') self.assertEquals(cfgId.xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer') self.assertEquals(cfgId.xmlDoc, 'resources.xml') self.assertEquals(cfgId.xmlId, 'builtin_jdbcprovider')
def testQuotedWithTrailingSpace(self): strId = ('' + '"' + 'Default Datasource ' + '(' + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' + '|' + 'resources.xml' + '#' + 'DataSource_1234567890123' + ')' + '"') self.assert_(_isConfigId(strId)) cfgId = _parseConfigId(strId) self.assertEquals(cfgId.name, 'Default Datasource ') self.assertEquals(cfgId.xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer') self.assertEquals(cfgId.xmlDoc, 'resources.xml') self.assertEquals(cfgId.xmlId, 'DataSource_1234567890123')
def testEmptyAdminName(self): strId = ( '' + '(' + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' + '|' + 'resources.xml' + '#' + 'DataSource_1234567890123' + ')' ) self.assert_(_isConfigId(strId)) cfgId = _parseConfigId(strId) self.assertEquals(cfgId.name, '') self.assertEquals( cfgId.xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' ) self.assertEquals(cfgId.xmlDoc, 'resources.xml') self.assertEquals(cfgId.xmlId, 'DataSource_1234567890123')
def testQuotedWithLeadingSpace(self): strId = ( '' + '"' + ' Default Datasource' + '(' + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' + '|' + 'resources.xml' + '#' + 'DataSource_1234567890123' + ')' + '"' ) self.assert_(_isConfigId(strId)) cfgId = _parseConfigId(strId) self.assertEquals(cfgId.name, ' Default Datasource') self.assertEquals( cfgId.xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' ) self.assertEquals(cfgId.xmlDoc, 'resources.xml') self.assertEquals(cfgId.xmlId, 'DataSource_1234567890123')
def testQuotedParenthesisInAdminName(self): strId = ( '' + '"' + 'Derby JDBC Provider (XA)' + '(' + 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' + '|' + 'resources.xml' + '#' + 'builtin_jdbcprovider' + ')' + '"' ) self.assert_(_isConfigId(strId)) cfgId = _parseConfigId(strId) self.assertEquals(cfgId.name, 'Derby JDBC Provider (XA)') self.assertEquals( cfgId.xmlPath, 'cells/wdrCell/nodes/wdrNode/servers/wdrServer' ) self.assertEquals(cfgId.xmlDoc, 'resources.xml') self.assertEquals(cfgId.xmlId, 'builtin_jdbcprovider')