Package org.apache.jena.atlas.lib

Examples of org.apache.jena.atlas.lib.RefLong


public class TestRefLong extends BaseTest
{
    @Test public void ref_01()
    {
        RefLong ref1 = new RefLong() ;
        assertEquals(0, ref1.value()) ;
        RefLong ref2 = new RefLong() ;
        assertNotSame(ref1, ref2) ;
    }
View Full Code Here


        assertNotSame(ref1, ref2) ;
    }
   
    @Test public void ref_02()
    {
        RefLong ref = new RefLong() ;
        assertEquals(0, ref.value()) ;
        ref.inc() ;
        assertEquals(1, ref.value()) ;
        ref.dec() ;
        assertEquals(0, ref.value()) ;
    }
View Full Code Here

        assertEquals(0, ref.value()) ;
    }
   
    @Test public void ref_03()
    {
        RefLong ref = new RefLong(99) ;
        assertEquals(99, ref.value()) ;
        long x = ref.incAndGet() ;
        assertEquals(100, x) ;
        assertEquals(100, ref.value()) ;
        x = ref.getAndInc() ;
        assertEquals(100, x) ;
        assertEquals(101, ref.value()) ;
    }
View Full Code Here

        assertEquals(101, ref.value()) ;
    }
   
    @Test public void ref_04()
    {
        RefLong ref = new RefLong(99) ;
        assertEquals(99, ref.value()) ;
        long x = ref.decAndGet() ;
        assertEquals(98, x) ;
        assertEquals(98, ref.value()) ;
        x = ref.getAndDec() ;
        assertEquals(98, x) ;
        assertEquals(97, ref.value()) ;
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.lib.RefLong

Copyright © 2018 www.massapicom. 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.