PageRenderTime 51ms CodeModel.GetById 30ms app.highlight 3ms RepoModel.GetById 17ms app.codeStats 0ms

/src/test/java/com/google/ie/common/util/ClassUtilityTest.java

http://thoughtsite.googlecode.com/
Java | 54 lines | 26 code | 12 blank | 16 comment | 0 complexity | 042ec7551bf81ee5e8287ac2b4489b81 MD5 | raw file
 1// Copyright 2009 Google Inc. All Rights Reserved.
 2/**
 3 * 
 4 */
 5package com.google.ie.common.util;
 6
 7import com.google.ie.business.domain.Idea;
 8import com.google.ie.test.ServiceTest;
 9
10import org.junit.Assert;
11import org.junit.Before;
12import org.junit.Test;
13
14/**
15 * Test class for ClassUtilityTest class
16 * 
17 * @author gmaurya
18 * 
19 */
20public class ClassUtilityTest extends ServiceTest {
21    Idea idea = null;
22
23    /**
24     */
25    @Before
26    public void setUp() {
27        super.setUp();
28
29        idea = new Idea();
30        idea.setKey("userKey");
31        idea.setTitle("ideaTitle");
32        idea.setDescription("decription");
33
34    }
35
36    /**
37     * Test method for
38     * {@link com.google.ie.common.util.ClassUtility#getObject(Object,String)} .
39     */
40    @Test
41    public void getObject() {
42
43        try {
44            String actual = (String) ClassUtility.getObject(idea, "title");
45            Assert.assertEquals(idea.getTitle(), actual);
46
47        } catch (Exception e) {
48
49            Assert.fail();
50        }
51
52    }
53
54}