mirror of
https://github.com/apache/rocketmq.git
synced 2026-09-01 05:46:12 +08:00
* Make all tests pass on Windows * Run in serial
This commit is contained in:
@@ -23,4 +23,4 @@ jobs:
|
||||
distribution: "adopt"
|
||||
cache: "maven"
|
||||
- name: Build with Maven
|
||||
run: mvn -B package -T 2C --file pom.xml
|
||||
run: mvn -B package --file pom.xml
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
package org.apache.rocketmq.acl.plain;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Splitter;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
@@ -25,6 +27,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.util.UUID;
|
||||
import java.util.Iterator;
|
||||
import org.junit.Assert;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
@@ -36,11 +39,12 @@ public final class AclTestHelper {
|
||||
private static void copyTo(String path, InputStream src, File dstDir, String flag, boolean into)
|
||||
throws IOException {
|
||||
Preconditions.checkNotNull(flag);
|
||||
String[] folders = path.split(File.separator);
|
||||
Iterator<String> iterator = Splitter.on(File.separatorChar).split(path).iterator();
|
||||
boolean found = false;
|
||||
File dir = dstDir;
|
||||
for (int i = 0; i < folders.length; i++) {
|
||||
if (!found && flag.equals(folders[i])) {
|
||||
while (iterator.hasNext()) {
|
||||
String current = iterator.next();
|
||||
if (!found && flag.equals(current)) {
|
||||
found = true;
|
||||
if (into) {
|
||||
dir = new File(dir, flag);
|
||||
@@ -52,10 +56,10 @@ public final class AclTestHelper {
|
||||
}
|
||||
|
||||
if (found) {
|
||||
if (i == folders.length - 1) {
|
||||
dir = new File(dir, folders[i]);
|
||||
if (!iterator.hasNext()) {
|
||||
dir = new File(dir, current);
|
||||
} else {
|
||||
dir = new File(dir, folders[i]);
|
||||
dir = new File(dir, current);
|
||||
if (!dir.exists()) {
|
||||
Assert.assertTrue(dir.mkdir());
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
package org.apache.rocketmq.proxy;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Splitter;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
@@ -27,6 +29,7 @@ import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.UUID;
|
||||
import java.util.Iterator;
|
||||
import org.apache.rocketmq.broker.BrokerController;
|
||||
import org.apache.rocketmq.broker.BrokerStartup;
|
||||
import org.apache.rocketmq.client.log.ClientLogger;
|
||||
@@ -81,20 +84,20 @@ public class ProxyStartupTest {
|
||||
|
||||
private void copyTo(String path, InputStream src, File dstDir, String flag) throws IOException {
|
||||
Preconditions.checkNotNull(flag);
|
||||
String[] folders = path.split(File.separator);
|
||||
Iterator<String> iterator = Splitter.on(File.separatorChar).split(path).iterator();
|
||||
boolean found = false;
|
||||
File dir = dstDir;
|
||||
for (int i = 0; i < folders.length; i++) {
|
||||
if (!found && flag.equals(folders[i])) {
|
||||
while (iterator.hasNext()) {
|
||||
String current = iterator.next();
|
||||
if (!found && flag.equals(current)) {
|
||||
found = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (found) {
|
||||
if (i == folders.length - 1) {
|
||||
dir = new File(dir, folders[i]);
|
||||
if (!iterator.hasNext()) {
|
||||
dir = new File(dir, current);
|
||||
} else {
|
||||
dir = new File(dir, folders[i]);
|
||||
dir = new File(dir, current);
|
||||
if (!dir.exists()) {
|
||||
Assert.assertTrue(dir.mkdir());
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.nio.Buffer;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
@@ -499,7 +500,7 @@ public class RemotingCommand {
|
||||
// header data
|
||||
result.put(headerData);
|
||||
|
||||
result.flip();
|
||||
((Buffer)result).flip();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -196,14 +196,14 @@ public class MonitorService {
|
||||
ConsumeStats cs = null;
|
||||
try {
|
||||
cs = defaultMQAdminExt.examineConsumeStats(consumerGroup);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception ignore) {
|
||||
return;
|
||||
}
|
||||
|
||||
ConsumerConnection cc = null;
|
||||
try {
|
||||
cc = defaultMQAdminExt.examineConsumerConnectionInfo(consumerGroup);
|
||||
} catch (Exception e) {
|
||||
} catch (Exception ignore) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user