-
Notifications
You must be signed in to change notification settings - Fork 26.5k
unable to build dubbo-common ( unit test fail in AdaptiveClassCodeGeneratorTest ) #5877
Copy link
Copy link
Closed
Labels
help wantedEverything needs help from contributorsEverything needs help from contributors
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
- I have checked the FAQ of this repository and believe that this is not a duplicate.
Environment
- Dubbo version: 2.7.5
- Operating System version: Windows 10 1903
- Java version: 1.8.0_221
Steps to reproduce this issue
- in root folder execute "mvn clean test"
Expected Result
pass unit test
Actual Result
org.opentest4j.AssertionFailedError: expected: but was:
at org.apache.dubbo.common.extension.AdaptiveClassCodeGeneratorTest.testGenerate(AdaptiveClassCodeGeneratorTest.java:45)
Any try
the souce of is AdaptiveClassCodeGeneratorTest
public class AdaptiveClassCodeGeneratorTest {
@Test
public void testGenerate() throws IOException {
AdaptiveClassCodeGenerator generator = new AdaptiveClassCodeGenerator(HasAdaptiveExt.class, "adaptive");
String value = generator.generate();
URL url = getClass().getResource("/org/apache/dubbo/common/extension/adaptive/HasAdaptiveExt$Adaptive");
try (InputStream inputStream = url.openStream()) {
String content = IOUtils.read(new InputStreamReader(inputStream, "UTF-8"));
assertTrue(content.contains(value));
}
}
}
When I add the following code to it, the unit pass.
value = value.replace("\r","");
value = value.replace("\n","");
content = content.replace("\r","");
content = content.replace("\n","");
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedEverything needs help from contributorsEverything needs help from contributors
Type
Fields
Give feedbackNo fields configured for issues without a type.