Skip to content

Commit 79e3a23

Browse files
committed
Uncommenting tests will be addressed seperately
1 parent e5931d7 commit 79e3a23

File tree

1 file changed

+30
-29
lines changed

1 file changed

+30
-29
lines changed

agent/src/test/java/com/microsoft/applicationinsights/agent/internal/agent/ClassInstrumentationDataTest.java

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
import com.microsoft.applicationinsights.agent.internal.coresync.InstrumentedClassType;
2525
import org.junit.Test;
2626

27-
import static org.junit.Assert.*;
27+
import static org.junit.Assert.assertEquals;
28+
import static org.junit.Assert.assertTrue;
2829

2930
public final class ClassInstrumentationDataTest {
3031
private final static String MOCK_CLASS_NAME = "ClassName";
31-
// private final static String MOCK_METHOD = "Method";
32-
// private final static String MOCK_SIGNATURE_1 = "Signature1";
33-
// private final static String MOCK_SIGNATURE_2 = "Signature2";
34-
// private final static String MOCK_SIGNATURE_3 = "Signature3";
32+
private final static String MOCK_METHOD = "Method";
33+
private final static String MOCK_SIGNATURE_1 = "Signature1";
34+
private final static String MOCK_SIGNATURE_2 = "Signature2";
35+
private final static String MOCK_SIGNATURE_3 = "Signature3";
3536

3637
@Test
3738
public void testCtor() throws Exception {
@@ -45,12 +46,12 @@ public void testCtor() throws Exception {
4546
assertEquals(test.isReportExecutionTime(), false);
4647
}
4748

48-
// @Test
49-
// public void testAddMethodOverridesBooleanValues() throws Exception {
50-
// ClassInstrumentationData test = new ClassInstrumentationData(MOCK_CLASS_NAME, InstrumentedClassType.HTTP)
51-
// .setReportCaughtExceptions(false)
52-
// .setReportExecutionTime(false);
53-
// test.addMethod(MOCK_METHOD, MOCK_SIGNATURE_1, true, true, 0);
49+
@Test
50+
public void testAddMethodOverridesBooleanValues() throws Exception {
51+
ClassInstrumentationData test = new ClassInstrumentationData(MOCK_CLASS_NAME, InstrumentedClassType.HTTP)
52+
.setReportCaughtExceptions(false)
53+
.setReportExecutionTime(false);
54+
test.addMethod(MOCK_METHOD, MOCK_SIGNATURE_1, true, true, 0);
5455

5556
// MethodInstrumentationDecision decision = test.getDecisionForMethod(MOCK_METHOD, MOCK_SIGNATURE_1);
5657

@@ -61,15 +62,15 @@ public void testCtor() throws Exception {
6162
// decision = test.getDecisionForMethod(MOCK_METHOD, MOCK_SIGNATURE_2);
6263
//
6364
// assertNull(decision);
64-
// }
65+
}
6566

66-
// @Test
67-
// public void testAddMethodsWithDistinctSignatures() throws Exception {
68-
// ClassInstrumentationData test = new ClassInstrumentationData(MOCK_CLASS_NAME, InstrumentedClassType.HTTP)
69-
// .setReportCaughtExceptions(false)
70-
// .setReportExecutionTime(false);
71-
// test.addMethod(MOCK_METHOD, MOCK_SIGNATURE_1, true, true, 0);
72-
// test.addMethod(MOCK_METHOD, MOCK_SIGNATURE_2, false, true, 0);
67+
@Test
68+
public void testAddMethodsWithDistinctSignatures() throws Exception {
69+
ClassInstrumentationData test = new ClassInstrumentationData(MOCK_CLASS_NAME, InstrumentedClassType.HTTP)
70+
.setReportCaughtExceptions(false)
71+
.setReportExecutionTime(false);
72+
test.addMethod(MOCK_METHOD, MOCK_SIGNATURE_1, true, true, 0);
73+
test.addMethod(MOCK_METHOD, MOCK_SIGNATURE_2, false, true, 0);
7374

7475
// MethodInstrumentationDecision decision = test.getDecisionForMethod(MOCK_METHOD, MOCK_SIGNATURE_1);
7576
//
@@ -82,16 +83,16 @@ public void testCtor() throws Exception {
8283
// assertNotNull(decision);
8384
// assertEquals(decision.isReportCaughtExceptions(), false);
8485
// assertEquals(decision.isReportExecutionTime(), true);
85-
// }
86+
}
8687

87-
// @Test
88-
// public void testAddMethodsWithDistinctSignaturesAndOneWithNoSignature() throws Exception {
89-
// ClassInstrumentationData test = new ClassInstrumentationData(MOCK_CLASS_NAME, InstrumentedClassType.HTTP)
90-
// .setReportCaughtExceptions(true)
91-
// .setReportExecutionTime(false);
92-
// test.addMethod(MOCK_METHOD, MOCK_SIGNATURE_1, true, true, 0);
93-
// test.addMethod(MOCK_METHOD, MOCK_SIGNATURE_2, false, true, 0);
94-
// test.addMethod(MOCK_METHOD, null, false, true, 0);
88+
@Test
89+
public void testAddMethodsWithDistinctSignaturesAndOneWithNoSignature() throws Exception {
90+
ClassInstrumentationData test = new ClassInstrumentationData(MOCK_CLASS_NAME, InstrumentedClassType.HTTP)
91+
.setReportCaughtExceptions(true)
92+
.setReportExecutionTime(false);
93+
test.addMethod(MOCK_METHOD, MOCK_SIGNATURE_1, true, true, 0);
94+
test.addMethod(MOCK_METHOD, MOCK_SIGNATURE_2, false, true, 0);
95+
test.addMethod(MOCK_METHOD, null, false, true, 0);
9596

9697
// MethodInstrumentationDecision decision = test.getDecisionForMethod(MOCK_METHOD, MOCK_SIGNATURE_1);
9798
//
@@ -110,5 +111,5 @@ public void testCtor() throws Exception {
110111
// assertNotNull(decision);
111112
// assertEquals(decision.isReportCaughtExceptions(), false);
112113
// assertEquals(decision.isReportExecutionTime(), true);
113-
// }
114+
}
114115
}

0 commit comments

Comments
 (0)