Skip to content

Commit

Permalink
#272 polish
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Nov 7, 2024
1 parent d96e331 commit 9a79404
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
<version>3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.yegor256</groupId>
<artifactId>jping</artifactId>
<version>0.0.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
6 changes: 5 additions & 1 deletion src/test/java/com/jcabi/xml/StrictXMLTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
package com.jcabi.xml;

import com.google.common.collect.Iterables;
import com.yegor256.WeAreOnline;
import java.io.IOException;
import java.net.InetAddress;
import java.net.SocketException;
Expand All @@ -52,6 +53,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentMatchers;
import org.mockito.Mockito;
import org.mockito.stubbing.Answer;
Expand Down Expand Up @@ -104,6 +106,7 @@ void rejectsInvalidXmlThrough() {
}

@Test
@ExtendWith(WeAreOnline.class)
void passesValidXmlUsingXsiSchemaLocation() throws Exception {
new StrictXML(
new XMLDocument(
Expand All @@ -113,6 +116,7 @@ void passesValidXmlUsingXsiSchemaLocation() throws Exception {
}

@Test
@ExtendWith(WeAreOnline.class)
void rejectsInvalidXmlUsingXsiSchemaLocation() {
Assertions.assertThrows(
IllegalStateException.class,
Expand Down Expand Up @@ -154,7 +158,7 @@ void validatesMultipleXmlsInThreads() throws Exception {
)
);
final AtomicInteger done = new AtomicInteger();
final int threads = 50;
final int threads = Runtime.getRuntime().availableProcessors() * 10;
final CountDownLatch latch = new CountDownLatch(threads);
final Callable<Void> callable = () -> {
try {
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/jcabi/xml/XMLDocumentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,13 @@ void printsInMultipleThreads() throws Exception {

@Test
void takesNodeInMultipleThreads() throws Exception {
final int threads = 50;
final int threads = Runtime.getRuntime().availableProcessors() * 10;
final XML xml = new XMLDocument(
StringUtils.join(
Iterables.concat(
Collections.singleton("<r>"),
Iterables.transform(
Collections.nCopies(100, 0),
Collections.nCopies(1000, 0),
pos -> String.format("<x>%d</x>", pos)
),
Collections.singleton("<x>5555</x></r>")
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ log4j.appender.CONSOLE.layout=com.jcabi.log.MulticolorLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%color{%p}] %t %c: %m%n

# Application-specific logging
log4j.logger.com.jcabi.xml=DEBUG
log4j.logger.com.jcabi.xml=ERROR

0 comments on commit 9a79404

Please sign in to comment.