Clover.NET coverage report - Coverage for s2container.net

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

File Stats: LOC: 46   Methods: 1
NCLOC: 35 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Framework.Aop\Impl\AopProxyAspectWeaver.cs 83.3% 92.9% 100.0% 90.5%
coverage coverage
1   using System;
2   using System.Collections;
3   using Seasar.Framework.Container;
4   using Seasar.Framework.Aop.Proxy;
5  
6   namespace Seasar.Framework.Aop.Impl
7   {
8   /// <summary>
9   /// AopProxyを用いてAspectを織り込む処理を持つクラス
10   /// </summary>
11   public class AopProxyAspectWeaver : AbstractAspectWeaver
12   {
13   /// <summary>
14   /// AopProxyを用いてAspectを織り込む
15   /// </summary>
16   /// <param name="target">Aspectを織り込む対象のオブジェクト</param>
17   /// <param name="componentDef">Aspectを織り込む対象のコンポーネント定義</param>
18 34 public override void WeaveAspect(ref object target, Seasar.Framework.Container.IComponentDef componentDef)
19   {
20 0 if (componentDef.AspectDefSize == 0) return;
21 34 Hashtable parameters = new Hashtable();
22 34 parameters[ContainerConstants.COMPONENT_DEF_NAME] = componentDef;
23  
24 34 Type[] interfaces = componentDef.ComponentType.GetInterfaces();
25 34 if (componentDef.ComponentType.IsMarshalByRef)
26   {
27 10 AopProxy aopProxy = new AopProxy(componentDef.ComponentType,
28   GetAspects(componentDef), parameters, target);
29 10 componentDef.AddProxy(componentDef.ComponentType, aopProxy.Create());
30   }
31 24 else if (componentDef.ComponentType.IsInterface)
32   {
33 4 AopProxy aopProxy = new AopProxy(componentDef.ComponentType,
34   GetAspects(componentDef), parameters, target);
35 4 target = aopProxy.Create();
36   }
37 34 foreach (Type interfaceType in interfaces)
38   {
39 29 AopProxy aopProxy = new AopProxy(interfaceType,
40   GetAspects(componentDef), parameters, target);
41 29 componentDef.AddProxy(interfaceType, aopProxy.Create());
42   }
43   }
44   }
45   }
46