PageRenderTime 28ms CodeModel.GetById 22ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

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