Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 84   Methods: 5
NCLOC: 55 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Container\Deployer\RequestComponentDeployer.cs 83.3% 80.0% 40.0% 74.2%
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.Web;
21   using Seasar.Framework.Container;
22   using Seasar.Framework.Container.Util;
23   using Seasar.Framework.Exceptions;
24   using Seasar.Framework.Log;
25   using Seasar.Framework.Util;
26  
27   namespace Seasar.Framework.Container.Deployer
28   {
29   /// <summary>
30   /// RequestComponentDeployer の概要の説明です。
31   /// </summary>
32   public class RequestComponentDeployer : AbstractComponentDeployer
33   {
34   private static Logger logger_ = Logger.GetLogger(typeof(RequestComponentDeployer));
35  
36 4 public RequestComponentDeployer(IComponentDef componentDef)
37   : base(componentDef)
38   {
39   }
40  
41 5 public override object Deploy(Type receiveType)
42   {
43 5 IComponentDef cd = this.ComponentDef;
44 5 HttpContext context = cd.Container.Root.HttpContext;
45 5 if(context == null)
46   {
47 0 ApplicationException ae = new EmptyRuntimeException("HttpContext");
48 0 logger_.Log(ae);
49 0 throw ae;
50   }
51 5 string componentName = cd.ComponentName;
52 5 if(componentName == null)
53   {
54 3 componentName = cd.ComponentType.Name;
55 3 componentName = StringUtil.Decapitalize(componentName);
56   }
57 5 object component = context.Items[componentName];
58 5 if(component != null) return component;
59  
60 4 component = this.ConstructorAssembler.Assemble();
61 4 context.Items[componentName] = component;
62 4 this.PropertyAssembler.Assemble(component);
63 4 this.InitMethodAssembler.Assemble(component);
64  
65 4 object proxy = GetProxy(receiveType);
66 4 return proxy == null ? component : proxy;
67   }
68  
69 0 public override void InjectDependency(object component)
70   {
71   throw new NotSupportedException("InjectDependency");
72   }
73  
74 0 public override void Init()
75   {
76   }
77  
78 0 public override void Destroy()
79   {
80   }
81  
82   }
83   }
84