Skip to content

Commit

Permalink
feat:dubbo-remoting-zookeeper-curator5 remove dubbo-test module
Browse files Browse the repository at this point in the history
  • Loading branch information
Stellar1999 committed Feb 7, 2025
1 parent 628dcbf commit a10cc18
Show file tree
Hide file tree
Showing 11 changed files with 348 additions and 61 deletions.
6 changes: 6 additions & 0 deletions dubbo-remoting/dubbo-remoting-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,11 @@
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-test-check</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
6 changes: 6 additions & 0 deletions dubbo-remoting/dubbo-remoting-http12/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,11 @@
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-test-check</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
6 changes: 6 additions & 0 deletions dubbo-remoting/dubbo-remoting-http3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,11 @@
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-test-check</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
6 changes: 6 additions & 0 deletions dubbo-remoting/dubbo-remoting-netty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,11 @@
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-test-check</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
6 changes: 6 additions & 0 deletions dubbo-remoting/dubbo-remoting-netty4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-test-check</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions dubbo-remoting/dubbo-remoting-websocket/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,11 @@
<artifactId>dubbo-remoting-http12</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-test-check</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
7 changes: 0 additions & 7 deletions dubbo-remoting/dubbo-remoting-zookeeper-curator5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@
<version>${project.parent.version}</version>
</dependency>

<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-test-common</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,32 @@

import org.apache.dubbo.common.URL;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.MockedConstruction;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsNot.not;
import static org.hamcrest.core.IsNull.nullValue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.mockConstructionWithAnswer;

class Curator5ZookeeperClientManagerTest {
private ZookeeperClient zookeeperClient;
private ZookeeperClientManager zookeeperClientManager;
private static MockedConstruction<Curator5ZookeeperClient> mockedCurator5ZookeeperClientConstruction;
private static String zookeeperConnectionAddress1;

@BeforeAll
public static void beforeAll() {
zookeeperConnectionAddress1 = System.getProperty("zookeeper.connection.address.1");
Curator5ZookeeperClient mockCurator5ZookeeperClient = mock(Curator5ZookeeperClient.class);
mockedCurator5ZookeeperClientConstruction =
mockConstructionWithAnswer(Curator5ZookeeperClient.class, invocationOnMock -> invocationOnMock
.getMethod()
.invoke(mockCurator5ZookeeperClient, invocationOnMock.getArguments()));
}

@BeforeEach
Expand All @@ -47,4 +57,9 @@ void testZookeeperClient() {
assertThat(zookeeperClient, not(nullValue()));
zookeeperClient.close();
}

@AfterAll
public static void afterAll() {
mockedCurator5ZookeeperClientConstruction.close();
}
}
Loading

0 comments on commit a10cc18

Please sign in to comment.