/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. */
  5. package com.google.ie.common.util;
  6. import com.google.ie.business.domain.Idea;
  7. import com.google.ie.test.ServiceTest;
  8. import org.junit.Assert;
  9. import org.junit.Before;
  10. import org.junit.Test;
  11. /**
  12. * Test class for ClassUtilityTest class
  13. *
  14. * @author gmaurya
  15. *
  16. */
  17. public class ClassUtilityTest extends ServiceTest {
  18. Idea idea = null;
  19. /**
  20. */
  21. @Before
  22. public void setUp() {
  23. super.setUp();
  24. idea = new Idea();
  25. idea.setKey("userKey");
  26. idea.setTitle("ideaTitle");
  27. idea.setDescription("decription");
  28. }
  29. /**
  30. * Test method for
  31. * {@link com.google.ie.common.util.ClassUtility#getObject(Object,String)} .
  32. */
  33. @Test
  34. public void getObject() {
  35. try {
  36. String actual = (String) ClassUtility.getObject(idea, "title");
  37. Assert.assertEquals(idea.getTitle(), actual);
  38. } catch (Exception e) {
  39. Assert.fail();
  40. }
  41. }
  42. }