當前位置: 首頁>>代碼示例>>Java>>正文


Java InitialLdapContext.reconnect方法代碼示例

本文整理匯總了Java中javax.naming.ldap.InitialLdapContext.reconnect方法的典型用法代碼示例。如果您正苦於以下問題:Java InitialLdapContext.reconnect方法的具體用法?Java InitialLdapContext.reconnect怎麽用?Java InitialLdapContext.reconnect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.naming.ldap.InitialLdapContext的用法示例。


在下文中一共展示了InitialLdapContext.reconnect方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testReconnect003

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
/**
 * <p>
 * Test method for
 * 'javax.naming.ldap.InitialLdapContext.reconnect(Control[])'
 * </p>
 * <p>
 * Here we are testing if this method correctly reconnects to the LDAP
 * server. In this case we are using a different set of controls for the
 * reconnection.
 * </p>
 * <p>
 * The expected result is a reconection with the new set of controls.
 * </p>
 */
public void testReconnect003() throws Exception {
    System
            .setProperty(Context.INITIAL_CONTEXT_FACTORY,
                    "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
    Control[] cs = {
            new MockControl("c1", false, new byte[] { 1, 2, 3, 4 }),
            new MockControl("c1", true, new byte[] { 'a', 'b', 'c', 'd' }), };
    Control[] cs2 = {
            new MockControl("c2", false, new byte[] { 1, 2, 3, 4 }),
            new MockControl("c2", true, new byte[] { 'a', 'b', 'c', 'd' }), };
    InitialLdapContext ilc = new InitialLdapContext(null, cs);
    ilc.reconnect(cs2);
    assertEquals(cs2, ilc.getConnectControls());
    ilc.close();
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:30,代碼來源:TestInitialLdapContext.java

示例2: testReconnect003

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
/**
 * <p>
 * Test method for
 * 'javax.naming.ldap.InitialLdapContext.reconnect(Control[])'
 * </p>
 * <p>
 * Here we are testing if this method reconnects to the LDAP server using
 * the supplied controls and this context's environment. In this case we are
 * sending a new set of controls to reconection.
 * </p>
 * <p>
 * The expected result is a reconection with the new set of controls.
 * </p>
 */
public void testReconnect003() throws Exception {
    System
            .setProperty(Context.INITIAL_CONTEXT_FACTORY,
                    "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
    Control[] cs = {
            new MockControl("c1", false, new byte[] { 1, 2, 3, 4 }),
            new MockControl("c1", true, new byte[] { 'a', 'b', 'c', 'd' }), };
    Control[] cs2 = {
            new MockControl("c2", false, new byte[] { 1, 2, 3, 4 }),
            new MockControl("c2", true, new byte[] { 'a', 'b', 'c', 'd' }), };
    InitialLdapContext ilc = new InitialLdapContext(null, cs);
    ilc.reconnect(cs2);
    assertEquals(cs2, ilc.getConnectControls());
    ilc.close();
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:30,代碼來源:TestInitialLdapContext.java

示例3: testReconnect001

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
/**
 * <p>
 * Test method for
 * 'javax.naming.ldap.InitialLdapContext.reconnect(Control[])'
 * </p>
 * <p>
 * Here we are testing if this method correctly reconnects to the LDAP
 * server. In this case we are using a null argument.
 * </p>
 * <p>
 * The expected result is a reconection with no controls.
 * </p>
 */
public void testReconnect001() throws Exception {
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                    "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
    InitialLdapContext ilc = new InitialLdapContext();
    ilc.reconnect(null);
    assertNull(ilc.getConnectControls());
    ilc.close();
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:22,代碼來源:TestInitialLdapContext.java

示例4: testReconnect002

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
/**
 * <p>
 * Test method for
 * 'javax.naming.ldap.InitialLdapContext.reconnect(Control[])'
 * </p>
 * <p>
 * Here we are testing if this method correctly reconnects to the LDAP
 * server In this case we are using a non-null argument.
 * </p>
 * <p>
 * The expected result is a reconection with the controls sended.
 * </p>
 */
public void testReconnect002() throws Exception {
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                    "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
    Control[] cs = {
            new MockControl("c1", false, new byte[] { 1, 2, 3, 4 }),
            new MockControl("c1", true, new byte[] { 'a', 'b', 'c', 'd' }), };
    InitialLdapContext ilc = new InitialLdapContext();
    ilc.reconnect(cs);
    assertEquals(cs, ilc.getConnectControls());
    ilc.close();
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:25,代碼來源:TestInitialLdapContext.java

示例5: testReconnect001

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
/**
 * <p>
 * Test method for
 * 'javax.naming.ldap.InitialLdapContext.reconnect(Control[])'
 * </p>
 * <p>
 * Here we are testing if this method reconnects to the LDAP server using
 * the supplied controls and this context's environment. In this case we are
 * sending a set of null controls.
 * </p>
 * <p>
 * The expected result is a reconection with no controls.
 * </p>
 */
public void testReconnect001() throws Exception {
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                    "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
    InitialLdapContext ilc = new InitialLdapContext();
    ilc.reconnect(null);
    assertNull(ilc.getConnectControls());
    ilc.close();
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:23,代碼來源:TestInitialLdapContext.java

示例6: testReconnect002

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
/**
 * <p>
 * Test method for
 * 'javax.naming.ldap.InitialLdapContext.reconnect(Control[])'
 * </p>
 * <p>
 * Here we are testing if this method reconnects to the LDAP server using
 * the supplied controls and this context's environment. In this case we are
 * sending a set not null of controls.
 * </p>
 * <p>
 * The expected result is a reconection with the controls sended.
 * </p>
 */
public void testReconnect002() throws Exception {
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                    "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
    Control[] cs = {
            new MockControl("c1", false, new byte[] { 1, 2, 3, 4 }),
            new MockControl("c1", true, new byte[] { 'a', 'b', 'c', 'd' }), };
    InitialLdapContext ilc = new InitialLdapContext();
    ilc.reconnect(cs);
    assertEquals(cs, ilc.getConnectControls());
    ilc.close();
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:26,代碼來源:TestInitialLdapContext.java


注:本文中的javax.naming.ldap.InitialLdapContext.reconnect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。