This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 243cc3f HDDS-6094. Some unit tests are skipped due to using JUnit4
runner (#2909)
243cc3f is described below
commit 243cc3f6eca086d8fec0905c09bc18aa9fc03d20
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Wed Jan 5 22:09:02 2022 +0100
HDDS-6094. Some unit tests are skipped due to using JUnit4 runner (#2909)
---
hadoop-hdds/common/pom.xml | 15 +++++++++++++++
.../apache/hadoop/hdds/tracing/TestStringCodec.java | 18 +++++++++++++-----
2 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/hadoop-hdds/common/pom.xml b/hadoop-hdds/common/pom.xml
index 8f93610..5900327 100644
--- a/hadoop-hdds/common/pom.xml
+++ b/hadoop-hdds/common/pom.xml
@@ -167,6 +167,21 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.platform</groupId>
+ <artifactId>junit-platform-launcher</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>io.jaegertracing</groupId>
<artifactId>jaeger-client</artifactId>
</dependency>
diff --git
a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestStringCodec.java
b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestStringCodec.java
index f756008..f77e84a1 100644
---
a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestStringCodec.java
+++
b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/tracing/TestStringCodec.java
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -23,7 +23,7 @@ import
io.jaegertracing.internal.exceptions.MalformedTracerStateStringException;
import org.apache.ozone.test.LambdaTestUtils;
import org.junit.jupiter.api.Test;
-import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
class TestStringCodec {
@@ -44,9 +44,17 @@ class TestStringCodec {
"String does not match tracer state format",
() -> codec.extract(sb));
sb.append(":66");
+
JaegerSpanContext context = codec.extract(sb);
- String expectedContextString = "123:456:789:66";
- assertTrue(context.getTraceId().equals("123"));
- assertTrue(context.toString().equals(expectedContextString));
+ StringBuilder injected = new StringBuilder();
+ codec.inject(context, injected);
+
+ String expectedTraceId = pad("123");
+ assertEquals(expectedTraceId, context.getTraceId());
+ assertEquals(expectedTraceId + ":456:789:66", injected.toString());
+ }
+
+ private static String pad(String s) {
+ return "0000000000000000".substring(s.length()) + s;
}
}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]