Clover.NET coverage report - Coverage for s2dao.net

Coverage timestamp: 2006年5月30日 11:48:56

File Stats: LOC: 77   Methods: 7
NCLOC: 50 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Dao.Id\AbstractIdentifierGenerator.cs 50.0% 66.7% 57.1% 61.9%
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.Reflection;
21   using Seasar.Extension.ADO;
22   using Seasar.Extension.ADO.Impl;
23   using Seasar.Framework.Exceptions;
24  
25   namespace Seasar.Dao.Id
26   {
27   public abstract class AbstractIdentifierGenerator : IIdentifierGenerator
28   {
29   private static IDataReaderHandler dataReaderHandler = new ObjectDataReaderHandler();
30   private string propertyName;
31   private IDbms dbms;
32  
33 67 public AbstractIdentifierGenerator(string propertyName, IDbms dbms)
34   {
35 67 this.propertyName = propertyName;
36 67 this.dbms = dbms;
37   }
38  
39 0 public string PropertyName
40   {
41   get { return this.propertyName; }
42   }
43  
44   public IDbms Dbms
45   {
46 2 get { return this.dbms; }
47   }
48  
49 2 protected object ExecuteSql(IDataSource ds, string sql, object[] args)
50   {
51 2 BasicSelectHandler handler = new BasicSelectHandler(ds, sql, dataReaderHandler);
52 2 return handler.Execute(args);
53   }
54  
55 1 protected void SetIdentifier(object bean, object value)
56   {
57 0 if(propertyName == null) throw new EmptyRuntimeException("propertyName");
58 1 PropertyInfo propertyInfo = bean.GetType().GetProperty(propertyName);
59 1 propertyInfo.SetValue(bean, Convert.ChangeType(value, propertyInfo.PropertyType), null);
60   }
61  
62   #region IIdentifierGenerator メンバ
63  
64 0 public virtual bool IsSelfGenerate
65   {
66   get { throw new NotImplementedException(); }
67   }
68  
69 0 public virtual void SetIdentifier(object bean, Seasar.Extension.ADO.IDataSource ds)
70   {
71   throw new NotImplementedException();
72   }
73  
74   #endregion
75   }
76   }
77