EMMA Coverage Report (generated Tue Jun 26 14:54:12 CEST 2012)
[all classes][org.tomdroid.util]

COVERAGE SUMMARY FOR SOURCE FILE [FirstNote.java]

nameclass, %method, %block, %line, %
FirstNote.java100% (1/1)75%  (3/4)67%  (31/46)75%  (9/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FirstNote100% (1/1)75%  (3/4)67%  (31/46)75%  (9/12)
FirstNote (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getString (String): String 100% (1/1)25%  (4/16)33%  (1/3)
<static initializer> 100% (1/1)100% (4/4)100% (1/1)
createFirstNote (): Note 100% (1/1)100% (23/23)100% (7/7)

1/*
2 * Tomdroid
3 * Tomboy on Android
4 * http://www.launchpad.net/tomdroid
5 * 
6 * Copyright 2010 Olivier Bilodeau <olivier@bottomlesspit.org>
7 * 
8 * This file is part of Tomdroid.
9 * 
10 * Tomdroid is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 * 
15 * Tomdroid is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU General Public License for more details.
19 * 
20 * You should have received a copy of the GNU General Public License
21 * along with Tomdroid.  If not, see <http://www.gnu.org/licenses/>.
22 */
23package org.tomdroid.util;
24 
25import java.util.MissingResourceException;
26import java.util.ResourceBundle;
27 
28import org.tomdroid.Note;
29 
30import android.util.Log;
31 
32/**
33 * Creates an introductory note object 
34 * @author Olivier Bilodeau <olivier@bottomlesspit.org>
35 *
36 */
37public class FirstNote {
38 
39        // Logging info
40        private static final String        TAG = "FirstNote";
41        
42        public static Note createFirstNote() {
43                Log.v(TAG, "Creating first note");
44                
45                Note note = new Note();
46                
47                note.setTitle("Tomdroid's first note");
48                // FIXME as soon as we can create notes, make sure GUID is unique! 
49                note.setGuid("8f837a99-c920-4501-b303-6a39af57a714");
50                note.setLastChangeDate("2010-10-09T16:50:12.219-04:00");
51                note.setXmlContent(getString("FirstNote.Content"));
52                
53                return note;
54        }
55 
56        // I bundled the note's content to avoid the hassle of Java strings (escaping quotes and the lack of multi-line support)
57        private static final String BUNDLE_NAME = "org.tomdroid.util.FirstNote";
58        private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
59 
60        private static String getString(String key) {
61                try {
62                        return RESOURCE_BUNDLE.getString(key);
63                } catch (MissingResourceException e) {
64                        return '!' + key + '!';
65                }
66        }
67 
68}

[all classes][org.tomdroid.util]
EMMA 0.0.0 (unsupported private build) (C) Vladimir Roubtsov