[cvs] / jsr166 / src / test / tck / Atomic8Test.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/Atomic8Test.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5, Sat Apr 25 04:55:30 2015 UTC revision 1.6, Fri Jun 17 19:00:48 2016 UTC
# Line 152  Line 152 
152       * result of supplied function       * result of supplied function
153       */       */
154      public void testReferenceGetAndUpdate() {      public void testReferenceGetAndUpdate() {
155          AtomicReference<Integer> a = new AtomicReference<Integer>(one);          AtomicReference<Integer> a = new AtomicReference<>(one);
156          assertEquals(new Integer(1), a.getAndUpdate(Atomic8Test::addInteger17));          assertEquals(new Integer(1), a.getAndUpdate(Atomic8Test::addInteger17));
157          assertEquals(new Integer(18), a.getAndUpdate(Atomic8Test::addInteger17));          assertEquals(new Integer(18), a.getAndUpdate(Atomic8Test::addInteger17));
158          assertEquals(new Integer(35), a.get());          assertEquals(new Integer(35), a.get());
# Line 163  Line 163 
163       * returns result.       * returns result.
164       */       */
165      public void testReferenceUpdateAndGet() {      public void testReferenceUpdateAndGet() {
166          AtomicReference<Integer> a = new AtomicReference<Integer>(one);          AtomicReference<Integer> a = new AtomicReference<>(one);
167          assertEquals(new Integer(18), a.updateAndGet(Atomic8Test::addInteger17));          assertEquals(new Integer(18), a.updateAndGet(Atomic8Test::addInteger17));
168          assertEquals(new Integer(35), a.updateAndGet(Atomic8Test::addInteger17));          assertEquals(new Integer(35), a.updateAndGet(Atomic8Test::addInteger17));
169          assertEquals(new Integer(35), a.get());          assertEquals(new Integer(35), a.get());
# Line 174  Line 174 
174       * with supplied function.       * with supplied function.
175       */       */
176      public void testReferenceGetAndAccumulate() {      public void testReferenceGetAndAccumulate() {
177          AtomicReference<Integer> a = new AtomicReference<Integer>(one);          AtomicReference<Integer> a = new AtomicReference<>(one);
178          assertEquals(new Integer(1), a.getAndAccumulate(2, Atomic8Test::sumInteger));          assertEquals(new Integer(1), a.getAndAccumulate(2, Atomic8Test::sumInteger));
179          assertEquals(new Integer(3), a.getAndAccumulate(3, Atomic8Test::sumInteger));          assertEquals(new Integer(3), a.getAndAccumulate(3, Atomic8Test::sumInteger));
180          assertEquals(new Integer(6), a.get());          assertEquals(new Integer(6), a.get());
# Line 185  Line 185 
185       * returns result.       * returns result.
186       */       */
187      public void testReferenceAccumulateAndGet() {      public void testReferenceAccumulateAndGet() {
188          AtomicReference<Integer> a = new AtomicReference<Integer>(one);          AtomicReference<Integer> a = new AtomicReference<>(one);
189          assertEquals(new Integer(7), a.accumulateAndGet(6, Atomic8Test::sumInteger));          assertEquals(new Integer(7), a.accumulateAndGet(6, Atomic8Test::sumInteger));
190          assertEquals(new Integer(10), a.accumulateAndGet(3, Atomic8Test::sumInteger));          assertEquals(new Integer(10), a.accumulateAndGet(3, Atomic8Test::sumInteger));
191          assertEquals(new Integer(10), a.get());          assertEquals(new Integer(10), a.get());

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8