Author: igorz
Date: 2008-02-17 11:53:18 -0500 (Sun, 17 Feb 2008)
New Revision: 95981

Added:
   
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Configuration/StandardBindingElementCollectionTest.cs
   trunk/olive/class/System.ServiceModel/Test/config/basicHttpBinding
   trunk/olive/class/System.ServiceModel/Test/config/basicHttpBinding.config
Modified:
   
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/BasicHttpBindingElement.cs
   
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/ChangeLog
   
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/ServiceModelConfigurationElementCollection.cs
   
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingElement.cs
   
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingElementCollection.cs
   trunk/olive/class/System.ServiceModel/System.ServiceModel_test.dll.sources
   
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Configuration/ChangeLog
Log:
2008-02-17  Igor Zelmanovich <[EMAIL PROTECTED]>

        * BasicHttpBindingElement.cs:
        * ServiceModelConfigurationElementCollection.cs:
        * StandardBindingElement.cs: 
        * StandardBindingElementCollection.cs:
        fixed several bugs, make relevant tests pass.           
        
2008-02-17  Igor Zelmanovich <[EMAIL PROTECTED]>

        * StandardBindingElementCollectionTest.cs new test.
        


Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/BasicHttpBindingElement.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/BasicHttpBindingElement.cs
  2008-02-17 16:46:54 UTC (rev 95980)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/BasicHttpBindingElement.cs
  2008-02-17 16:53:18 UTC (rev 95981)
@@ -77,7 +77,7 @@
 
                static BasicHttpBindingElement ()
                {
-                       properties = new ConfigurationPropertyCollection ();
+                       properties = PropertiesInternal;
                        allow_cookies = new ConfigurationProperty 
("allowCookies",
                                typeof (bool), "false", new BooleanConverter 
(), null,
                                ConfigurationPropertyOptions.None);
@@ -123,7 +123,7 @@
                                ConfigurationPropertyOptions.None);
 
                        text_encoding = new ConfigurationProperty 
("textEncoding",
-                               typeof (Encoding), "utf-8", null/* FIXME: get 
converter for Encoding*/, null,
+                               typeof (Encoding), "utf-8", 
EncodingConverter.Instance, null,
                                ConfigurationPropertyOptions.None);
 
                        transfer_mode = new ConfigurationProperty 
("transferMode",

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/ChangeLog
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/ChangeLog
   2008-02-17 16:46:54 UTC (rev 95980)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/ChangeLog
   2008-02-17 16:53:18 UTC (rev 95981)
@@ -1,5 +1,13 @@
-2008-02-17  Igor Zelmanovich <[EMAIL PROTECTED]>
+2008-02-17  Igor Zelmanovich <[EMAIL PROTECTED]>
 
+       * BasicHttpBindingElement.cs:
+       * ServiceModelConfigurationElementCollection.cs:
+       * StandardBindingElement.cs: 
+       * StandardBindingElementCollection.cs:
+       fixed several bugs, make relevant tests pass.           
+       
+2008-02-17  Igor Zelmanovich <[EMAIL PROTECTED]>
+
        * EncodingConverter.cs: added internal class.
        * SecurityAlgorithmSuiteConverter.cs: added internal class.
        * BasicHttpMessageSecurityElement.cs: 

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/ServiceModelConfigurationElementCollection.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/ServiceModelConfigurationElementCollection.cs
       2008-02-17 16:46:54 UTC (rev 95980)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/ServiceModelConfigurationElementCollection.cs
       2008-02-17 16:53:18 UTC (rev 95981)
@@ -38,7 +38,7 @@
                }
 
                public ConfigurationElementType this [int index] {
-                       get { throw new NotImplementedException (); }
+                       get { return (ConfigurationElementType) base.BaseGet 
(index); }
                        set { throw new NotImplementedException (); }
                }
 
@@ -62,13 +62,12 @@
                }
 
                public override ConfigurationElementCollectionType 
