Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 878276 Details for
Bug 1077895
Memory leak with proxy auth control
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
The java source file
LoadTest.java (text/x-java), 2.27 KB, created by
mreynolds
on 2014-03-25 01:19:05 UTC
(
hide
)
Description:
The java source file
Filename:
MIME Type:
Creator:
mreynolds
Created:
2014-03-25 01:19:05 UTC
Size:
2.27 KB
patch
obsolete
>import com.sun.jndi.ldap.ctl.ProxiedAuthorizationControl; > >import java.io.IOException; >import java.util.ArrayList; >import java.util.Hashtable; > >import javax.naming.Context; >import javax.naming.NamingEnumeration; >import javax.naming.NamingException; >import javax.naming.directory.SearchControls; >import javax.naming.ldap.Control; >import javax.naming.ldap.InitialLdapContext; >import javax.naming.ldap.LdapContext; > >public class LoadTest >{ > private SearchControls getSimpleSearchControls() > { > final SearchControls searchControls = new SearchControls(); > searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); > searchControls.setTimeLimit(30000); > return searchControls; > } > > public LdapContext getLdapContext() throws NamingException > { > LdapContext ctx = null; > final Hashtable env = new Hashtable(); > env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); > env.put(Context.SECURITY_AUTHENTICATION, "Simple"); > env.put(Context.SECURITY_PRINCIPAL, "uid=AUser,o=Test.com"); > env.put(Context.SECURITY_CREDENTIALS, "password"); > env.put(Context.PROVIDER_URL, "ldap://localhost.localdomain:389/o=test.com"); > ctx = new InitialLdapContext(env, null); > return ctx; > } > > public void search(final LdapContext ctx) throws NamingException > { > final NamingEnumeration<?> namingEnum = ctx.search("", "(uid=SUser)", getSimpleSearchControls()); > while (namingEnum.hasMore()) > { > namingEnum.next(); > } > namingEnum.close(); > } > > private Control[] getRequestControls() throws IOException > { > final ArrayList<Control> requestControls = new ArrayList<Control>(); > requestControls.add(new ProxiedAuthorizationControl("dn:uid=PUser,o=Test.com")); > return requestControls.toArray(new Control[0]); > } > > public void run() throws NamingException, IOException > { > final LdapContext ldapContext = getLdapContext().newInstance(getRequestControls()); > for (int i=0; i<300000; i++) > { > search(ldapContext); > } > } > > public static void main(final String[] args) > { > final LoadTest loadTest = new LoadTest(); > try > { > loadTest.run(); > } > catch (final Exception e) > { > e.printStackTrace(); > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1077895
:
878275
| 878276 |
878277