[jboss-cvs] JBossAS SVN: r80224 - in projects/security/security-xacml/trunk/jboss-sunxacml: src/main/java/org/jboss/security/xacml/sunxacml/ctx and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 29 16:37:16 EDT 2008


Author: anil.saldhana at jboss.com
Date: 2008-10-29 16:37:16 -0400 (Wed, 29 Oct 2008)
New Revision: 80224

Added:
   projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/
   projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/org/
   projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/org/jboss/
   projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/org/jboss/test/
   projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/org/jboss/test/security/
   projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/org/jboss/test/security/sunxacml/
   projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/org/jboss/test/security/sunxacml/attr/
   projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/org/jboss/test/security/sunxacml/attr/AttributeUnitTestCase.java
Modified:
   projects/security/security-xacml/trunk/jboss-sunxacml/.classpath
   projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/ctx/Attribute.java
Log:
SECURITY-206: attribute type not set in the ctr of Attribute

Modified: projects/security/security-xacml/trunk/jboss-sunxacml/.classpath
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/.classpath	2008-10-29 20:32:38 UTC (rev 80223)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/.classpath	2008-10-29 20:37:16 UTC (rev 80224)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="src" path="src/test/java"/>
 	<classpathentry kind="src" path="src/resources"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="var" path="M2_REPO/apache-xalan/xalan/j_2.7.0/xalan-j_2.7.0.jar"/>

Modified: projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/ctx/Attribute.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/ctx/Attribute.java	2008-10-29 20:32:38 UTC (rev 80223)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/main/java/org/jboss/security/xacml/sunxacml/ctx/Attribute.java	2008-10-29 20:37:16 UTC (rev 80224)
@@ -99,6 +99,8 @@
       if(this.attributeValues == null)
          this.attributeValues = new HashSet<AttributeValue>();
       this.attributeValues.add(value); 
+      if(value != null)
+        this.type = value.getType();
    }
 
    public Attribute(URI id, URI type, String issuer, DateTimeAttribute issueInstant,

Added: projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/org/jboss/test/security/sunxacml/attr/AttributeUnitTestCase.java
===================================================================
--- projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/org/jboss/test/security/sunxacml/attr/AttributeUnitTestCase.java	                        (rev 0)
+++ projects/security/security-xacml/trunk/jboss-sunxacml/src/test/java/org/jboss/test/security/sunxacml/attr/AttributeUnitTestCase.java	2008-10-29 20:37:16 UTC (rev 80224)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors. 
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.security.sunxacml.attr;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.jboss.security.xacml.sunxacml.attr.AttributeValue;
+import org.jboss.security.xacml.sunxacml.attr.DateTimeAttribute;
+import org.jboss.security.xacml.sunxacml.attr.StringAttribute;
+import org.jboss.security.xacml.sunxacml.ctx.Attribute;
+
+/**
+ * Test the Attribute Construct
+ * @author Anil.Saldhana at redhat.com
+ * @since Oct 29, 2008
+ */
+public class AttributeUnitTestCase extends TestCase
+{ 
+   /**
+    * SECURITY-206: Attribute type not set in constructor
+    * @throws Exception
+    */
+   public void testAttributeTypeInCTR() throws Exception
+   {
+      URI RESOURCE_URI = new URI("urn:oasis:names:tc:xacml:1.0:resource:resource-id");
+      AttributeValue attributeValue = new StringAttribute("TestAttribute");
+      
+      Attribute attribute = new Attribute(RESOURCE_URI, "somepackage" ,
+            new DateTimeAttribute(), attributeValue);
+      
+      assertNotNull("Attribute type", attribute.getType());
+   } 
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list