Clover.NET coverage report - Coverage for s2container.net

Coverage timestamp: 2006年5月30日 11:21:29

File Stats: LOC: 74   Methods: 3
NCLOC: 42 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Xml\S2XmlResolver.cs 75.0% 100.0% 66.7% 85.7%
coverage coverage
1   #region Copyright
2   /*
3   * Copyright 2005 the Seasar Foundation and the Others.
4   *
5   * Licensed under the Apache License, Version 2.0 (the "License");
6   * you may not use this file except in compliance with the License.
7   * You may obtain a copy of the License at
8   *
9   * http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14   * either express or implied. See the License for the specific language
15   * governing permissions and limitations under the License.
16   */
17   #endregion
18  
19   using System;
20   using System.IO;
21   using System.Xml;
22   using System.Web;
23   using System.Reflection;
24   using Seasar.Framework.Util;
25  
26   namespace Seasar.Framework.Xml
27   {
28   /// <summary>
29   /// S2XmlResolver の概要の説明です。
30   /// </summary>
31   public class S2XmlResolver : XmlResolver
32   {
33   public const string PUBLIC_ID = "-/SEASAR/DTD S2Container/EN";
34   public const string PUBLIC_ID21 = "-/SEASAR2.1/DTD S2Container/EN";
35  
36   public const string COMPONENTS_URI = "http://www.seasar.org/dtd/components.dtd";
37   public const string COMPONENTS_URI21 = "http://www.seasar.org/dtd/components21.dtd";
38  
39   public const string COMPONENTS_PATH = "components.dtd";
40   public const string COMPONENTS_PATH21 = "components21.dtd";
41  
42 147 public S2XmlResolver()
43   {
44   }
45  
46 140 public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn)
47   {
48 140 Stream stream = null;
49  
50 140 string uri = HttpUtility.UrlDecode(absoluteUri.AbsoluteUri);
51  
52 140 if(uri.EndsWith(PUBLIC_ID) || COMPONENTS_URI.Equals(uri))
53   {
54 18 stream = ResourceUtil.GetResourceAsStream(COMPONENTS_PATH, Assembly.GetExecutingAssembly());
55   }
56 122 else if(uri.EndsWith(PUBLIC_ID21) || COMPONENTS_URI21.Equals(uri))
57   {
58 122 stream = ResourceUtil.GetResourceAsStream(COMPONENTS_PATH21, Assembly.GetExecutingAssembly());
59   }
60  
61 140 return stream;
62   }
63  
64 0 public override System.Net.ICredentials Credentials
65   {
66   set
67   {
68   }
69   }
70  
71  
72   }
73   }
74