Skip to content

Commit

Permalink
fix 修复api报错
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearXs committed Oct 21, 2023
1 parent 7e63855 commit 5eba4e2
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 46 deletions.
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<reactor-bom>2020.0.12</reactor-bom>
<spring.boot.version>2.3.12.RELEASE</spring.boot.version>
<spring.platform.version>Cairo-SR8</spring.platform.version>
<spring.cloud.version>Hoxton.SR12</spring.cloud.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-plugin.version>3.8.1</maven-plugin.version>
<maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
Expand Down
8 changes: 8 additions & 0 deletions uno-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<easy-rules.version>4.1.0</easy-rules.version>
<spring-statemachine.version>2.2.0.RELEASE</spring-statemachine.version>
<jakarta.json-api.version>2.0.1</jakarta.json-api.version>
<concurrentunit.version>0.4.6</concurrentunit.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -232,6 +233,7 @@
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<!-- ======================== test framework ======================== -->
<!-- junit -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -252,6 +254,12 @@
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.jodah</groupId>
<artifactId>concurrentunit</artifactId>
<version>${concurrentunit.version}</version>
<scope>test</scope>
</dependency>
<!-- auto -->
<dependency>
<groupId>com.google.auto.service</groupId>
Expand Down
5 changes: 5 additions & 0 deletions uno-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.jodah</groupId>
<artifactId>concurrentunit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.aviator</groupId>
<artifactId>aviator</artifactId>
Expand Down
24 changes: 24 additions & 0 deletions uno-core/src/test/java/cc/allio/uno/core/bus/EventBusTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
import cc.allio.uno.core.bus.event.EmitEvent;
import cc.allio.uno.core.bus.event.Node;
import com.google.common.collect.Lists;
import net.jodah.concurrentunit.Waiter;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;
import reactor.test.StepVerifier;

import java.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

public class EventBusTest extends BaseTestCase {

Expand Down Expand Up @@ -147,4 +154,21 @@ void testRepeatable() {
bus.subscribeOnRepeatable(Subscription.of("1")).subscribe(atTwo::set);
atOne.get().equals(atTwo.get());
}

@Test
void testConcurrent() throws InterruptedException {
CountDownLatch counter = new CountDownLatch(100000000);
for (int i = 0; i < 1000; i++) {
String topic = "t1" + "/" + i;
bus.subscribe(topic)
.flatMap(Node::onNext)
.doOnNext(c -> counter.countDown())
.subscribe();
}

for (int i = 0; i < 100000; i++) {
bus.publish("/t1/**", new DefaultEventContext());
}
counter.await();
}
}
15 changes: 0 additions & 15 deletions uno-data/src/main/java/cc/allio/uno/data/orm/executor/IPage.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* Copyright (c) 2011-2021, baomidou (jobob@qq.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cc.allio.uno.data.orm.executor;

import cc.allio.uno.core.StringPool;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* Copyright (c) 2011-2021, baomidou (jobob@qq.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cc.allio.uno.data.orm.executor;

import lombok.AllArgsConstructor;
Expand Down
15 changes: 0 additions & 15 deletions uno-data/src/main/java/cc/allio/uno/data/orm/executor/Page.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/*
* Copyright (c) 2011-2021, baomidou (jobob@qq.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cc.allio.uno.data.orm.executor;

import cc.allio.uno.core.util.CollectionUtils;
Expand Down

0 comments on commit 5eba4e2

Please sign in to comment.