Github user ansell commented on a diff in the pull request:
https://github.com/apache/any23/pull/19#discussion_r43451101
--- Diff:
core/src/test/java/org/apache/any23/extractor/microdata/MicrodataParserTest.java
---
@@ -88,7 +96,58 @@ public void testGetContentAsDate() throws IOException,
ParseException {
target.getProperties().get("birthday").get(0).getValue().getAsDate()
);
}
+
+ @Test
+ public void testGetDateConcurrent() throws IOException, ParseException
{
+ final Date expectedDate = new GregorianCalendar(2009,
Calendar.MAY, 10).getTime(); // 2009-05-10
+ final byte [] content =
IOUtils.toByteArray(getClass().getResourceAsStream("/microdata/microdata-basic.html"));
+ final int threadCount = 10;
+ final int attemptCount = 100;
+ final List<Thread> threads = new ArrayList<Thread>();
+ final CyclicBarrier barrier = new CyclicBarrier(threadCount + 1);
--- End diff --
I have typically done these tests using two separate CountDownLatch
objects. Ie, a starting latch/barrier with value 1, and another latch with the
number of threads as its value.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---