Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 86   Methods: 8
NCLOC: 56 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Container\Factory\SingletonS2ContainerFactory.cs 50.0% 82.4% 75.0% 72.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 Seasar.Framework.Exceptions;
21   using Seasar.Framework.Util;
22   using Seasar.Framework.Xml;
23  
24   namespace Seasar.Framework.Container.Factory
25   {
26   /// <summary>
27   /// SingletonS2ContainerFactory の概要の説明です。
28   /// </summary>
29   public static class SingletonS2ContainerFactory
30   {
31   private static string configPath_ = "app.dicon";
32   private static IS2Container container_;
33  
34 1 static SingletonS2ContainerFactory()
35   {
36 1 S2Section config = S2SectionHandler.GetS2Section();
37 1 if (config != null)
38   {
39 1 string configPath = config.ConfigPath;
40 1 if (!StringUtil.IsEmpty(configPath)) configPath_ = configPath;
41   }
42   }
43  
44   public static string ConfigPath
45   {
46 2 set { configPath_ = value; }
47 3 get { return configPath_; }
48   }
49  
50 44 public static void Init()
51   {
52 44 container_ = S2ContainerFactory.Create(configPath_);
53 44 container_.Init();
54   }
55  
56 44 public static void Destroy()
57   {
58 44 if (container_ != null)
59   {
60 44 container_.Destroy();
61 44 container_ = null;
62   }
63   }
64  
65   public static IS2Container Container
66   {
67 42 get
68   {
69 42 if(container_ == null)
70 0 throw new EmptyRuntimeException("S2Container");
71 42 return container_;
72   }
73 0 set
74   {
75   container_ = value;
76   }
77   }
78  
79 0 public static bool HasContainer
80   {
81   get { return container_ != null; }
82   }
83  
84   }
85   }
86