Adapt tests to babeltrace 2 output.
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Sat, 15 Jan 2022 00:08:06 +0000 (19:08 -0500)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Sat, 15 Jan 2022 00:08:06 +0000 (19:08 -0500)
The application context type is not present when using babeltrace2 as of
today. This change might get reversed as needed in the future if the
omission of the type was an error on the reader side. For now remove
the type from the lookup and validate based on value only.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
README.md
lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/integration/context/AppContextITBase.java
lttng-ust-java-tests-common/src/main/java/org/lttng/ust/agent/integration/context/AppContextOrderingITBase.java

index bf4350ef458ee3d2233dbbeff274453581be0425..cfe2c0b5a8730c82558d823453ba46838bf8fa82 100644 (file)
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ Prerequisites
 * Java 1.8
 * [Apache Maven](https://maven.apache.org/) 3.0+
 * A recent version of [LTTng-Tools](https://lttng.org/download/)
-* A recent version of [Babeltrace](http://www.efficios.com/babeltrace)
+* A recent version of [Babeltrace 2.x](http://www.efficios.com/babeltrace)
 * A git branch or version of LTTng-UST you want to test
 
 For example, on Ubuntu you can use the
@@ -22,7 +22,7 @@ OpenJDK from the main repository:
 
     sudo apt-add-repository ppa:lttng/ppa
     sudo apt-get update
-    sudo apt-get install lttng-tools babeltrace maven openjdk-8-jre
+    sudo apt-get install lttng-tools babeltrace2 maven openjdk-8-jre
 
 Also make sure `mvn -version` reports a `Java version: 1.8` or higher. If it
 does not, you may need to set your `JAVA_HOME` accordingly.
index 0ecc0c82677cec5807e3d089b031e7718e1f9b05..99ba6fb5adb89edf93ed97263603f02256b9bd7c 100644 (file)
@@ -187,7 +187,7 @@ public abstract class AppContextITBase {
         assertFalse(output.isEmpty());
 
         /* Test that context name is there but value is not */
-        testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME, "{ none = { } } }");
+        testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME, "{ { } } }");
     }
 
     /**
@@ -211,7 +211,7 @@ public abstract class AppContextITBase {
 
         /* Test that context name + value are present */
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ string = \"" + ContextInfoRetrieverStubs.STRING_VALUE + "\" }");
+                "{ \"" + ContextInfoRetrieverStubs.STRING_VALUE + "\" }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -238,7 +238,7 @@ public abstract class AppContextITBase {
 
         /* Test that only retriever-name-2 is present, with no value */
         testContextNotPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME);
