def testGetConfig(self): print "TestApplicationDeploymentConfig : testGetConfig" pf = XmlProperties("tmp/ant-properties.xml").getAntProperties() for k, psc in pf.getPartialKey("*.pscname"): if pf.get(psc + ".technology") == "webapp": appConfig = ApplicationDeploymentConfig(psc, pf).getConfig() self.assertEqual(appConfig["domain"], "GWA_Applications") self.assertEqual(appConfig["deployable"], os.path.join(pf.get("package.home"), pf.get(psc + ".deployable"))) self.assertEqual(appConfig["admin.user"], "GWAApplicationsAdmin") self.assertEqual(appConfig["target"], pf.get(pf.get(psc + ".target") + ".target.name")) self.assertEqual(appConfig["name"], psc) if pf.get(psc + ".securitymodel"): self.assertEqual(appConfig["security.model"], pf.get(psc + ".securitymodel")) else: self.assertEqual(appConfig["security.model"], "CustomRoles")
return true else : print "Unrecognised action: '" + action + "'" return false try: # return a PropertiesFile object containing the ant namespace properties pf = XmlProperties("tmp/ant-properties.xml").getAntProperties() debug = pf.get("weblogic.script.debugging") if debug == "on": debugging = true else: debugging = false action = pf.get("managejmsresources.action") modules = pf.getPartialKey("*.jms.system.module.name") if debugging: print "[DEBUG] len(modules): %i" % len(modules) print "[DEBUG] modules[0][1]: " + modules[0][1] print "[DEBUG] action: " + action for k, modname in modules: print "Processing properties for JMS resource ID: %s" % (modname) jmsConfig = JMSResourceConfig(modname, pf).getConfig() datasourcename = jmsConfig["datasource"] target = jmsConfig["target.domain"] for k, v in pf.getPartialKey("*.target.name"): if v == target: admPrefix = pf.get(k.split(".")[0] + ".admin.server") domainAdminUserName = pf.get(admPrefix + ".admin_user") adminPassword = pf.get(admPrefix + ".admin_password")
pf = XmlProperties("tmp/ant-properties.xml").getAntProperties() debug = pf.get("weblogic.script.debugging") if debug == "on": debugging = true else: debugging = false action = pf.get("deployApplications.action") if not (action == "deploy" or action == "undeploy"): print "Action must be 'deploy' or 'undeploy'" exit(exitcode=2) # Holder for name of domain to which we're currently connected: # use it to avoid re-connecting to domain already connected currentDomain = None pscs = pf.getPartialKey("*.pscname") applications = [] for k, v in pscs: if pf.get(v + ".technology") == "webapp": applications.append(v) for artefact in applications: appConfig = ApplicationDeploymentConfig(artefact, pf).getConfig() print "Processing properties for psc %s" % (artefact) targetDomain = appConfig["domain"] if not (targetDomain == currentDomain) : # Change domain if not (currentDomain == None) : disconnect(); currentDomain = None # Load target domain specification properties