Skip to content

Commit

Permalink
Reverse test args
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartosz Litwiniuk committed Oct 23, 2024
1 parent 7a3eb9d commit ad7017b
Showing 1 changed file with 39 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import android.content.Context;

Expand Down Expand Up @@ -42,25 +43,25 @@ public void createBacktraceDataTest() {
BacktraceData backtraceData = new BacktraceData.Builder(context, report, clientAttributes).build();

// THEN
assertArrayEquals(backtraceData.getClassifiers(), new String[]{"java.lang.IllegalAccessException"});
assertEquals(backtraceData.getReport(), report);
assertEquals(backtraceData.getAttributes().get("classifier"), "java.lang.IllegalAccessException");
assertEquals(backtraceData.getAgent(), "backtrace-android");
assertEquals(backtraceData.getAgentVersion(), backtraceio.library.BuildConfig.VERSION_NAME);
assertEquals(backtraceData.getLang(), "java");
assertEquals(backtraceData.getLangVersion(), "0");
assertEquals(backtraceData.getSymbolication(), "");
assertEquals(backtraceData.getTimestamp(), report.timestamp);
assertEquals(backtraceData.getUuid(), report.uuid.toString());
assertEquals(backtraceData.getAttributes().size(), 43);
assertEquals(backtraceData.getAnnotations().size(), 3);
assertEquals(backtraceData.getMainThread(), "instr: androidx.test.runner.androidjunitrunner");
assertEquals(backtraceData.getSourceCode().size(), 34);
assertEquals(backtraceData.getThreadInformationMap().size(), 15);
assertEquals(backtraceData.getAttachmentPaths().size(), 3);
assertEquals(backtraceData.getAttributes().get("attr-1"), "1");
assertEquals(backtraceData.getAttributes().get("attr-2"), "true");
assertEquals(backtraceData.getAttributes().get("attr-3"), "test");
assertArrayEquals( new String[]{"java.lang.IllegalAccessException"} , backtraceData.getClassifiers());
assertEquals(report, backtraceData.getReport());
assertEquals("java.lang.IllegalAccessException", backtraceData.getAttributes().get("classifier"));
assertEquals("backtrace-android", backtraceData.getAgent());
assertEquals(backtraceio.library.BuildConfig.VERSION_NAME, backtraceData.getAgentVersion());
assertEquals("java", backtraceData.getLang());
assertEquals("0", backtraceData.getLangVersion());
assertEquals("", backtraceData.getSymbolication());
assertEquals(report.timestamp, backtraceData.getTimestamp());
assertEquals(report.uuid.toString(), backtraceData.getUuid());
assertEquals(43, backtraceData.getAttributes().size());
assertEquals(3, backtraceData.getAnnotations().size());
assertEquals("instr: androidx.test.runner.androidjunitrunner", backtraceData.getMainThread());
assertEquals(34, backtraceData.getSourceCode().size());
assertTrue(!backtraceData.getThreadInformationMap().isEmpty());
assertEquals(3, backtraceData.getAttachmentPaths().size());
assertEquals("1", backtraceData.getAttributes().get("attr-1"));
assertEquals("true", backtraceData.getAttributes().get("attr-2"));
assertEquals("test", backtraceData.getAttributes().get("attr-3"));
}
@Test
public void testBacktraceDataConstructor() {
Expand All @@ -77,24 +78,24 @@ public void testBacktraceDataConstructor() {
BacktraceData backtraceData = new BacktraceData(context, report, clientAttributes);

// THEN
assertArrayEquals(backtraceData.getClassifiers(), new String[]{"java.lang.IllegalAccessException"});
assertEquals(backtraceData.getReport(), report);
assertEquals(backtraceData.getAttributes().get("classifier"), "java.lang.IllegalAccessException");
assertEquals(backtraceData.getAgent(), "backtrace-android");
assertEquals(backtraceData.getAgentVersion(), backtraceio.library.BuildConfig.VERSION_NAME);
assertEquals(backtraceData.getLang(), "java");
assertEquals(backtraceData.getLangVersion(), "0");
assertEquals(backtraceData.getSymbolication(), "");
assertEquals(backtraceData.getTimestamp(), report.timestamp);
assertEquals(backtraceData.getUuid(), report.uuid.toString());
assertEquals(backtraceData.getAttributes().size(), 43);
assertEquals(backtraceData.getAnnotations().size(), 3);
assertEquals(backtraceData.getMainThread(), "instr: androidx.test.runner.androidjunitrunner");
assertEquals(backtraceData.getSourceCode().size(), 34);
assertEquals(backtraceData.getThreadInformationMap().size(), 13);
assertEquals(backtraceData.getAttachmentPaths().size(), 3);
assertEquals(backtraceData.getAttributes().get("attr-1"), "1");
assertEquals(backtraceData.getAttributes().get("attr-2"), "true");
assertEquals(backtraceData.getAttributes().get("attr-3"), "test");
assertArrayEquals( new String[]{"java.lang.IllegalAccessException"}, backtraceData.getClassifiers());
assertEquals(report, backtraceData.getReport());
assertEquals("java.lang.IllegalAccessException", backtraceData.getAttributes().get("classifier"));
assertEquals("backtrace-android", backtraceData.getAgent());
assertEquals(backtraceio.library.BuildConfig.VERSION_NAME, backtraceData.getAgentVersion());
assertEquals("java", backtraceData.getLang());
assertEquals("0", backtraceData.getLangVersion());
assertEquals("", backtraceData.getSymbolication());
assertEquals(report.timestamp, backtraceData.getTimestamp());
assertEquals(report.uuid.toString(), backtraceData.getUuid());
assertEquals(43, backtraceData.getAttributes().size());
assertEquals(3, backtraceData.getAnnotations().size());
assertEquals("instr: androidx.test.runner.androidjunitrunner", backtraceData.getMainThread());
assertEquals(34, backtraceData.getSourceCode().size());
assertTrue(!backtraceData.getThreadInformationMap().isEmpty());
assertEquals(3, backtraceData.getAttachmentPaths().size());
assertEquals("1", backtraceData.getAttributes().get("attr-1"));
assertEquals("true", backtraceData.getAttributes().get("attr-2"));
assertEquals("test", backtraceData.getAttributes().get("attr-3"));
}
}

0 comments on commit ad7017b

Please sign in to comment.