Package org.jboss.metadata.web.jboss

Examples of org.jboss.metadata.web.jboss.JBossWebMetaData.merge()


      ClassLoader cl = Thread.currentThread().getContextClassLoader();
      URL webxml = cl.getResource("security/jacc/webperm/web.xml");
      assertNotNull("web.xml exists?", webxml);
      WebMetaData wmd = getWebMetaData(webxml.openStream());
      JBossWebMetaData jwmd = new JBossWebMetaData();
      jwmd.merge(null, wmd);
      TestJBossPolicyConfiguration tpc = new TestJBossPolicyConfiguration("dummy");
      WebPermissionMapping.createPermissions(jwmd, tpc);
      checkUncheckedPermissions(tpc.getUncheckedPolicy());
      checkExcludedPermissions(tpc.getExcludedPolicy());
      checkAddToRoleForAdministrator(tpc.getPermissionsForRole("Administrator"));
View Full Code Here


      specMetaData.augment(mergedFragmentMetaData, null, true);

      // Override with meta data (JBossWebMetaData)
      // Create a merged view
      JBossWebMetaData mergedMetaData = new JBossWebMetaData();
      mergedMetaData.merge(metaData, specMetaData);
      // Incorporate any ear level overrides
      DeploymentUnit topUnit = unit.getTopLevel();
      if(topUnit != null && topUnit.getAttachment(JBossAppMetaData.class) != null)
      {
         JBossAppMetaData earMetaData = topUnit.getAttachment(JBossAppMetaData.class);
View Full Code Here

      }

      if (sharedWebMetaData != null || sharedJBossWebMetaData != null)
      {
         JBossWebMetaData clone = new JBoss60WebMetaData();
         clone.merge(sharedJBossWebMetaData, sharedWebMetaData);
         unit.addAttachment(SHARED_JBOSSWEB_ATTACHMENT_NAME, clone);
      }
  }
  
}
View Full Code Here

      throws Exception
   {
      WebMetaData webMD = unmarshal("WebApp24_testRunAsPrincipal.xml", WebMetaData.class, null);
      JBossWebMetaData jbossWebMD = unmarshal("JBossWebApp24_testRunAsPrincipal.xml", JBossWebMetaData.class, null);
      JBossWebMetaData jbossWeb = new JBossWebMetaData();
      jbossWeb.merge(jbossWebMD, webMD);

      assertEquals("4.0", jbossWeb.getVersion());
      assertEquals("java:/jaas/jbosstest-web", jbossWeb.getSecurityDomain());
      assertEquals(5, jbossWeb.getResourceReferences().size());
      // jdbc/DefaultDS
View Full Code Here

      //Create the JBossWebMetaData
      JBossWebMetaData jbossWMD = unmarshal("JBossWeb_testAnnotationXML.xml", JBossWebMetaData.class, null);

      //Let us merge the merged spec metadata with the jbossweb metadata
      JBossWebMetaData mergedJBossWebMD = new JBossWebMetaData();
      mergedJBossWebMD.merge(jbossWMD, merged);

      //Assert the run as role
      JBossServletMetaData jbossServletMetaData = mergedJBossWebMD.getServlets().get("MyServlet");
      assertEquals("InternalUser", jbossServletMetaData.getRunAs().getRoleName());
      assertEquals("javajoe", jbossServletMetaData.getRunAsPrincipal());
View Full Code Here

      //Create the JBossWebMetaData
      JBossWebMetaData jbossWMD = unmarshal("JBossWeb_testAnnotationXML.xml", JBossWebMetaData.class);

      //Let us merge the merged spec metadata with the jbossweb metadata
      JBossWebMetaData mergedJBossWebMD = new JBossWebMetaData();
      mergedJBossWebMD.merge(jbossWMD, xml);

      //Assert the run as role
      assertTrue(mergedJBossWebMD.getRunAsIdentity("MyServlet").getRoleName().startsWith("PLACEHOLDER"));

      WebMetaData merged = new WebMetaData();
View Full Code Here

      WebMetaData merged = new WebMetaData();
      //Merge the annotation and xml
      AnnotationMergedView.merge(merged, xml, annotation);

      JBossWebMetaData newMerged = new JBossWebMetaData();
      newMerged.merge(mergedJBossWebMD, merged);

      //Assert the run as role
      JBossServletMetaData jbossServletMetaData = newMerged.getServlets().get("MyServlet");
      assertEquals("InternalUser", jbossServletMetaData.getRunAs().getRoleName());
      assertEquals("javajoe", jbossServletMetaData.getRunAsPrincipal());
View Full Code Here

   protected void setUp() throws Exception
   {
      JBossWebMetaData metaData = new JBossWebMetaData();
      WebMetaData specMetaData = new WebMetaData();
      metaData.merge(null, specMetaData);
      List<SecurityConstraintMetaData> securityContraints = new ArrayList<SecurityConstraintMetaData>();

      addProtectedASC(securityContraints);
      addProtectedBSC(securityContraints);
      specMetaData.setSecurityContraints(securityContraints);
View Full Code Here

   protected void setUp() throws Exception
   {
      JBossWebMetaData metaData = new JBossWebMetaData();
      WebMetaData specMetaData = new WebMetaData();
      metaData.merge(null, specMetaData);
      List<SecurityConstraintMetaData> securityContraints = new ArrayList<SecurityConstraintMetaData>();
      addSC(securityContraints);
      specMetaData.setSecurityContraints(securityContraints);

      DelegatingPolicy policy = new DelegatingPolicy();
View Full Code Here

   protected void setUp() throws Exception
   {
      JBossWebMetaData metaData = new JBossWebMetaData();
      WebMetaData specMetaData = new WebMetaData();
      metaData.merge(null, specMetaData);
      List<SecurityConstraintMetaData> securityContraints = new ArrayList<SecurityConstraintMetaData>();
      addSC(securityContraints);
      specMetaData.setSecurityContraints(securityContraints);

      DelegatingPolicy policy = new DelegatingPolicy();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.