Package javax.naming.directory

Examples of javax.naming.directory.DirContext.list()


            assertTrue("WEB-INF entry is a DirContext",
                   webInfEntry instanceof DirContext);
            DirContext webInfContext = (DirContext) webInfEntry;

            // Check the contents of the WEB-INF context directly
            checkList(webInfContext.list(""), webInfNames);

        } catch (NamingException e) {
            fail("NamingException: " + e);
        }
View Full Code Here


        if (debug >= 2) {
            log("  Scanning TLDs in /WEB-INF subdirectory");
        }
        DirContext resources = context.getResources();
        try {
            NamingEnumeration items = resources.list("/WEB-INF");
            while (items.hasMoreElements()) {
                NameClassPair item = (NameClassPair) items.nextElement();
                String resourcePath = "/WEB-INF/" + item.getName();
                // FIXME - JSP 1.2 is not explicit about whether we should
                // scan subdirectories of /WEB-INF for TLDs also
View Full Code Here

        // Scan JARs in the /WEB-INF/lib subdirectory of the web application
        if (debug >= 2) {
            log("  Scanning JARs in /WEB-INF/lib subdirectory");
        }
        try {
            NamingEnumeration items = resources.list("/WEB-INF/lib");
            while (items.hasMoreElements()) {
                NameClassPair item = (NameClassPair) items.nextElement();
                String resourcePath = "/WEB-INF/lib/" + item.getName();
                if (!resourcePath.endsWith(".jar")) {
                    continue;
View Full Code Here

        DirContext subSchema = (DirContext) schema.lookup("");
        assertSame(schema, subSchema);

        subSchema = (DirContext) schema.lookup("classdefinition");
        assertNotSame(schema, subSchema);
        NamingEnumeration<NameClassPair> namingEnum = subSchema.list("");
        NameClassPair pair;
        int count = 0;
        while (namingEnum.hasMore()) {
            pair = namingEnum.next();
            count++;
View Full Code Here

        DirContext classDefSchema = mockSchema.getClassDefinition(attribute);
        ArrayList<String> verifyList = new ArrayList<String>();
        verifyList.add("javaclass");
        verifyList.add("prefnode");
        verifyList.add("extensibleobject");
        NamingEnumeration<NameClassPair> ne = classDefSchema.list("");
        NameClassPair pair;
        int count = 0;
        while (ne.hasMore()) {
            pair = ne.next();
            count++;
View Full Code Here

            count++;
            assertTrue(verifyList.remove(pair.getName().toLowerCase()));
        }
        assertEquals(3, count);

        ne = classDefSchema.list("prefnode");
        assertFalse(ne.hasMore());

        ne = classDefSchema.list("extensibleobject");
        assertFalse(ne.hasMore());
    }
View Full Code Here

        assertEquals(3, count);

        ne = classDefSchema.list("prefnode");
        assertFalse(ne.hasMore());

        ne = classDefSchema.list("extensibleobject");
        assertFalse(ne.hasMore());
    }

    public void testAttributeDefinition() throws NamingException {
        addMoreAttributeData();
View Full Code Here

        addMoreAttributeData();
        MockLdapContext mockContext = new MockLdapContext(context, null, "");
        Attribute attr = new LdapAttribute("objectclass", mockContext);

        DirContext attributeDefinition = attr.getAttributeDefinition();
        NamingEnumeration<NameClassPair> ne = attributeDefinition.list("");
        assertFalse(ne.hasMore());

        try {
            ne = attributeDefinition.list("invalid");
            fail("Should throw NameNotFoundException");
View Full Code Here

        DirContext attributeDefinition = attr.getAttributeDefinition();
        NamingEnumeration<NameClassPair> ne = attributeDefinition.list("");
        assertFalse(ne.hasMore());

        try {
            ne = attributeDefinition.list("invalid");
            fail("Should throw NameNotFoundException");
        } catch (NameNotFoundException e) {
            // Expected.
        }
View Full Code Here

    public void testSyntaxDefinition() throws NamingException {
        addMoreAttributeData();
        MockLdapContext mockContext = new MockLdapContext(context, null, "");
        Attribute attr = new LdapAttribute("objectclass", mockContext);
        DirContext attributeDefinition = attr.getAttributeSyntaxDefinition();
        NamingEnumeration<NameClassPair> ne = attributeDefinition.list("");
        assertFalse(ne.hasMore());

        try {
            ne = attributeDefinition.list("invalid");
            fail("Should throw NameNotFoundException");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.