-        testContextPresentInTrace(output, RETRIEVER_NAME_2, CONTEXT_NAME, "{ none = { } } }");
+        testContextPresentInTrace(output, RETRIEVER_NAME_2, CONTEXT_NAME, "{ { } } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -266,7 +266,7 @@ public abstract class AppContextITBase {
 
         /* Test that only retriever-name-1 is present, name + value */
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ string = \"" + ContextInfoRetrieverStubs.STRING_VALUE + "\" }");
+                "{ \"" + ContextInfoRetrieverStubs.STRING_VALUE + "\" }");
         testContextNotPresentInTrace(output, RETRIEVER_NAME_2, CONTEXT_NAME);
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
@@ -296,8 +296,8 @@ public abstract class AppContextITBase {
 
         /* Test that both contexts are present, but only retriever-1's has a value */
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ string = \"" + ContextInfoRetrieverStubs.STRING_VALUE + "\" }");
-        testContextPresentInTrace(output, RETRIEVER_NAME_2, CONTEXT_NAME, "{ none = { } } }");
+                "{ \"" + ContextInfoRetrieverStubs.STRING_VALUE + "\" }");
+        testContextPresentInTrace(output, RETRIEVER_NAME_2, CONTEXT_NAME, "{ { } } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -332,7 +332,7 @@ public abstract class AppContextITBase {
         assertTrue(cim.registerContextInfoRetriever(RETRIEVER_NAME_1, ContextInfoRetrieverStubs.NULL_RETRIEVER));
 
         List<String> output = enableContextAndTrace();
-        testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME, "{ none = { } } }");
+        testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME, "{ { } } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -346,7 +346,7 @@ public abstract class AppContextITBase {
 
         List<String> output = enableContextAndTrace();
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ int32 = " + ContextInfoRetrieverStubs.INTEGER_VALUE + " } }");
+                "{ " + ContextInfoRetrieverStubs.INTEGER_VALUE + " } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -360,7 +360,7 @@ public abstract class AppContextITBase {
 
         List<String> output = enableContextAndTrace();
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ int64 = " + ContextInfoRetrieverStubs.LONG_VALUE + " } }");
+                "{ " + ContextInfoRetrieverStubs.LONG_VALUE + " } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -374,7 +374,7 @@ public abstract class AppContextITBase {
 
         List<String> output = enableContextAndTrace();
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ double = " + ContextInfoRetrieverStubs.DOUBLE_VALUE + " } }");
+                "{ " + ContextInfoRetrieverStubs.DOUBLE_VALUE + " } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -388,7 +388,7 @@ public abstract class AppContextITBase {
 
         List<String> output = enableContextAndTrace();
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ string = \"" + ContextInfoRetrieverStubs.CHARACTER_VALUE + "\" } }");
+                "{ \"" + ContextInfoRetrieverStubs.CHARACTER_VALUE + "\" } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -402,7 +402,7 @@ public abstract class AppContextITBase {
 
         List<String> output = enableContextAndTrace();
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ float = " + ContextInfoRetrieverStubs.FLOAT_VALUE + " } }");
+                "{ " + ContextInfoRetrieverStubs.FLOAT_VALUE + " } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -416,7 +416,7 @@ public abstract class AppContextITBase {
 
         List<String> output = enableContextAndTrace();
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ int8 = " + ContextInfoRetrieverStubs.BYTE_VALUE + " } }");
+                "{ " + ContextInfoRetrieverStubs.BYTE_VALUE + " } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -430,7 +430,7 @@ public abstract class AppContextITBase {
 
         List<String> output = enableContextAndTrace();
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ int16 = " + ContextInfoRetrieverStubs.SHORT_VALUE + " } }");
+                "{ " + ContextInfoRetrieverStubs.SHORT_VALUE + " } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -443,7 +443,7 @@ public abstract class AppContextITBase {
         assertTrue(cim.registerContextInfoRetriever(RETRIEVER_NAME_1, ContextInfoRetrieverStubs.BOOLEAN_TRUE_RETRIEVER));
 
         List<String> output = enableContextAndTrace();
-        testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME, "{ int8 = 1 } }");
+        testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME, "{ 1 } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -456,7 +456,7 @@ public abstract class AppContextITBase {
         assertTrue(cim.registerContextInfoRetriever(RETRIEVER_NAME_1, ContextInfoRetrieverStubs.BOOLEAN_FALSE_RETRIEVER));
 
         List<String> output = enableContextAndTrace();
-        testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME, "{ int8 = 0 } }");
+        testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME, "{ 0 } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -470,7 +470,7 @@ public abstract class AppContextITBase {
 
         List<String> output = enableContextAndTrace();
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ string = \"" + ContextInfoRetrieverStubs.STRING_VALUE + "\" } }");
+                "{ \"" + ContextInfoRetrieverStubs.STRING_VALUE + "\" } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -484,7 +484,7 @@ public abstract class AppContextITBase {
 
         List<String> output = enableContextAndTrace();
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ string = \"" + ContextInfoRetrieverStubs.OBJECT_VALUE.toString() + "\" } }");
+                "{ \"" + ContextInfoRetrieverStubs.OBJECT_VALUE.toString() + "\" } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
@@ -566,7 +566,7 @@ public abstract class AppContextITBase {
         assertFalse(output.isEmpty());
 
         testContextPresentInTrace(output, RETRIEVER_NAME_1, CONTEXT_NAME,
-                "{ string = \"" + ContextInfoRetrieverStubs.STRING_VALUE + "\" } }");
+                "{ \"" + ContextInfoRetrieverStubs.STRING_VALUE + "\" } }");
 
         assertTrue(cim.unregisterContextInfoRetriever(RETRIEVER_NAME_1));
     }
index a2a038c7206d433445ae7fe3c80753d69bd4f1a7..d567c18b986c13e0db5c78f9f0b51ee3875a748f 100644 (file)
@@ -147,7 +147,7 @@ public abstract class AppContextOrderingITBase {
         String traceRetriverName = RETRIEVER_NAME.replace('.', '_');
         String traceContextName = CONTEXT_NAME.replace('.', '_');
 
-        String expectedString = "_app_" + traceRetriverName + "_" + traceContextName + " = { string = \"" + CONTEXT_VALUE + "\" } }";
+        String expectedString = "_app_" + traceRetriverName + "_" + traceContextName + " = { \"" + CONTEXT_VALUE + "\" } }";
         output.forEach(line -> assertTrue(line.contains(expectedString)));
     }
 
This page took 0.027222 seconds and 4 git commands to generate.