Package javax.naming

Examples of javax.naming.Context.composeName()


            result = ctx.composeName(name, prefix);
            fail("NamingException should be thrown");
        } catch (NamingException e) {}

        // string form
        resultStr = ctx.composeName("host1/file1.html", "/example.com");
        assertEquals("/host1.example.com/file1.html", resultStr);
        resultStr = ctx.composeName("host1", "example.com");
        assertEquals("host1.example.com", resultStr);
        resultStr = ctx.composeName("host1/mamba", "example.com");
        assertEquals("host1.example.com/mamba", resultStr);
View Full Code Here


        } catch (NamingException e) {}

        // string form
        resultStr = ctx.composeName("host1/file1.html", "/example.com");
        assertEquals("/host1.example.com/file1.html", resultStr);
        resultStr = ctx.composeName("host1", "example.com");
        assertEquals("host1.example.com", resultStr);
        resultStr = ctx.composeName("host1/mamba", "example.com");
        assertEquals("host1.example.com/mamba", resultStr);
        resultStr = ctx.composeName("host1.subdomain", "schema17:/example.com");
        assertEquals("schema17:/host1.subdomain.example.com", resultStr);
View Full Code Here

        // string form
        resultStr = ctx.composeName("host1/file1.html", "/example.com");
        assertEquals("/host1.example.com/file1.html", resultStr);
        resultStr = ctx.composeName("host1", "example.com");
        assertEquals("host1.example.com", resultStr);
        resultStr = ctx.composeName("host1/mamba", "example.com");
        assertEquals("host1.example.com/mamba", resultStr);
        resultStr = ctx.composeName("host1.subdomain", "schema17:/example.com");
        assertEquals("schema17:/host1.subdomain.example.com", resultStr);
        // error
        try {
View Full Code Here

        assertEquals("/host1.example.com/file1.html", resultStr);
        resultStr = ctx.composeName("host1", "example.com");
        assertEquals("host1.example.com", resultStr);
        resultStr = ctx.composeName("host1/mamba", "example.com");
        assertEquals("host1.example.com/mamba", resultStr);
        resultStr = ctx.composeName("host1.subdomain", "schema17:/example.com");
        assertEquals("schema17:/host1.subdomain.example.com", resultStr);
        // error
        try {
            ctx.composeName(".", "schema17:/example.com");
            fail("NamingException should be thrown");
View Full Code Here

        assertEquals("host1.example.com/mamba", resultStr);
        resultStr = ctx.composeName("host1.subdomain", "schema17:/example.com");
        assertEquals("schema17:/host1.subdomain.example.com", resultStr);
        // error
        try {
            ctx.composeName(".", "schema17:/example.com");
            fail("NamingException should be thrown");
        } catch (NamingException e) {}
    }

    public void testConstructor() throws NoSuchFieldException,
View Full Code Here

        env.put(Context.PROVIDER_URL, propStr1);
        ctx = new DNSContextFactory().getInitialContext(env);
        // #composeName(Name, Name)
        // NULL & NULL
        try {
            ctx.composeName(name, prefix);
            fail("NullPointerException has not been thrown");
        } catch (NullPointerException e) {}
        // CompositeName & CompositeName
        name = new CompositeName("host1/file1.html");
        prefix = new CompositeName("/example.com");
View Full Code Here

            fail("NullPointerException has not been thrown");
        } catch (NullPointerException e) {}
        // CompositeName & CompositeName
        name = new CompositeName("host1/file1.html");
        prefix = new CompositeName("/example.com");
        result = ctx.composeName(name, prefix);
        assertEquals("/host1.example.com/file1.html", result.toString());
        // DNSName & CompositeName
        name = nameParser.parse("host1.mysubdomain");
        prefix = new CompositeName("schema2:/example.com");
        result = ctx.composeName(name, prefix);
View Full Code Here

        result = ctx.composeName(name, prefix);
        assertEquals("/host1.example.com/file1.html", result.toString());
        // DNSName & CompositeName
        name = nameParser.parse("host1.mysubdomain");
        prefix = new CompositeName("schema2:/example.com");
        result = ctx.composeName(name, prefix);
        assertEquals("schema2:/host1.mysubdomain.example.com",
                result.toString());
        // CompositeName & DNSName
        name = new CompositeName("host1/file1.html");
        prefix = nameParser.parse("subdomain.example.com.");
View Full Code Here

        assertEquals("schema2:/host1.mysubdomain.example.com",
                result.toString());
        // CompositeName & DNSName
        name = new CompositeName("host1/file1.html");
        prefix = nameParser.parse("subdomain.example.com.");
        result = ctx.composeName(name, prefix);   
        assertEquals("host1.subdomain.example.com./file1.html",
                result.toString());
        // DNSName & DNSName
        name = nameParser.parse("host1.subdomain1");
        prefix = nameParser.parse("subdomain2.example.com.");
View Full Code Here

        assertEquals("host1.subdomain.example.com./file1.html",
                result.toString());
        // DNSName & DNSName
        name = nameParser.parse("host1.subdomain1");
        prefix = nameParser.parse("subdomain2.example.com.");
        result = ctx.composeName(name, prefix);   
        assertEquals("host1.subdomain1.subdomain2.example.com.",
                result.toString());

        // error
        name = ProviderConstants.ROOT_ZONE_NAME_OBJ;
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.