package ard.piraso.server.logger;

import org.junit.Test;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;

/**
 * Test for {@link TraceableID} class.
 */
public class TraceableIDTest {

    @Test
    public void testToString() throws Exception {
        TraceableID id = new TraceableID("test");

        assertEquals("[test]", id.toString());
        assertFalse(id.getIds().isEmpty());
    }

    @Test
    public void testCreateWithNoArgs() throws Exception {
        TraceableID id = new TraceableID("test");
        TraceableID id2 = id.create();
        TraceableID id3 = id2.create();

        assertEquals(1, id.getIds().size());
        assertEquals(2, id2.getIds().size());
        assertEquals(3, id3.getIds().size());

        assertEquals("test_2", id2.getIds().getLast());
        assertEquals("test_3", id3.getIds().getLast());
    }
}

@@ -93,70 +93,9 @@
 ert.
-assertEquals;%0Aimport static junit.framework.Assert.assertFalse
+*
 ;%0A%0A/
@@ -769,24 +769,24 @@
 getLast());%0A
-
         asse
@@ -834,11 +834,1180 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testCreateWithIntArg() throws Exception %7B%0A        TraceableID id = new TraceableID(%22test%22);%0A        TraceableID id2 = id.create(1);%0A%0A        assertEquals(2, id2.getIds().size());%0A        assertEquals(%22%5Btest, 1%5D%22, id2.toString());%0A    %7D%0A%0A    @Test%0A    public void testCreateWithStringArg() throws Exception %7B%0A        TraceableID id = new TraceableID(%22test%22);%0A        TraceableID id2 = id.create(%22test2%22);%0A%0A        assertEquals(2, id2.getIds().size());%0A        assertEquals(%22%5Btest, test2%5D%22, id2.toString());%0A    %7D%0A%0A    @Test%0A    public void testCreateWithStringAndHashCodeArg() throws Exception %7B%0A        TraceableID id = new TraceableID(%22test%22);%0A        TraceableID id2 = id.create(%22test2%22, %22test2%22.hashCode());%0A%0A        assertEquals(2, id2.getIds().size());%0A        assertEquals(%22%5Btest, test2%22 + Integer.toHexString(%22test2%22.hashCode()) + %22%5D%22, id2.toString());%0A    %7D%0A%0A    @Test%0A    public void testProperty() throws Exception %7B%0A        TraceableID id = new TraceableID(%22test%22);%0A        id.addProperty(String.class, %22hello%22);%0A%0A        assertEquals(%22hello%22, id.getProperty(String.class));%0A        assertTrue(id.hasProperty(String.class));%0A    %7D
 %0A%7D%0A

increase code coverage.