本文整理匯總了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));
}
示例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) {}
}
示例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();
}
示例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) {}
}
示例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();
}