avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: avalon-sandbox/csframework/src/test/Context ContextExceptionTestCase.cs DefaultContextTestCase.cs
Date Thu, 26 Jun 2003 18:19:40 GMT
bloritsch    2003/06/26 11:19:40

  Modified:    csframework AvalonFramework.build
               csframework/src/cs/Context DefaultContext.cs
  Added:       csframework/src/test/Context ContextExceptionTestCase.cs
                        DefaultContextTestCase.cs
  Log:
  make nant clean up the temp files
  
  Revision  Changes    Path
  1.11      +4 -4      avalon-sandbox/csframework/AvalonFramework.build
  
  Index: AvalonFramework.build
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/csframework/AvalonFramework.build,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AvalonFramework.build	26 Jun 2003 16:00:30 -0000	1.10
  +++ AvalonFramework.build	26 Jun 2003 18:19:39 -0000	1.11
  @@ -29,8 +29,7 @@
            <includes name="${nant.location}/nunit.framework.dll"/>
          </references>
          <sources basedir="src/test">
  -         <includes name="*.cs"/>
  -         <includes name="Configuration/*.cs"/>
  +         <includes name="**.cs"/>
          </sources>
        </csc>
     </target>
  @@ -88,13 +87,14 @@
     </target>
   
     <target name="clean" description="Clean up after ourselves">
  -    <delete>
  -      <fileset>
  +    <delete verbose="true">
  +      <fileset defaultexcludes="false">
           <includes name="*.pdb"/>
           <includes name="*.dll"/>
           <includes name="*.xml"/>
           <includes name="*.chm"/>
           <includes name="doc"/>
  +        <includes name="**.*~"/>
         </fileset>
       </delete>
     </target>
  
  
  
  1.10      +1 -1      avalon-sandbox/csframework/src/cs/Context/DefaultContext.cs
  
  Index: DefaultContext.cs
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/csframework/src/cs/Context/DefaultContext.cs,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultContext.cs	24 Jun 2003 12:18:25 -0000	1.9
  +++ DefaultContext.cs	26 Jun 2003 18:19:39 -0000	1.10
  @@ -97,7 +97,7 @@
   		/// </summary>
   		/// <param name="data">The Context data.</param>
   		/// <param name="context">The Parent context (may be null).</param>
  -		public DefaultContext(IDictionary data, IContext context)
  +		protected DefaultContext(IDictionary data, IContext context)
   		{
   			parent = context;
   			components = data;
  
  
  
  1.1                  avalon-sandbox/csframework/src/test/Context/ContextExceptionTestCase.cs
  
  Index: ContextExceptionTestCase.cs
  ===================================================================
  // ============================================================================
  //                   The Apache Software License, Version 1.1
  // ============================================================================
  // 
  // Copyright (C) 2002-2003 The Apache Software Foundation. All rights reserved.
  // 
  // Redistribution and use in source and binary forms, with or without modifica-
  // tion, are permitted provided that the following conditions are met:
  // 
  // 1. Redistributions of  source code must  retain the above copyright  notice,
  //    this list of conditions and the following disclaimer.
  // 
  // 2. Redistributions in binary form must reproduce the above copyright notice,
  //    this list of conditions and the following disclaimer in the documentation
  //    and/or other materials provided with the distribution.
  // 
  // 3. The end-user documentation included with the redistribution, if any, must
  //    include  the following  acknowledgment:  "This product includes  software
  //    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  //    Alternately, this  acknowledgment may  appear in the software itself,  if
  //    and wherever such third-party acknowledgments normally appear.
  // 
  // 4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation"  
  //    must not be used to endorse or promote products derived from this  software 
  //    without  prior written permission. For written permission, please contact 
  //    apache@apache.org.
  // 
  // 5. Products  derived from this software may not  be called "Apache", nor may
  //    "Apache" appear  in their name,  without prior written permission  of the
  //    Apache Software Foundation.
  // 
  // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  // FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  // APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  // INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  // DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  // OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  // ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  // (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  // 
  // This software  consists of voluntary contributions made  by many individuals
  // on  behalf of the Apache Software  Foundation. For more  information on the 
  // Apache Software Foundation, please see <http://www.apache.org/>.
  // ============================================================================
  
  
  using System;
  using System.Runtime.Serialization;
  using NUnit.Framework;
  
  namespace Apache.Avalon.Framework.Context
  {
  	[TestFixture]
  	public class ContextExceptionTest
  	{
  		[Test] public void Constructor()
  		{
  			Assertion.AssertNotNull( new ContextException() );
  			Assertion.AssertNotNull( new ContextException( "message" ) );
  			Assertion.AssertNotNull( new ContextException( "message", new Exception() ) );
  		}
  
  		[Test] public void Message()
  		{
  			ContextException ce = new ContextException("message");
  			Assertion.AssertEquals( "message", ce.Message );
  			Assertion.AssertNull( ce.InnerException );
  
  			Exception inner = new Exception("inner");
  			ce = new ContextException("message", inner);
  			Assertion.AssertEquals("message", ce.Message);
  			Assertion.AssertEquals( inner, ce.InnerException );
  			Assertion.AssertEquals( "inner", ce.InnerException.Message );
  		}
  	}
  }
  
  
  
  1.1                  avalon-sandbox/csframework/src/test/Context/DefaultContextTestCase.cs
  
  Index: DefaultContextTestCase.cs
  ===================================================================
  // ============================================================================
  //                   The Apache Software License, Version 1.1
  // ============================================================================
  // 
  // Copyright (C) 2002-2003 The Apache Software Foundation. All rights reserved.
  // 
  // Redistribution and use in source and binary forms, with or without modifica-
  // tion, are permitted provided that the following conditions are met:
  // 
  // 1. Redistributions of  source code must  retain the above copyright  notice,
  //    this list of conditions and the following disclaimer.
  // 
  // 2. Redistributions in binary form must reproduce the above copyright notice,
  //    this list of conditions and the following disclaimer in the documentation
  //    and/or other materials provided with the distribution.
  // 
  // 3. The end-user documentation included with the redistribution, if any, must
  //    include  the following  acknowledgment:  "This product includes  software
  //    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  //    Alternately, this  acknowledgment may  appear in the software itself,  if
  //    and wherever such third-party acknowledgments normally appear.
  // 
  // 4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation"  
  //    must not be used to endorse or promote products derived from this  software 
  //    without  prior written permission. For written permission, please contact 
  //    apache@apache.org.
  // 
  // 5. Products  derived from this software may not  be called "Apache", nor may
  //    "Apache" appear  in their name,  without prior written permission  of the
  //    Apache Software Foundation.
  // 
  // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  // FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  // APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  // INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  // DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  // OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  // ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  // (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  // 
  // This software  consists of voluntary contributions made  by many individuals
  // on  behalf of the Apache Software  Foundation. For more  information on the 
  // Apache Software Foundation, please see <http://www.apache.org/>.
  // ============================================================================
  
  
  using System;
  using System.Collections;
  using System.Runtime.Serialization; 
  
  using Apache.Avalon.Framework.Util;
  using NUnit.Framework;
  
  namespace Apache.Avalon.Framework.Context
  {
  	[TestFixture]
  	public class DefaultContextTest
  	{
  		private IDictionary data = new Hashtable();
  
  		public DefaultContextTest()
  		{
  			data.Add("test", "value");
  		}
  		
  		[Test] public void Constructors()
  		{
  			IContext context = new DefaultContext();
  			Assertion.AssertNotNull( context );
  
  			context = new DefaultContext( data );
  			Assertion.AssertEquals( "value", data["test"] );
  			data["test"] = "newValue";
  
  			context = new DefaultContext( context );
  			Assertion.AssertEquals( "newValue", data["test"] );
  		}
  
  		[Test] public void ReadOnly()
  		{
  			DefaultContext context = new DefaultContext( data );
  			Assertion.AssertEquals( false, context.IsReadOnly );
  			
  			context.MakeReadOnly();
  			Assertion.Assert( context.IsReadOnly );
  
  			try
  			{
  				context["test"] = "foo";
  			}
  			catch(ContextException ce)
  			{
  				Assertion.AssertEquals("Context is read only and can not be modified", ce.Message);
  			}
  		}
  	}
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message