Skip to content

Commit

Permalink
test: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
danglotb committed Nov 27, 2019
1 parent c880782 commit ccaff1c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.junit.Test;

import java.io.File;
import java.io.Serializable;
import java.util.*;

import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -38,6 +39,9 @@ private static class MyInternalClass {
public MyInternalClass(int a, int b) {
this.a = a;
this.b = b;
this.myList = new MyList();
this.myList.add("toto");
this.myList.add("tata");
}

public List<Integer> getObject() {
Expand Down Expand Up @@ -67,6 +71,13 @@ public Iterable<String> getIterable() {
public Collection<String> getCollection() {
return Collections.singleton("");
}
public static class MyList extends ArrayList implements Serializable {
public int aValue = 23;
}
public MyList myList;
public MyList getMyList() {
return this.myList;
}
}

public static Integer add(Integer a, Integer b) {
Expand All @@ -88,7 +99,7 @@ public void test() throws Exception {
assertNotNull(add__0);
// assertEquals(1, add__0.getNotDeterministValues().size());
final Map<String, Object> observationValues = add__0.getObservationValues();
assertEquals(5, observationValues.size());
assertEquals(8, observationValues.size());
// assertEquals(25, observationValues.get("(myInternalClass ).compute()"));
assertEquals(3, observationValues.get("(myInternalClass ).getA()"));
assertEquals(20, observationValues.get("(myInternalClass ).getB()"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@
*/
public class ObjectLogUtilsTest {

public class MyList extends ArrayList {

}

@Test//TODO empty collection / map are considered as primitive, we may need to found a semantic of the method.
public void testIsPrimitiveCollectionOrMap() throws Exception {

assertFalse(ObjectLogUtils.isCollection(new MyList()));

final ArrayList<Integer> list = new ArrayList<>();
assertFalse(ObjectLogUtils.isNonEmptyPrimitiveCollectionOrMap(list));
list.add(1);
Expand All @@ -32,6 +39,7 @@ public void testIsPrimitiveCollectionOrMap() throws Exception {
assertTrue(ObjectLogUtils.isNonEmptyPrimitiveCollectionOrMap(set));

assertFalse(ObjectLogUtils.isNonEmptyPrimitiveCollectionOrMap(1));

}

@Test
Expand Down

0 comments on commit ccaff1c

Please sign in to comment.