CollectionType {
-                       get { return 
ConfigurationElementCollectionType.BasicMap; }
+                       get { return 
ConfigurationElementCollectionType.AddRemoveClearMap; }
                }
 
                protected override string ElementName {
                        get {
-                               Type attrType = typeof 
(ConfigurationCollectionAttribute);
-                               return ((ConfigurationCollectionAttribute) 
Attribute.GetCustomAttribute (GetType (), attrType, true)).AddItemName; 
+                               return AddElementName;
                        }
                }
 

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingElement.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingElement.cs
   2008-02-17 16:46:54 UTC (rev 95980)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingElement.cs
   2008-02-17 16:53:18 UTC (rev 95981)
@@ -66,6 +66,10 @@
                static ConfigurationProperty receive_timeout;
                static ConfigurationProperty send_timeout;
 
+               protected static ConfigurationPropertyCollection 
PropertiesInternal {
+                       get { return properties; }
+               }
+
                static StandardBindingElement ()
                {
                        properties = new ConfigurationPropertyCollection ();

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingElementCollection.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingElementCollection.cs
 2008-02-17 16:46:54 UTC (rev 95980)
+++ 
trunk/olive/class/System.ServiceModel/System.ServiceModel.Configuration/StandardBindingElementCollection.cs
 2008-02-17 16:53:18 UTC (rev 95981)
@@ -69,6 +69,7 @@
 
                public StandardBindingElementCollection ()
                {
+                       AddElementName = "binding";
                }
 
 

Modified: 
trunk/olive/class/System.ServiceModel/System.ServiceModel_test.dll.sources
===================================================================
--- trunk/olive/class/System.ServiceModel/System.ServiceModel_test.dll.sources  
2008-02-17 16:46:54 UTC (rev 95980)
+++ trunk/olive/class/System.ServiceModel/System.ServiceModel_test.dll.sources  
2008-02-17 16:53:18 UTC (rev 95981)
@@ -37,6 +37,7 @@
 System.ServiceModel.Channels/TextMessageEncodingBindingElementTest.cs
 System.ServiceModel.Channels/TransactionFlowBindingElementTest.cs
 System.ServiceModel.Configuration/ServiceModelSectionGroupTest.cs
+System.ServiceModel.Configuration/StandardBindingElementCollectionTest.cs
 System.ServiceModel.Description/ClientCredentialsTest.cs
 System.ServiceModel.Description/ContractDescriptionTest.cs
 System.ServiceModel.Description/MetadataResolverTest.cs

Modified: 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Configuration/ChangeLog
===================================================================
--- 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Configuration/ChangeLog
      2008-02-17 16:46:54 UTC (rev 95980)
+++ 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Configuration/ChangeLog
      2008-02-17 16:53:18 UTC (rev 95981)
@@ -1,3 +1,7 @@
+2008-02-17  Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * StandardBindingElementCollectionTest.cs new test.
+       
 2006-06-27  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * ServiceModelSectionGroupTest.cs : commented out Endpoints().

Added: 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Configuration/StandardBindingElementCollectionTest.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Configuration/StandardBindingElementCollectionTest.cs
        2008-02-17 16:46:54 UTC (rev 95980)
+++ 
trunk/olive/class/System.ServiceModel/Test/System.ServiceModel.Configuration/StandardBindingElementCollectionTest.cs
        2008-02-17 16:53:18 UTC (rev 95981)
@@ -0,0 +1,60 @@
+//
+// StandardBindingElementCollectionTest.cs
+//
+// Author:
+//     Igor Zelmanovich <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Mainsoft, Inc.  http://www.mainsoft.com
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using NUnit.Framework;
+using System;
+using System.Configuration;
+using System.ServiceModel.Configuration;
+using System.Text;
+using System.ServiceModel.Security;
+
+namespace MonoTests.System.ServiceModel.Configuration
+{
+       [TestFixture]
+       public class StandardBindingElementCollectionTest
+       {
+               [Test]
+               public void BasicHttpBinding () {
+                       ServiceModelSectionGroup config = 
(ServiceModelSectionGroup) ConfigurationManager.OpenExeConfiguration 
("Test/config/basicHttpBinding").GetSectionGroup ("system.serviceModel");
+
+                       BasicHttpBindingCollectionElement basicHttpBinding = 
config.Bindings.BasicHttpBinding;
+                       Assert.AreEqual (1, basicHttpBinding.Bindings.Count, 
"count");
+
+                       BasicHttpBindingElement binding = 
basicHttpBinding.Bindings [0];
+                       Assert.AreEqual ("BasicHttpBinding_Service", 
binding.Name, "Name");
+                       Assert.AreEqual (Encoding.UTF8, binding.TextEncoding, 
"Name");
+                       Assert.AreEqual (SecurityAlgorithmSuite.Default, 
binding.Security.Message.AlgorithmSuite, "Name");
+               }
+
+               [Test]
+               public void CollectionType () {
+                       
StandardBindingElementCollection<BasicHttpBindingElement> coll = new 
StandardBindingElementCollection<BasicHttpBindingElement> ();
+                       Assert.AreEqual 
(ConfigurationElementCollectionType.AddRemoveClearMap, coll.CollectionType, 
"CollectionType");
+               }
+       }
+}

Added: trunk/olive/class/System.ServiceModel/Test/config/basicHttpBinding
===================================================================
--- trunk/olive/class/System.ServiceModel/Test/config/basicHttpBinding  
2008-02-17 16:46:54 UTC (rev 95980)
+++ trunk/olive/class/System.ServiceModel/Test/config/basicHttpBinding  
2008-02-17 16:53:18 UTC (rev 95981)
@@ -0,0 +1,3 @@
+DO NOT DELETE,
+IT IS PLACEHOLDER, REQUIRED FOR READING *.config FILE
+USING ConfigurationManager.OpenExeConfiguration API.
\ No newline at end of file

Added: trunk/olive/class/System.ServiceModel/Test/config/basicHttpBinding.config
===================================================================
--- trunk/olive/class/System.ServiceModel/Test/config/basicHttpBinding.config   
2008-02-17 16:46:54 UTC (rev 95980)
+++ trunk/olive/class/System.ServiceModel/Test/config/basicHttpBinding.config   
2008-02-17 16:53:18 UTC (rev 95981)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <system.serviceModel>
+        <bindings>
+            <basicHttpBinding>
+                <binding name="BasicHttpBinding_Service" 
closeTimeout="00:01:00"
+                    openTimeout="00:01:00" receiveTimeout="00:10:00" 
sendTimeout="00:01:00"
+                    allowCookies="false" bypassProxyOnLocal="false" 
hostNameComparisonMode="StrongWildcard"
+                    maxBufferSize="65536" maxBufferPoolSize="524288" 
maxReceivedMessageSize="65536"
+                    messageEncoding="Text" textEncoding="utf-8" 
transferMode="Buffered"
+                    useDefaultWebProxy="true">
+                    <readerQuotas maxDepth="32" maxStringContentLength="8192" 
maxArrayLength="16384"
+                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
+                    <security mode="None">
+                        <transport clientCredentialType="None" 
proxyCredentialType="None"
+                            realm="" />
+                        <message clientCredentialType="UserName" 
algorithmSuite="Default" />
+                    </security>
+                </binding>
+            </basicHttpBinding>
+        </bindings>
+        <client>
+            <endpoint address="http://localhost:2160/WCFWebApp/Service.svc";
+                binding="basicHttpBinding" 
bindingConfiguration="BasicHttpBinding_Service"
+                contract="ServiceReference1.Service" 
name="BasicHttpBinding_Service" />
+        </client>
+    </system.serviceModel>
+</configuration>
\ No newline at end of file

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to