当前位置: 首页>>代码示例>>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;未经允许,请勿转载。