Skip to content

Commit

Permalink
renamed classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitish1814 committed Jul 13, 2024
1 parent bed9924 commit ae8cfea
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 51 deletions.
30 changes: 15 additions & 15 deletions common/client/src/test/java/zingg/common/client/TestZFrameBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import zingg.common.client.model.Person;
import zingg.common.client.model.PersonMixed;
import zingg.common.client.model.ClusterZScore;
import zingg.common.client.model.ClusterSource;
import zingg.common.client.model.ClusterPairOne;
import zingg.common.client.model.ClusterPairTwo;
import zingg.common.client.model.InputWithZidAndSource;
import zingg.common.client.model.PairPartOne;
import zingg.common.client.model.PairPartTwo;

import java.lang.reflect.Field;
import java.util.ArrayList;
Expand Down Expand Up @@ -422,38 +422,38 @@ public void testGroupByMinMax2() throws Exception {

@Test
public void testRightJoinMultiCol() throws Exception {
List<ClusterSource> sampleDataSetInput = createSampleDataInput(); //List<TestPOJO>
ZFrame<D, R, C> zFrameInput = dfObjectUtil.getDFFromObjectList(sampleDataSetInput, ClusterSource.class);
List<ClusterPairOne> sampleDataSetCluster = createSampleDataCluster(); //List<TestPOJO>
ZFrame<D, R, C> zFrameCluster = dfObjectUtil.getDFFromObjectList(sampleDataSetCluster, ClusterPairOne.class);
List<InputWithZidAndSource> sampleDataSetInput = createSampleDataInput(); //List<TestPOJO>
ZFrame<D, R, C> zFrameInput = dfObjectUtil.getDFFromObjectList(sampleDataSetInput, InputWithZidAndSource.class);
List<PairPartOne> sampleDataSetCluster = createSampleDataCluster(); //List<TestPOJO>
ZFrame<D, R, C> zFrameCluster = dfObjectUtil.getDFFromObjectList(sampleDataSetCluster, PairPartOne.class);

ZFrame<D, R, C> joinedData = zFrameCluster.join(zFrameInput, ColName.ID_COL, ColName.SOURCE_COL, ZFrame.RIGHT_JOIN);
assertEquals(10, joinedData.count());
}

@Test
public void testFilterInCond() throws Exception {
List<ClusterSource> sampleDataSetInput = createSampleDataInput(); //List<TestPOJO>
ZFrame<D, R, C> zFrameInput = dfObjectUtil.getDFFromObjectList(sampleDataSetInput, ClusterSource.class);
List<ClusterPairTwo> sampleDataSetCluster = createSampleDataClusterWithNull(); //List<TestPOJO>
ZFrame<D, R, C> zFrameCluster = dfObjectUtil.getDFFromObjectList(sampleDataSetCluster, ClusterPairTwo.class);
List<InputWithZidAndSource> sampleDataSetInput = createSampleDataInput(); //List<TestPOJO>
ZFrame<D, R, C> zFrameInput = dfObjectUtil.getDFFromObjectList(sampleDataSetInput, InputWithZidAndSource.class);
List<PairPartTwo> sampleDataSetCluster = createSampleDataClusterWithNull(); //List<TestPOJO>
ZFrame<D, R, C> zFrameCluster = dfObjectUtil.getDFFromObjectList(sampleDataSetCluster, PairPartTwo.class);
ZFrame<D, R, C> filteredData = zFrameInput.filterInCond(ColName.ID_COL, zFrameCluster, ColName.COL_PREFIX + ColName.ID_COL);
assertEquals(5, filteredData.count());
}

@Test
public void testFilterNotNullCond() throws Exception {
List<ClusterPairTwo> sampleDataSetCluster = createSampleDataClusterWithNull(); //List<TestPOJO>
ZFrame<D, R, C> zFrameCluster = dfObjectUtil.getDFFromObjectList(sampleDataSetCluster, ClusterPairTwo.class);
List<PairPartTwo> sampleDataSetCluster = createSampleDataClusterWithNull(); //List<TestPOJO>
ZFrame<D, R, C> zFrameCluster = dfObjectUtil.getDFFromObjectList(sampleDataSetCluster, PairPartTwo.class);

ZFrame<D, R, C> filteredData = zFrameCluster.filterNotNullCond(ColName.SOURCE_COL);
assertEquals(3, filteredData.count());
}

@Test
public void testFilterNullCond() throws Exception {
List<ClusterPairTwo> sampleDataSetCluster = createSampleDataClusterWithNull(); //List<TestPOJO>
ZFrame<D, R, C> zFrameCluster = dfObjectUtil.getDFFromObjectList(sampleDataSetCluster, ClusterPairTwo.class);
List<PairPartTwo> sampleDataSetCluster = createSampleDataClusterWithNull(); //List<TestPOJO>
ZFrame<D, R, C> zFrameCluster = dfObjectUtil.getDFFromObjectList(sampleDataSetCluster, PairPartTwo.class);

ZFrame<D, R, C> filteredData = zFrameCluster.filterNullCond(ColName.SOURCE_COL);
assertEquals(2, filteredData.count());
Expand Down
60 changes: 30 additions & 30 deletions common/client/src/test/java/zingg/common/client/data/TestData.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@


import zingg.common.client.model.Person;
import zingg.common.client.model.ClusterPairOne;
import zingg.common.client.model.ClusterPairTwo;
import zingg.common.client.model.ClusterSource;
import zingg.common.client.model.PairPartOne;
import zingg.common.client.model.PairPartTwo;
import zingg.common.client.model.InputWithZidAndSource;
import zingg.common.client.model.PersonMixed;
import zingg.common.client.model.ClusterZScore;

Expand Down Expand Up @@ -105,43 +105,43 @@ public static List<ClusterZScore> createSampleDataZScore() {
return sample;
}

public static List<ClusterPairOne> createSampleDataCluster() {
public static List<PairPartOne> createSampleDataCluster() {

List<ClusterPairOne> sample = new ArrayList<>();
sample.add(new ClusterPairOne(1L, "100", 1001.0, "b"));
sample.add(new ClusterPairOne(2L, "100", 1002.0, "a"));
sample.add(new ClusterPairOne(3L, "100", 2001.0, "b"));
sample.add(new ClusterPairOne(4L, "900", 2002.0, "c"));
sample.add(new ClusterPairOne(5L, "111", 9002.0, "c"));
List<PairPartOne> sample = new ArrayList<>();
sample.add(new PairPartOne(1L, "100", 1001.0, "b"));
sample.add(new PairPartOne(2L, "100", 1002.0, "a"));
sample.add(new PairPartOne(3L, "100", 2001.0, "b"));
sample.add(new PairPartOne(4L, "900", 2002.0, "c"));
sample.add(new PairPartOne(5L, "111", 9002.0, "c"));

return sample;
}

public static List<ClusterPairTwo> createSampleDataClusterWithNull() {
public static List<PairPartTwo> createSampleDataClusterWithNull() {

List<ClusterPairTwo> sample = new ArrayList<>();
sample.add(new ClusterPairTwo(1L, "100", 1001.0, "b"));
sample.add(new ClusterPairTwo(2L, "100", 1002.0, "a"));
sample.add(new ClusterPairTwo(3L, "100", 2001.0, null));
sample.add(new ClusterPairTwo(4L, "900", 2002.0, "c"));
sample.add(new ClusterPairTwo(5L, "111", 9002.0, null));
List<PairPartTwo> sample = new ArrayList<>();
sample.add(new PairPartTwo(1L, "100", 1001.0, "b"));
sample.add(new PairPartTwo(2L, "100", 1002.0, "a"));
sample.add(new PairPartTwo(3L, "100", 2001.0, null));
sample.add(new PairPartTwo(4L, "900", 2002.0, "c"));
sample.add(new PairPartTwo(5L, "111", 9002.0, null));

return sample;
}

public static List<ClusterSource> createSampleDataInput() {

List<ClusterSource> sample = new ArrayList<>();
sample.add(new ClusterSource(1L, "fname1", "b"));
sample.add(new ClusterSource(2L, "fname", "a"));
sample.add(new ClusterSource(3L, "fna", "b"));
sample.add((new ClusterSource(4L, "x", "c")));
sample.add(new ClusterSource(5L, "y", "c"));
sample.add(new ClusterSource(11L, "new1", "b"));
sample.add(new ClusterSource(22L, "new12", "a"));
sample.add(new ClusterSource(33L, "new13", "b"));
sample.add(new ClusterSource(44L, "new14", "c"));
sample.add(new ClusterSource(55L, "new15", "c"));
public static List<InputWithZidAndSource> createSampleDataInput() {

List<InputWithZidAndSource> sample = new ArrayList<>();
sample.add(new InputWithZidAndSource(1L, "fname1", "b"));
sample.add(new InputWithZidAndSource(2L, "fname", "a"));
sample.add(new InputWithZidAndSource(3L, "fna", "b"));
sample.add((new InputWithZidAndSource(4L, "x", "c")));
sample.add(new InputWithZidAndSource(5L, "y", "c"));
sample.add(new InputWithZidAndSource(11L, "new1", "b"));
sample.add(new InputWithZidAndSource(22L, "new12", "a"));
sample.add(new InputWithZidAndSource(33L, "new13", "b"));
sample.add(new InputWithZidAndSource(44L, "new14", "c"));
sample.add(new InputWithZidAndSource(55L, "new15", "c"));

return sample;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package zingg.common.client.model;

public class ClusterSource {
public class InputWithZidAndSource {
public final Long z_zid;
public final String fname;
public final String z_zsource;

public ClusterSource(Long z_zid, String fname, String z_zsource) {
public InputWithZidAndSource(Long z_zid, String fname, String z_zsource) {
this.z_zid = z_zid;
this.fname = fname;
this.z_zsource = z_zsource;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package zingg.common.client.model;

public class ClusterPairOne {
public class PairPartOne {
public final Long z_zid;
public final String z_cluster;
public final Double z_score;
public final String z_zsource;

public ClusterPairOne(Long z_zid, String z_cluster, Double z_score, String z_zsource) {
public PairPartOne(Long z_zid, String z_cluster, Double z_score, String z_zsource) {
this.z_zid = z_zid;
this.z_cluster = z_cluster;
this.z_score = z_score;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package zingg.common.client.model;

public class ClusterPairTwo {
public class PairPartTwo {
public final Long z_z_zid;
public final String z_cluster;
public final Double z_score;
public final String z_zsource;

public ClusterPairTwo(Long z_z_zid, String z_cluster, Double z_score, String z_zsource) {
public PairPartTwo(Long z_z_zid, String z_cluster, Double z_score, String z_zsource) {
this.z_z_zid = z_z_zid;
this.z_cluster = z_cluster;
this.z_score = z_score;
Expand Down

0 comments on commit ae8cfea

Please sign in to comment.