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


Java InitialLdapContext.extendedOperation方法代碼示例

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


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

示例1: testDefaultConstructor

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
public void testDefaultConstructor() throws NamingException {
	System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
			"org.apache.harmony.jndi.tests.javax.naming.spi.mock.MockLdapContextFactory");
	InitialLdapContext ctx = new InitialLdapContext();
	MyExtendedRequest extendedRequest = new MyExtendedRequest("request - 1");
	ctx.extendedOperation(extendedRequest);
	assertTrue(InvokeRecord.equals(null, extendedRequest));

}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:10,代碼來源:InitialLdapContextTest.java

示例2: testExtendedOperation001

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
/**
 * <p>
 * Test method for
 * 'javax.naming.ldap.InitialLdapContext.extendedOperation(ExtendedRequest)'
 * </p>
 * <p>
 * Here we are testing if this method correctly executes the given
 * operation. Here we send a null ExtendedRequest.
 * </p>
 * <p>
 * The expected result is a "NullPointerException".
 * </p>
 */
public void testExtendedOperation001() throws Exception {
    try {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                       "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
        InitialLdapContext ilc = new InitialLdapContext();
        ilc.extendedOperation(null);
        fail("Should not nitialize a ldap context with null.");
    } catch (NullPointerException e) {}

}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:24,代碼來源:TestInitialLdapContext.java

示例3: testExtendedOperation002

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
/**
 * <p>
 * Test method for
 * 'javax.naming.ldap.InitialLdapContext.extendedOperation(ExtendedRequest)'
 * </p>
 * <p>
 * Here we are testing if this method correctly executes the given
 * operation. Here we send a non-null ExtendedRequest.
 * </p>
 * <p>
 * The expected result is an ExtendedResponse.
 * </p>
 */
public void testExtendedOperation002() throws Exception {
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                    "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
    InitialLdapContext x = new InitialLdapContext();
    StartTlsResponse f = (StartTlsResponse)x.extendedOperation(new StartTlsRequest());
    assertNotNull(f);
    x.close();
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:22,代碼來源:TestInitialLdapContext.java

示例4: testExtendedOperation001

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
/**
 * <p>
 * Test method for
 * 'javax.naming.ldap.InitialLdapContext.extendedOperation(ExtendedRequest)'
 * </p>
 * <p>
 * Here we are testing if this method performs an extended operation. Here
 * we send a null extended operation.
 * </p>
 * <p>
 * The expected result is a "NullpointerException".
 * </p>
 */
public void testExtendedOperation001() throws Exception {
    try {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                       "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
        InitialLdapContext ilc = new InitialLdapContext();
        ilc.extendedOperation(null);
        fail("Should not nitialize a ldap context with null.");
    } catch (NullPointerException e) {}

}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:24,代碼來源:TestInitialLdapContext.java

示例5: testExtendedOperation002

import javax.naming.ldap.InitialLdapContext; //導入方法依賴的package包/類
/**
 * <p>
 * Test method for
 * 'javax.naming.ldap.InitialLdapContext.extendedOperation(ExtendedRequest)'
 * </p>
 * <p>
 * Here we are testing if this method performs an extended operation. Here
 * we send a not null extended operation.
 * </p>
 * <p>
 * The expected result is an Extended Response.
 * </p>
 */
public void testExtendedOperation002() throws Exception {
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                    "org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap.MockContextFactory");
    InitialLdapContext x = new InitialLdapContext();
    StartTlsResponse f = (StartTlsResponse)x.extendedOperation(new StartTlsRequest());
    assertNotNull(f);
    x.close();
}
 
開發者ID:freeVM,項目名稱:freeVM,代碼行數:22,代碼來源:TestInitialLdapContext.java


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