Skip to content
Permalink
Browse files
suppress unchecked cast warnings in tests
  • Loading branch information
AlexanderSaydakov committed Sep 8, 2017
1 parent a42ec52 commit 6c52512f2a4a14d3184e81fbc085e658ff3d5cb0
Showing 2 changed files with 22 additions and 0 deletions.
@@ -124,6 +124,7 @@ public void accumulator() throws Exception {

@Test
public void algebraicInitial() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new DataToSketch().getInitial()).newInstance();
Tuple input = tupleFactory.newTuple();
@@ -133,6 +134,7 @@ public void algebraicInitial() throws Exception {

@Test
public void algebraicInitialWithLgK() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new DataToSketch().getInitial())
.getConstructor(String.class).newInstance("10");
@@ -143,6 +145,7 @@ public void algebraicInitialWithLgK() throws Exception {

@Test
public void algebraicInitialWithLgKAndTgtHllType() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new DataToSketch().getInitial())
.getConstructor(String.class, String.class).newInstance("10", "HLL_6");
@@ -153,6 +156,7 @@ public void algebraicInitialWithLgKAndTgtHllType() throws Exception {

@Test
public void algebraicIntermediateNullInputTuple() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new DataToSketch().getIntermed()).newInstance();
Tuple result = func.exec(null);
@@ -162,6 +166,7 @@ public void algebraicIntermediateNullInputTuple() throws Exception {

@Test
public void algebraicIntermediateEmptyInputTuple() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new DataToSketch().getIntermed())
.getConstructor(String.class).newInstance("10");
@@ -173,6 +178,7 @@ public void algebraicIntermediateEmptyInputTuple() throws Exception {

@Test
public void algebraicIntermediateEmptyBag() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new DataToSketch().getIntermed())
.getConstructor(String.class, String.class).newInstance("10", "HLL_6");
@@ -185,6 +191,7 @@ public void algebraicIntermediateEmptyBag() throws Exception {

@Test
public void algebraicIntermediateFromInitial() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new DataToSketch().getIntermed()).newInstance();
DataBag outerBag = bagFactory.newDefaultBag();
@@ -201,6 +208,7 @@ public void algebraicIntermediateFromInitial() throws Exception {

@Test
public void algebraicIntermediateFromIntermediate() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new DataToSketch().getIntermed()).newInstance();
HllSketch inputSketch = new HllSketch(12);
@@ -216,6 +224,7 @@ public void algebraicIntermediateFromIntermediate() throws Exception {

@Test
public void algebraicFinalNullInputTuple() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<DataByteArray> func =
(EvalFunc<DataByteArray>) Class.forName(new DataToSketch().getFinal()).newInstance();
DataByteArray result = func.exec(null);
@@ -225,6 +234,7 @@ public void algebraicFinalNullInputTuple() throws Exception {

@Test
public void algebraicFinalEmptyInputTuple() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<DataByteArray> func =
(EvalFunc<DataByteArray>) Class.forName(new DataToSketch().getFinal())
.getConstructor(String.class).newInstance("10");
@@ -236,6 +246,7 @@ public void algebraicFinalEmptyInputTuple() throws Exception {

@Test
public void algebraicFinalEmptyBag() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<DataByteArray> func =
(EvalFunc<DataByteArray>) Class.forName(new DataToSketch().getFinal())
.getConstructor(String.class, String.class).newInstance("10", "HLL_6");
@@ -248,6 +259,7 @@ public void algebraicFinalEmptyBag() throws Exception {

@Test
public void algebraicFinalFromInitial() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<DataByteArray> func =
(EvalFunc<DataByteArray>) Class.forName(new DataToSketch().getFinal()).newInstance();
DataBag outerBag = bagFactory.newDefaultBag();
@@ -264,6 +276,7 @@ public void algebraicFinalFromInitial() throws Exception {

@Test
public void algebraicFinalFromIntermediate() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<DataByteArray> func =
(EvalFunc<DataByteArray>) Class.forName(new DataToSketch().getFinal()).newInstance();
HllSketch inputSketch = new HllSketch(12);
@@ -112,6 +112,7 @@ public void accumulator() throws Exception {

@Test
public void algebraicInitial() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new UnionSketch().getInitial()).newInstance();
Tuple input = tupleFactory.newTuple();
@@ -121,6 +122,7 @@ public void algebraicInitial() throws Exception {

@Test
public void algebraicIntermediateNullInputTuple() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new UnionSketch().getIntermed()).newInstance();
Tuple result = func.exec(null);
@@ -130,6 +132,7 @@ public void algebraicIntermediateNullInputTuple() throws Exception {

@Test
public void algebraicIntermediateEmptyInputTuple() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new UnionSketch().getIntermed())
.getConstructor(String.class).newInstance("10");
@@ -141,6 +144,7 @@ public void algebraicIntermediateEmptyInputTuple() throws Exception {

@Test
public void algebraicIntermediateFromInitial() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new UnionSketch().getIntermed())
.getConstructor(String.class, String.class).newInstance("10", "HLL_6");
@@ -162,6 +166,7 @@ public void algebraicIntermediateFromInitial() throws Exception {

@Test
public void algebraicIntermediateFromIntermediate() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<Tuple> func =
(EvalFunc<Tuple>) Class.forName(new UnionSketch().getIntermed()).newInstance();
HllSketch inputSketch = new HllSketch(12);
@@ -177,6 +182,7 @@ public void algebraicIntermediateFromIntermediate() throws Exception {

@Test
public void algebraicFinalNullInputTuple() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<DataByteArray> func =
(EvalFunc<DataByteArray>) Class.forName(new UnionSketch().getFinal()).newInstance();
DataByteArray result = func.exec(null);
@@ -186,6 +192,7 @@ public void algebraicFinalNullInputTuple() throws Exception {

@Test
public void algebraicFinalEmptyInputTuple() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<DataByteArray> func =
(EvalFunc<DataByteArray>) Class.forName(new UnionSketch().getFinal())
.getConstructor(String.class).newInstance("10");
@@ -197,6 +204,7 @@ public void algebraicFinalEmptyInputTuple() throws Exception {

@Test
public void algebraicFinalFromInitial() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<DataByteArray> func =
(EvalFunc<DataByteArray>) Class.forName(new UnionSketch().getFinal())
.getConstructor(String.class, String.class).newInstance("10", "HLL_6");
@@ -218,6 +226,7 @@ public void algebraicFinalFromInitial() throws Exception {

@Test
public void algebraicFinalFromIntermediate() throws Exception {
@SuppressWarnings("unchecked")
EvalFunc<DataByteArray> func =
(EvalFunc<DataByteArray>) Class.forName(new UnionSketch().getFinal()).newInstance();
HllSketch inputSketch = new HllSketch(12);

0 comments on commit 6c52512

Please sign in to comment.