Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/jellyfish/ConnectionManagerMock.java


1   package org.jellyfish;
2   
3   import javax.naming.NamingException;
4   import javax.naming.directory.DirContext;
5   
6   import mock.javax.naming.directory.DirContextMock;
7   
8   public class ConnectionManagerMock implements ConnectionManager {
9   
10      public boolean getContextCalled;
11      public DirContextMock getContextReturn;
12      public DirContext getContext() {
13          getContextCalled = true;
14          return getContextReturn;
15      }
16  
17      public boolean getContextIICalled;
18      public String getContextIIUserName;
19      public String getContextIIPassword;
20      public DirContext getContextIIReturn;
21      public NamingException getContextIINamingException;
22      public DirContext getContext(String userName, String password) throws NamingException {
23          getContextIICalled = true;
24          getContextIIUserName = userName;
25          getContextIIPassword = password;
26          if (getContextIINamingException != null) {
27              throw getContextIINamingException;
28          }
29          return getContextIIReturn;
30      }
31  
32  }