Return-Path: Delivered-To: apmail-incubator-directory-cvs-archive@www.apache.org Received: (qmail 56835 invoked from network); 3 Dec 2004 13:26:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 3 Dec 2004 13:26:59 -0000 Received: (qmail 61268 invoked by uid 500); 3 Dec 2004 13:26:59 -0000 Delivered-To: apmail-incubator-directory-cvs-archive@incubator.apache.org Received: (qmail 61228 invoked by uid 500); 3 Dec 2004 13:26:58 -0000 Mailing-List: contact directory-cvs-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: directory-dev@incubator.apache.org Delivered-To: mailing list directory-cvs@incubator.apache.org Received: (qmail 61194 invoked by uid 99); 3 Dec 2004 13:26:58 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Fri, 03 Dec 2004 05:26:57 -0800 Received: (qmail 56753 invoked by uid 65534); 3 Dec 2004 13:26:55 -0000 Date: 3 Dec 2004 13:26:55 -0000 Message-ID: <20041203132655.56746.qmail@minotaur.apache.org> From: vtence@apache.org To: directory-cvs@incubator.apache.org Subject: svn commit: r109674 - /incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/Dom4JPolicyBuilderTest.java /incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/policy.xml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: vtence Date: Fri Dec 3 05:26:55 2004 New Revision: 109674 URL: http://svn.apache.org/viewcvs?view=rev&rev=109674 Log: Started work on XML Policy builder Added: incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/Dom4JPolicyBuilderTest.java incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/policy.xml Added: incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/Dom4JPolicyBuilderTest.java Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/Dom4JPolicyBuilderTest.java?view=auto&rev=109674 ============================================================================== --- (empty file) +++ incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/Dom4JPolicyBuilderTest.java Fri Dec 3 05:26:55 2004 @@ -0,0 +1,55 @@ +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.janus.script.xml; + +import org.jmock.Mock; +import org.jmock.MockObjectTestCase; +import org.apache.janus.authentication.attribute.MutableInformationProvider; + +import java.io.StringReader; + +public class Dom4JPolicyBuilderTest extends MockObjectTestCase +{ + public void testSupportsDenyOverridesPolicyAlgorithm() throws Exception + { +// Dom4JRoleBuilder builder = Dom4JRoleBuilder.fromReader( new StringReader( emptyDenyOverridesPolicy() ) ); +// +// Mock mockProvider = new Mock( MutableInformationProvider.class ); +// mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Usernames.joe() ), eq( Roles.user() ) ).will( returnValue( true ) ); +// mockProvider.expects( once() ).method( "addAttribute" ).with( eq( Usernames.joe() ), eq( Roles.developer() ) ).will( returnValue( true ) ); +// +// builder.buildProvider( ( MutableInformationProvider ) mockProvider.proxy() ); +// +// mockProvider.verify(); + } + + private String emptyDenyOverridesPolicy() + { + String content = + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + ""; + return content; + } +} Added: incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/policy.xml Url: http://svn.apache.org/viewcvs/incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/policy.xml?view=auto&rev=109674 ============================================================================== --- (empty file) +++ incubator/directory/janus/trunk/script/src/test/org/apache/janus/script/xml/policy.xml Fri Dec 3 05:26:55 2004 @@ -0,0 +1,23 @@ + + + + + admin + developer + joeblow + + + + + + + + + + + + + + + + \ No newline at end of file