Skip to content

Commit

Permalink
Supress unchecked warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumBadger committed Jan 29, 2023
1 parent f56a39d commit 167279f
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public void testString() throws SerializeUtils.UnhandledTypeException, IOExcepti
Assert.assertEquals("Hello world", result);
}

@SuppressWarnings("unchecked")
@Test
public void testSet() throws SerializeUtils.UnhandledTypeException, IOException {

Expand All @@ -195,7 +196,6 @@ public void testSet() throws SerializeUtils.UnhandledTypeException, IOException

SerializeUtils.serialize(dataHandler.getOutput(), input);

//noinspection unchecked
final Set<Object> result
= (Set<Object>)SerializeUtils.deserialize(dataHandler.getInput());

Expand All @@ -208,6 +208,7 @@ public void testSet() throws SerializeUtils.UnhandledTypeException, IOException
Assert.assertTrue(result.contains(null));
}

@SuppressWarnings("unchecked")
@Test
public void testEmptySet() throws SerializeUtils.UnhandledTypeException, IOException {

Expand All @@ -217,7 +218,6 @@ public void testEmptySet() throws SerializeUtils.UnhandledTypeException, IOExcep

SerializeUtils.serialize(dataHandler.getOutput(), input);

//noinspection unchecked
final Set<Object> result
= (Set<Object>)SerializeUtils.deserialize(dataHandler.getInput());

Expand All @@ -226,6 +226,7 @@ public void testEmptySet() throws SerializeUtils.UnhandledTypeException, IOExcep
Assert.assertEquals(input.size(), result.size());
}

@SuppressWarnings("unchecked")
@Test
public void testList() throws SerializeUtils.UnhandledTypeException, IOException {

Expand All @@ -238,7 +239,6 @@ public void testList() throws SerializeUtils.UnhandledTypeException, IOException

SerializeUtils.serialize(dataHandler.getOutput(), input);

//noinspection unchecked
final List<Object> result
= (List<Object>)SerializeUtils.deserialize(dataHandler.getInput());

Expand All @@ -251,6 +251,7 @@ public void testList() throws SerializeUtils.UnhandledTypeException, IOException
Assert.assertNull(result.get(2));
}

@SuppressWarnings("unchecked")
@Test
public void testEmptyList() throws SerializeUtils.UnhandledTypeException, IOException {

Expand All @@ -260,7 +261,6 @@ public void testEmptyList() throws SerializeUtils.UnhandledTypeException, IOExce

SerializeUtils.serialize(dataHandler.getOutput(), input);

//noinspection unchecked
final List<Object> result
= (List<Object>)SerializeUtils.deserialize(dataHandler.getInput());

Expand All @@ -269,6 +269,7 @@ public void testEmptyList() throws SerializeUtils.UnhandledTypeException, IOExce
Assert.assertEquals(input.size(), result.size());
}

@SuppressWarnings("unchecked")
@Test
public void testMap() throws SerializeUtils.UnhandledTypeException, IOException {

Expand All @@ -282,7 +283,6 @@ public void testMap() throws SerializeUtils.UnhandledTypeException, IOException

SerializeUtils.serialize(dataHandler.getOutput(), input);

//noinspection unchecked
final Map<Object, Object> result
= (Map<Object, Object>)SerializeUtils.deserialize(dataHandler.getInput());

Expand All @@ -296,6 +296,7 @@ public void testMap() throws SerializeUtils.UnhandledTypeException, IOException
Assert.assertEquals(0.25, result.get((byte)98));
}

@SuppressWarnings("unchecked")
@Test
public void testEmptyMap() throws SerializeUtils.UnhandledTypeException, IOException {

Expand All @@ -305,7 +306,6 @@ public void testEmptyMap() throws SerializeUtils.UnhandledTypeException, IOExcep

SerializeUtils.serialize(dataHandler.getOutput(), input);

//noinspection unchecked
final Map<Object, Object> result
= (Map<Object, Object>)SerializeUtils.deserialize(dataHandler.getInput());

Expand All @@ -314,6 +314,7 @@ public void testEmptyMap() throws SerializeUtils.UnhandledTypeException, IOExcep
Assert.assertEquals(input.size(), result.size());
}

@SuppressWarnings("unchecked")
@Test
public void testMapContainingList() throws SerializeUtils.UnhandledTypeException, IOException {

Expand All @@ -324,7 +325,6 @@ public void testMapContainingList() throws SerializeUtils.UnhandledTypeException

SerializeUtils.serialize(dataHandler.getOutput(), input);

//noinspection unchecked
final Map<Object, Object> result
= (Map<Object, Object>)SerializeUtils.deserialize(dataHandler.getInput());

Expand Down

0 comments on commit 167279f

Please sign in to comment.