Package org.jboss.as.test.integration.security.loginmodules.common

Examples of org.jboss.as.test.integration.security.loginmodules.common.WebAppDeployment


    */
   @Deployment(name = DEP2, order = 2)
   public static WebArchive appDeployment2() throws SQLException {
      log.info("start" + DEP2 + "deployment");

      WebAppDeployment dep = new WebAppDeployment(DEP2, SecuredServletWithDBSetupForDep2.class, DatabaseServerLoginModule.class);
      DEPLOYMENTS.put(DEP2, dep);

      log.debug("adding module options");
      dep.addModuleOption("dsJndiName", "java:jboss/datasources/LoginDSdep" + DEP_NUM.get(DEP2));
      dep.addModuleOption("principalsQuery", "select Password from Principals where PrincipalID=?");
      dep.addModuleOption("rolesQuery", "select Role, RoleGroup from Roles where PrincipalID=?");
      dep.addModuleOption("hashAlgorithm", "MD5");

      Map<String, String> usersProps = new HashMap<String, String>();
      usersProps.put("anil", Utils.hash("anil", "MD5", BASE_64));
      usersProps.put("marcus", Utils.hash("marcus", "MD5", BASE_64));

      databaseManager.updateDatabase(DEP_NUM.get(DEP2), usersProps);

      log.debug(dep.getWar().toString(true));

      WebArchive war = dep.getWar();
      addH2Lib(war);
      return war;
   }
View Full Code Here


    */
   @Deployment(name = DEP3, order = 3)
   public static WebArchive appDeployment3() throws SQLException {
      log.info("start" + DEP3 + "deployment");

      WebAppDeployment dep = new WebAppDeployment(DEP3, SecuredServletWithDBSetupForDep3.class, DatabaseServerLoginModule.class);
      DEPLOYMENTS.put(DEP3, dep);

      log.debug("adding module options");
      dep.addModuleOption("dsJndiName", "java:jboss/datasources/LoginDSdep" + DEP_NUM.get(DEP3));
      dep.addModuleOption("principalsQuery", "select Password from Principals where PrincipalID=?");
      dep.addModuleOption("rolesQuery", "select Role, RoleGroup from Roles where PrincipalID=?");
      dep.addModuleOption("hashAlgorithm", "MD5");
      dep.addModuleOption("hashEncoding", "base64");

      Map<String, String> usersProps = new HashMap<String, String>();
      usersProps.put("anil", Utils.hash("anil", "MD5", Coding.BASE_64));
      usersProps.put("marcus", Utils.hash("marcus", "MD5", BASE_64));
      databaseManager.updateDatabase(DEP_NUM.get(DEP3), usersProps);

      log.debug(dep.getWar().toString(true));

      WebArchive war = dep.getWar();
      addH2Lib(war);
      return war;
   }
View Full Code Here

    */
   @Deployment(name = DEP4, order = 4)
   public static WebArchive appDeployment4() throws SQLException {
      log.info("start" + DEP4 + "deployment");

      WebAppDeployment dep = new WebAppDeployment(DEP4, SecuredServletWithDBSetupForDep4.class, DatabaseServerLoginModule.class);
      DEPLOYMENTS.put(DEP4, dep);

      log.debug("adding module options");
      dep.addModuleOption("dsJndiName", "java:jboss/datasources/LoginDSdep" + DEP_NUM.get(DEP4));
      dep.addModuleOption("principalsQuery", "select Password from Principals where PrincipalID=?");
      dep.addModuleOption("rolesQuery", "select Role, RoleGroup from Roles where PrincipalID=?");
      dep.addModuleOption("hashAlgorithm", "MD5");
      dep.addModuleOption("hashEncoding", "hex");

      Map<String, String> usersProps = new HashMap<String, String>();
      usersProps.put("anil", Utils.hash("anil", "MD5", HEX));
      usersProps.put("marcus", Utils.hash("marcus", "MD5", HEX));
      databaseManager.updateDatabase(DEP_NUM.get(DEP4), usersProps);

      log.debug(dep.getWar().toString(true));

      WebArchive war = dep.getWar();
      addH2Lib(war);
      return war;
   }
View Full Code Here

    */
   @Deployment(name = DEP1, order = 1)
   public static WebArchive appDeployment1() throws SQLException {
      log.info("start" + DEP1 + "deployment");

      WebAppDeployment dep = new WebAppDeployment(DEP1, SecuredServletWithDBSetupForDep1.class, DatabaseServerLoginModule.class);
      DEPLOYMENTS.put(DEP1, dep);

      log.debug("adding module options");
      dep.addModuleOption("dsJndiName", "java:jboss/datasources/LoginDSdep" + DEP_NUM.get(DEP1));
      dep.addModuleOption("principalsQuery", "select Password from Principals where PrincipalID=?");
      dep.addModuleOption("rolesQuery", "select Role, RoleGroup from Roles where PrincipalID=?");

      Map<String, String> usersProps = new HashMap<String, String>();
      usersProps.put("anil", "anil");
      usersProps.put("marcus", "marcus");
      databaseManager.updateDatabase(DEP_NUM.get(DEP1), usersProps);

      log.debug(dep.getWar().toString(true));

      WebArchive war = dep.getWar();
      addH2Lib(war);
      return war;
   }
View Full Code Here

TOP

Related Classes of org.jboss.as.test.integration.security.loginmodules.common.WebAppDeployment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.