/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 6997561
* @summary A request for better error handling in JNDI
*/
public class EmptyNameSearch {
// Start the LDAP server
s.start();
// Setup JNDI parameters
"com.sun.jndi.ldap.LdapCtxFactory");
try {
// Create initial context
// Exit
throw new RuntimeException();
} catch (NamingException e) {
} catch (Exception e) {
throw e;
}
}
private byte[] bindResponse = {
0x30, 0x0C, 0x02, 0x01, 0x01, 0x61, 0x07, 0x0A,
0x01, 0x00, 0x04, 0x00, 0x04, 0x00
};
private byte[] searchResponse = {
0x30, 0x0C, 0x02, 0x01, 0x02, 0x65, 0x07, 0x0A,
0x01, 0x02, 0x04, 0x00, 0x04, 0x00
};
Server() {
}
public int getPortNumber() {
return serverPort;
}
public void run() {
try {
// Read the LDAP BindRequest
break;
}
// Write an LDAP BindResponse
// Read the LDAP SearchRequest
break;
}
// Write an LDAP SearchResponse
serverSock.close();
} catch (IOException e) {
// ignore
}
}
}
}