Clover Coverage Report - SaveApp Coverage Report
Coverage timestamp: mar dic 23 2014 15:53:11 EST
../../../../img/srcFileCovDistChart2.png 74% of files have more coverage
28   83   15   2,33
6   69   0,54   12
12     1,25  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  Album       Line # 7 28 15 19,6% 0.19565217
 
No Tests
 
1    package com.loopback.androidapps.saveapp;
2   
3    import android.content.ContentValues;
4    import android.database.Cursor;
5    import android.util.Log;
6   
 
7    public class Album implements SaveAppTable {
8    private DBManager dbManager;
9    private int id;
10    private String description;
11    Cursor cursor;
12    public static SaveApp saveApp;
13   
 
14  46 toggle public Album() {
15  46 description = null;
16  46 dbManager = saveApp.getDbManager();
17    }
18   
 
19  0 toggle public Album(int _id, String _description) {
20  0 description = _description;
21  0 dbManager = saveApp.getDbManager();
22    }
23   
 
24  0 toggle public void setId(int id) {
25  0 this.id = id;
26    }
27   
 
28  0 toggle public int getId() {
29  0 return id;
30    }
31   
 
32  0 toggle public void setDescription(String description) {
33  0 this.description = description;
34    }
35   
 
36  0 toggle public String getDescription() {
37  0 return description;
38    }
39   
 
40  0 toggle public int insert() {
41  0 ContentValues cv = new ContentValues();
42  0 cv.put(DBManager.ALBUM_COLUMN_FILE, description);
43  0 return dbManager.insert(DBManager.ALBUM_TABLE, cv);
44    }
45   
 
46  0 toggle public void update() {
47  0 ContentValues cv = new ContentValues();
48  0 cv.put(DBManager.ALBUM_COLUMN_FILE, description);
49  0 dbManager.update(id, DBManager.ALBUM_TABLE, cv);
50    }
51   
 
52  0 toggle public void delete() {
53  0 dbManager.delete(id, DBManager.ALBUM_TABLE);
54    }
55   
 
56  0 toggle public void inflate(int _id) {
57  0 id = _id;
58  0 cursor = dbManager.select(id, DBManager.ALBUM_TABLE_ID);
59  0 int i = 0;
60  0 Log.i("AC" + "AL", "Read Cursor");
61  0 if (cursor.moveToFirst())
62  0 do {
63  0 description = cursor.getString(cursor
64    .getColumnIndexOrThrow(DBManager.ALBUM_COLUMN_FILE));
65  0 i++;
66  0 } while (cursor.moveToNext());
67    }
68   
 
69  5 toggle public boolean existDescription(String value) {
70  5 return dbManager.exist(DBManager.ALBUM_TABLE,
71    DBManager.ALBUM_COLUMN_FILE, value);
72    }
73   
 
74  5 toggle public int insertOrGetId(String value) {
75  5 if (existDescription(value))
76  5 return dbManager.getId(DBManager.ALBUM_TABLE,
77    DBManager.ALBUM_COLUMN_FILE, value);
78    else {
79  0 description = value;
80  0 return insert();
81    }
82    }
83    }