/src/test/java/com/google/ie/core/common/email/EmailManagerTest.java

http://thoughtsite.googlecode.com/ · Java · 62 lines · 36 code · 13 blank · 13 comment · 0 complexity · 82b4b92d144d742d4b24669fe19d5164 MD5 · raw file

  1. // Copyright 2009 Google Inc. All Rights Reserved.
  2. package com.google.ie.core.common.email;
  3. import com.google.appengine.tools.development.ApiProxyLocalImpl;
  4. import com.google.apphosting.api.ApiProxy;
  5. import com.google.ie.common.email.EmailManager;
  6. import com.google.ie.test.TestEnvironment;
  7. import org.junit.After;
  8. import org.junit.Assert;
  9. import org.junit.Before;
  10. import org.junit.Test;
  11. import java.io.File;
  12. import java.util.ArrayList;
  13. import java.util.List;
  14. /**
  15. *
  16. * @author asirohi
  17. *
  18. */
  19. public class EmailManagerTest {
  20. @Before
  21. public void setUp() throws Exception {
  22. ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment());
  23. ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(".")) {
  24. });
  25. }
  26. @After
  27. public void tearDown() throws Exception {
  28. // not strictly necessary to null these out but there's no harm either
  29. ApiProxy.setDelegate(null);
  30. ApiProxy.setEnvironmentForCurrentThread(null);
  31. }
  32. @Test
  33. public void sendMail() {
  34. // try {
  35. // EmailManager.sendMail("createProject", "anuj",
  36. // "anujsirohi@gmail.com,anuj.sirohi@impetus.co.in", "CloudB");
  37. // } catch (IdeasExchangeException e) {
  38. // Assert.fail("Unexpected exception encountered");
  39. // }
  40. }
  41. @Test
  42. public void getOtherString() {
  43. List<String> list = new ArrayList<String>();
  44. list.add("name");
  45. list.add("projectName");
  46. list.add("otherInfo");
  47. Assert.assertEquals("name,projectName,otherInfo", EmailManager.getStringFromList(list));
  48. }
  49. }