Example usage for javax.naming Name equals

List of usage examples for javax.naming Name equals

Introduction

In this page you can find the example usage for javax.naming Name equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:fr.mtlx.odm.spring.SpringOperationsImpl.java

private DirContextOperations doContextLookup(final Name dn) {
    final DirContextOperations ctx = operations.lookupContext(checkNotNull(dn, "dn is null"));

    final Name _dn = ctx.getDn();

    assert dn.equals(_dn) : "lookup DN does not match context DN";

    if (log.isDebugEnabled()) {
        log.debug("lookup context {} done", _dn);
    }//from w w w.ja  va2  s  .co m

    return ctx;
}

From source file:org.force66.beantester.utils.GenericProxyHandlerTest.java

@Test
public void testBasic() throws Exception {

    performRoundTrip(this.makeProxy(Name.class));

    Name nameProxy = (Name) this.makeProxy(Name.class);
    Assert.assertTrue(!nameProxy.equals(null));
    Assert.assertTrue(!nameProxy.equals("foo"));
    Assert.assertTrue(new GenericProxyHandler() != null);

    try {//  w w  w. j av a  2 s .c  o  m
        nameProxy.getAll();
        Assert.fail();
    } catch (Exception e) {
        Assert.assertTrue(e.getMessage().contains("This is a generic interface proxy with no functionality"));
    }

}