4344454647484950515253
assertEquals("d$1", a.allocateId("d$1")); assertEquals("d", a.allocateId("d")); assertEquals("d$0", a.allocateId("d")); assertEquals("d$2", a.allocateId("d")); assertEquals("d$3", a.allocateId("d")); assertEquals("d$1$0", a.allocateId("d$1")); }
4546474849505152535455
assertEquals("d", a.allocateId("d")); assertEquals("d$0", a.allocateId("d")); assertEquals("d$2", a.allocateId("d")); assertEquals("d$3", a.allocateId("d")); assertEquals("d$1$0", a.allocateId("d$1")); } public void testClear() {
4647484950515253545556
assertEquals("d", a.allocateId("d")); assertEquals("d$0", a.allocateId("d")); assertEquals("d$2", a.allocateId("d")); assertEquals("d$3", a.allocateId("d")); assertEquals("d$1$0", a.allocateId("d$1")); } public void testClear() { IdAllocator a = new IdAllocator();
5354555657585960616263
public void testClear() { IdAllocator a = new IdAllocator(); assertEquals("foo", a.allocateId("foo")); assertEquals("foo_0", a.allocateId("foo_0")); a.clear(); assertEquals("foo", a.allocateId("foo"));
5455565758596061626364
public void testClear() { IdAllocator a = new IdAllocator(); assertEquals("foo", a.allocateId("foo")); assertEquals("foo_0", a.allocateId("foo_0")); a.clear(); assertEquals("foo", a.allocateId("foo")); assertEquals("foo_0", a.allocateId("foo_0"));
585960616263646566
assertEquals("foo", a.allocateId("foo")); assertEquals("foo_0", a.allocateId("foo_0")); a.clear(); assertEquals("foo", a.allocateId("foo")); assertEquals("foo_0", a.allocateId("foo_0")); } }
5960616263646566
assertEquals("foo_0", a.allocateId("foo_0")); a.clear(); assertEquals("foo", a.allocateId("foo")); assertEquals("foo_0", a.allocateId("foo_0")); } }
100101102103104105106107108109110
{ 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",
99100101102103104105106107108109
3132333435363738394041
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++)