Examples of cnt()


Examples of org.apache.niolex.commons.test.Counter.cnt()

    public static void inc() {
        int key = MockUtil.randInt(locksNum);
        Counter c = hashMap.get(key);
        synchronized (c) {
            // intentionally do this.
            c.set(c.cnt() + 1);
            SystemUtil.sleep(1);
        }
    }

}
View Full Code Here

Examples of org.apache.niolex.commons.test.Counter.cnt()

        monitor2.addListener(cli);
        wait = blocker.init("s");

        FileUtil.setCharacterFileContentToFileSystem(TMP + "/dir-monitor/not-dir.txt", "It's not a DIR", StringUtil.US_ASCII);
        wait.waitForResult(1000);
        assertEquals(1, cld.cnt());
        boolean b = monitor2.removeListener(cli);
        assertTrue(b);
        assertFalse(monitor2.isDir());
        FileOutputStream fo = new FileOutputStream(TMP + "/dir-monitor/not-dir.txt");
        wait = blocker.init("s");
View Full Code Here

Examples of org.apache.niolex.commons.test.Counter.cnt()

    t.start();
    cl.await();
    Thread.sleep(10);
    blocker.release("man", 1546);
    t.join();
    assertEquals(1, c.cnt());
  }

  /**
   * Test method for {@link org.apache.niolex.commons.concurrent.Blocker#release(java.lang.Object, java.lang.Object)}.
   */
 
View Full Code Here

Examples of org.apache.niolex.commons.test.Counter.cnt()

      }
    };
    t.start();
    blocker.release("man", new BlockerException("J"));
    t.join();
    assertEquals(1, c.cnt());
  }

  @Test(expected=BlockerException.class)
  public void testReleaseAll() throws Exception {
    blocker.init("a");
View Full Code Here

Examples of org.apache.niolex.commons.test.Counter.cnt()

        };
        one.addListener(li);
        one.updateData("Not yet implemented");
        one.removeListener(li);
        one.updateData("DOIFDOIFDOIJFDOJFDO");
        assertEquals(1, cnt.cnt());
        assertEquals("DOIFDOIFDOIJFDOJFDO", one.data());
    }

    /**
     * Test method for {@link org.apache.niolex.commons.bean.MutableOne#MutableOne(java.lang.Object)}.
View Full Code Here

Examples of org.apache.niolex.commons.test.Counter.cnt()

        };
        one.addListener(li);
        one.updateData("Not yet implemented");
        one.removeListener(li);
        one.updateData("DOIFDOIFDOIJFDOJFDO");
        assertEquals(1, cnt.cnt());
        assertEquals("DOIFDOIFDOIJFDOJFDO", one.data());
    }

    /**
     * Test method for {@link org.apache.niolex.commons.bean.MutableOne#addListener(org.apache.niolex.commons.bean.MutableOne.DataChangeListener)}.
View Full Code Here

Examples of org.apache.niolex.commons.test.Counter.cnt()

        one.addListener(li);
        one.addListener(li);
        one.updateData("Not yet implemented");
        one.removeListener(li);
        one.updateData("DOIFDOIFDOIJFDOJFDO");
        assertEquals(3, cnt.cnt());
        assertEquals("DOIFDOIFDOIJFDOJFDO", one.data());
    }

    /**
     * Test method for {@link org.apache.niolex.commons.bean.MutableOne#removeListener(org.apache.niolex.commons.bean.MutableOne.DataChangeListener)}.
View Full Code Here

Examples of org.apache.niolex.commons.test.Counter.cnt()

        one.addListener(li);
        one.updateData("Not yet implemented");
        assertTrue(one.removeListener(li));
        assertFalse(one.removeListener(li));
        one.updateData("DOIFDOIFDOIJFDOJFDO");
        assertEquals(1, cnt.cnt());
        assertEquals("DOIFDOIFDOIJFDOJFDO", one.data());
    }

    /**
     * Test method for {@link org.apache.niolex.commons.bean.MutableOne#updateData(java.lang.Object)}.
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.