Package org.apache.tapestry5.ioc.util

Examples of org.apache.tapestry5.ioc.util.IdAllocator.allocateId()


        {
            public void handleEvent(Component instance, ComponentEvent event)
            {
                IdAllocator idAllocator = event.getEventContext().get(IdAllocator.class, 0);

                idAllocator.allocateId(parameterName);
            }
        };

        support.addEventHandler(EventConstants.PREALLOCATE_FORM_CONTROL_NAMES, 1,
                "ActivationRequestParameterWorker preallocate form control name '" + parameterName + "' event handler",
View Full Code Here


        {
            public void handleEvent(Component instance, ComponentEvent event)
            {
                IdAllocator idAllocator = event.getEventContext().get(IdAllocator.class, 0);

                idAllocator.allocateId(parameterName);
            }
        };

        support.addEventHandler(EventConstants.PREALLOCATE_FORM_CONTROL_NAMES, 1,
                "ActivationRequestParameterWorker preallocate form control name '" + parameterName + "' event handler",
View Full Code Here

        IdAllocator a = new IdAllocator();
        List<String> ids = newList();

        assertFalse(a.isAllocated("name"));

        assertEquals(a.allocateId("name"), "name");
        assertTrue(a.isAllocated("name"));

        ids.add("name");

        for (int i = 0; i < 10; i++)
View Full Code Here

            String expected = "name_" + i;

            assertFalse(a.isAllocated(expected));

            String nextId = a.allocateId("name");

            assertTrue(a.isAllocated(expected));

            assertEquals(nextId, expected);
View Full Code Here

    @Test
    public void simple_with_namespace()
    {
        IdAllocator a = new IdAllocator("_NS");

        assertEquals(a.allocateId("name"), "name_NS");

        for (int i = 0; i < 10; i++)
            assertEquals(a.allocateId("name"), "name_NS_" + i);

        // This is current behavior, but is probably something
View Full Code Here

        IdAllocator a = new IdAllocator("_NS");

        assertEquals(a.allocateId("name"), "name_NS");

        for (int i = 0; i < 10; i++)
            assertEquals(a.allocateId("name"), "name_NS_" + i);

        // This is current behavior, but is probably something
        // that could be improved.

        assertEquals(a.allocateId("foo_NS"), "foo_NS_NS");
View Full Code Here

            assertEquals(a.allocateId("name"), "name_NS_" + i);

        // This is current behavior, but is probably something
        // that could be improved.

        assertEquals(a.allocateId("foo_NS"), "foo_NS_NS");
        assertEquals(a.allocateId("foo_NS"), "foo_NS_NS_0");
    }

    @Test
    public void degenerate()
View Full Code Here

        // This is current behavior, but is probably something
        // that could be improved.

        assertEquals(a.allocateId("foo_NS"), "foo_NS_NS");
        assertEquals(a.allocateId("foo_NS"), "foo_NS_NS_0");
    }

    @Test
    public void degenerate()
    {
View Full Code Here

    @Test
    public void degenerate()
    {
        IdAllocator a = new IdAllocator();

        assertEquals(a.allocateId("d_1"), "d_1");

        assertEquals(a.allocateId("d"), "d");
        assertEquals(a.allocateId("d"), "d_0");
        assertEquals(a.allocateId("d"), "d_2");
View Full Code Here

    {
        IdAllocator a = new IdAllocator();

        assertEquals(a.allocateId("d_1"), "d_1");

        assertEquals(a.allocateId("d"), "d");
        assertEquals(a.allocateId("d"), "d_0");
        assertEquals(a.allocateId("d"), "d_2");

        assertEquals(a.allocateId("d"), "d_3");
        assertEquals(a.allocateId("d_1"), "d_1_0");
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.