1
2
3
4
5
6
7
8
9 package net.kwfgrid.gwes;
10
11 import junit.framework.Assert;
12 import junit.framework.Test;
13 import junit.framework.TestSuite;
14 import net.kwfgrid.gwes.client.GWESClient;
15 import net.kwfgrid.gwes.exception.LoggingException;
16 import net.kwfgrid.gwes.util.StringUtils;
17 import org.apache.log4j.Logger;
18 import org.ietf.jgss.GSSException;
19
20 import java.io.IOException;
21
22
23
24
25
26
27
28 public final class GWESGlobusProxyTest extends LocalGWESAbstractTestCase {
29
30 static Logger logger = Logger.getLogger(GWESGlobusProxyTest.class);
31
32
33
34
35
36
37 public GWESGlobusProxyTest(String testName) throws LoggingException {
38 super(testName);
39 }
40
41
42
43
44 public static Test suite() {
45 return new TestSuite(GWESGlobusProxyTest.class);
46 }
47
48 public void testCredential() throws IOException, GSSException, LoggingException {
49
50 CredentialManager credentialManager = new CredentialManager();
51 String dn = credentialManager.getDN();
52 logger.info("DN1="+dn);
53 String cn = credentialManager.getFilteredCN();
54 logger.info("CN1="+cn);
55
56 String userIdCredential = GWESClient.getUserIDWithCredential(System.getProperty("user.name", "nn"));
57 CredentialManager credentialManager2 = new CredentialManager(userIdCredential);
58 String dn2 = credentialManager2.getDN();
59 logger.info("DN2="+dn);
60 String cn2 = credentialManager2.getFilteredCN();
61 logger.info("CN2="+cn);
62 Assert.assertEquals("DN",dn,dn2);
63 Assert.assertEquals("CN",cn,cn2);
64 }
65
66
67
68
69
70
71
72 }