Skip to content

Commit

Permalink
[release] version 0.4.3
Browse files Browse the repository at this point in the history
[release] version 0.4.3
  • Loading branch information
Kevin Gómez authored Nov 27, 2018
2 parents 0e63e4b + 2686313 commit c5179c0
Show file tree
Hide file tree
Showing 611 changed files with 11,964 additions and 18,688 deletions.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
sudo: required
dist: trusty

os:
- linux
- osx
- windows

matrix:
allow_failures:
- os: windows
- os: osx

cache:
directories:
- $HOME/.m2
Expand All @@ -11,4 +21,4 @@ before_cache:

language: java

jdk: oraclejdk8
osx_image: xcode9.3
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Apache License, Version 2.0, January 2004](https://img.shields.io/github/license/apache/maven.svg?label=License)](https://www.apache.org/licenses/LICENSE-2.0)
[![Maven Central](https://img.shields.io/badge/Maven_Central-0.4.2-blue.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cgradoop)
[![Maven Central](https://img.shields.io/badge/Maven_Central-0.4.3-blue.svg?label=Maven%20Central)](http://search.maven.org/#search%7Cga%7C1%7Cgradoop)
[![Build Status](https://travis-ci.org/dbs-leipzig/gradoop.svg?branch=master)](https://travis-ci.org/dbs-leipzig/gradoop)
[![Code Quality: Java](https://img.shields.io/lgtm/grade/java/g/dbs-leipzig/gradoop.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/dbs-leipzig/gradoop/context:java)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/dbs-leipzig/gradoop.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/dbs-leipzig/gradoop/alerts)
Expand Down Expand Up @@ -110,7 +110,7 @@ Stable:
<dependency>
<groupId>org.gradoop</groupId>
<artifactId>gradoop-flink</artifactId>
<version>0.4.2</version>
<version>0.4.3</version>
</dependency>
```

Expand All @@ -133,17 +133,17 @@ Latest nightly build (additional repository is required):
</dependency>
```
In any case you also need Apache Flink (version 1.5.0):
In any case you also need Apache Flink (version 1.6.0):
```
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-java</artifactId>
<version>1.5.0</version>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-clients_2.11</artifactId>
<version>1.5.0</version>
<version>1.6.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion gradoop-checkstyle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.gradoop</groupId>
<artifactId>gradoop-parent</artifactId>
<version>0.4.2</version>
<version>0.4.3</version>
</parent>

<artifactId>gradoop-checkstyle</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">

<suppressions>
<suppress checks="ParameterNumberCheck"
files="GraphStatistics.java"
lines="0-9999"/>
<suppress checks="IllegalCatch"
files="GellyAlgorithm.java"
lines="60-70"/>
files="BaseGellyAlgorithm.java"
lines="36-42"/>
<suppress checks="IllegalCatch"
files="GradoopGellyAlgorithm.java"
lines="70-77"/>

<!-- less restrictive checkstyle for tests -->
<suppress checks="JavadocMethod"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="JavadocVariable"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="JavadocType"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="AvoidStarImport"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="JavadocPackage"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="IllegalCatch"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="ConstantName"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="LineLength"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="MethodLength"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="VisibilityModifier"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="DeclarationOrder"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
<suppress checks="StaticVariableName"
files="[/\\]src[/\\]test[/\\]java[/\\]"/>
</suppressions>
4 changes: 2 additions & 2 deletions gradoop-checkstyle/src/main/resources/gradoop/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<module name="MissingSwitchDefault"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<!-- Only one statment per line allowed -->
<!-- Only one statement per line allowed -->
<module name="OneStatementPerLine"/>
<!-- Use a consistent way to put declarations -->
<module name="DeclarationOrder"/>
Expand Down Expand Up @@ -198,7 +198,7 @@

<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<!-- Lines cannot exceed 80 chars -->
<!-- Lines cannot exceed 100 chars -->
<module name="LineLength">
<property name="max" value="100"/>
<property name="ignorePattern" value="^[import|package]|@see|@link"/>
Expand Down
2 changes: 1 addition & 1 deletion gradoop-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.gradoop</groupId>
<artifactId>gradoop-parent</artifactId>
<version>0.4.2</version>
<version>0.4.3</version>
</parent>

<artifactId>gradoop-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class GradoopTestUtils {
public static final LocalDate DATE_VAL_b = LocalDate.now();
public static final LocalTime TIME_VAL_c = LocalTime.now();
public static final LocalDateTime DATETIME_VAL_d = LocalDateTime.now();
public static final short SHORT_VAL_e = (short)23;
public static final short SHORT_VAL_e = (short) 23;
public static final Set<PropertyValue> SET_VAL_f = new HashSet<>();

private static Comparator<EPGMIdentifiable> ID_COMPARATOR = new EPGMIdentifiableComparator();
Expand Down Expand Up @@ -200,8 +200,8 @@ public static void validateIdEquality(
Iterator<GradoopId> it1 = list1.iterator();
Iterator<GradoopId> it2 = list2.iterator();

while(it1.hasNext()) {
assertTrue("id mismatch", it1.next().equals(it2.next()));
while (it1.hasNext()) {
assertEquals("id mismatch", it1.next(), it2.next());
}
assertFalse("too many elements in first collection", it1.hasNext());
assertFalse("too many elements in second collection", it2.hasNext());
Expand All @@ -219,7 +219,7 @@ public static void validateIdInequality(

for (GradoopId id1 : collection1) {
for (GradoopId id2 : collection2) {
assertFalse("id in both collections", id1.equals(id2));
assertNotEquals("id in both collections", id1, id2);
}
}
}
Expand All @@ -236,8 +236,9 @@ public static void validateEPGMElementCollections(
Collection<? extends EPGMElement> collection2) {
assertNotNull("first collection was null", collection1);
assertNotNull("second collection was null", collection1);
assertTrue(String.format("collections of different size: %d and %d", collection1.size(),
collection2.size()), collection1.size() == collection2.size());
assertEquals(String.format(
"collections of different size: %d and %d", collection1.size(), collection2.size()),
collection1.size(), collection2.size());

List<? extends EPGMElement> list1 = Lists.newArrayList(collection1);
List<? extends EPGMElement> list2 = Lists.newArrayList(collection2);
Expand All @@ -248,7 +249,7 @@ public static void validateEPGMElementCollections(
Iterator<? extends EPGMElement> it1 = list1.iterator();
Iterator<? extends EPGMElement> it2 = list2.iterator();

while(it1.hasNext()) {
while (it1.hasNext()) {
validateEPGMElements(
it1.next(),
it2.next());
Expand Down Expand Up @@ -279,7 +280,7 @@ public static void validateEPGMGraphElementCollections(
Iterator<? extends EPGMGraphElement> it1 = list1.iterator();
Iterator<? extends EPGMGraphElement> it2 = list2.iterator();

while(it1.hasNext()) {
while (it1.hasNext()) {
validateEPGMGraphElements(it1.next(), it2.next());
}
assertFalse("too many elements in first collection", it1.hasNext());
Expand Down Expand Up @@ -420,7 +421,11 @@ public static <T1, T2> T1 call(Class<T2> clazz, T2 object, String methodName)
* @throws Exception in case anything goes wrong
*/
@SuppressWarnings("unchecked")
public static <T1, T2> T1 call(Class<T2> clazz, T2 object, String methodName, Class<?>[] parameterTypes, Object[] args)
public static <T1, T2> T1 call(
Class<T2> clazz,
T2 object,
String methodName,
Class<?>[] parameterTypes, Object[] args)
throws Exception {
Method m = parameterTypes != null ?
clazz.getDeclaredMethod(methodName, parameterTypes) : clazz.getDeclaredMethod(methodName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,9 @@ public void testFromString() {
GradoopId originalId = GradoopId.get();
GradoopId fromStringId = GradoopId.fromString(originalId.toString());

assertTrue(
"reconstruction from string failed",
originalId.equals(fromStringId)
);
assertEquals("reconstruction from string failed", originalId, fromStringId);
}

@Test
public void testGetRawBytes() {
GradoopId originalId = GradoopId.get();
Expand All @@ -88,22 +85,24 @@ public void testFromBytes() {

buffer.putInt(bsonId.getTimestamp());

byte b1,b2,b3;
byte b1;
byte b2;
byte b3;

int machineId = bsonId.getMachineIdentifier();
b3 = (byte)(machineId & 0xFF);
b2 = (byte)((machineId >> 8) & 0xFF);
b1 = (byte)((machineId >> 16) & 0xFF);
b3 = (byte) (machineId & 0xFF);
b2 = (byte) ((machineId >> 8) & 0xFF);
b1 = (byte) ((machineId >> 16) & 0xFF);
buffer.put(b1);
buffer.put(b2);
buffer.put(b3);

buffer.putShort(bsonId.getProcessIdentifier());

int counter = bsonId.getCounter();
b3 = (byte)(counter & 0xFF);
b2 = (byte)((counter >> 8) & 0xFF);
b1 = (byte)((counter >> 16) & 0xFF);
b3 = (byte) (counter & 0xFF);
b2 = (byte) ((counter >> 8) & 0xFF);
b1 = (byte) ((counter >> 16) & 0xFF);
buffer.put(b1);
buffer.put(b2);
buffer.put(b3);
Expand All @@ -112,4 +111,17 @@ public void testFromBytes() {

assertEquals(expectedId, newId);
}

/**
* Test the {@link GradoopId#min(GradoopId, GradoopId)} method.
*/
@Test
public void testMin() {
GradoopId first = GradoopId.get();
GradoopId second = GradoopId.get();
GradoopId min = GradoopId.min(first, second);
assertTrue("First ID is smaller then the minimum.", first.compareTo(min) >= 0);
assertTrue("Second ID is smaller then the minimum.", second.compareTo(min) >= 0);
assertTrue(first == min || second == min);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,17 @@
*/
package org.gradoop.common.model.impl.id;

import com.google.common.collect.Sets;
import org.apache.flink.core.memory.DataInputView;
import org.apache.flink.core.memory.DataInputViewStreamWrapper;
import org.apache.flink.core.memory.DataOutputView;
import org.apache.flink.core.memory.DataOutputViewStreamWrapper;
import org.junit.Test;

import com.google.common.collect.Sets;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;

import static org.hamcrest.core.Is.is;
Expand Down Expand Up @@ -107,7 +103,8 @@ public void testAddAllGradoopIds() throws Exception {
assertTrue(list2.contains(id2));

list2.addAll(list1);
assertThat(list2.size(), is(2)); }
assertThat(list2.size(), is(2));
}

@Test
public void testContainsAllCollection() throws Exception {
Expand Down Expand Up @@ -178,10 +175,9 @@ public void testContainsAny1() throws Exception {
@Test
public void testIsEmpty() throws Exception {
GradoopIdSet set1 = GradoopIdSet.fromExisting(GradoopId.get());
GradoopIdSet set2 = new GradoopIdSet();

assertFalse(set1.isEmpty());
assertTrue(set2.isEmpty());
assertTrue(new GradoopIdSet().isEmpty());
}

@Test
Expand Down Expand Up @@ -274,38 +270,38 @@ public void testFromExisting() {
}

@Test
public void testEquals(){
public void testEquals() {
GradoopId a = GradoopId.get();
GradoopId b = GradoopId.get();
GradoopId c = GradoopId.get();

GradoopIdSet abc = GradoopIdSet.fromExisting(a, b, c);
assertTrue("equals failed for same object", abc.equals(abc));
assertTrue("hashCode failed for same object", abc.hashCode() == abc.hashCode());
assertEquals("equals failed for same object", abc, abc);
assertEquals("hashCode failed for same object", abc.hashCode(), abc.hashCode());

GradoopIdSet abc2 = GradoopIdSet.fromExisting(a, b, c);
assertTrue("equals failed for same ids in same order", abc.equals(abc2));
assertTrue("hashCode failed for same ids in same order", abc.hashCode() == abc2.hashCode());
assertEquals("equals failed for same ids in same order", abc, abc2);
assertEquals("hashCode failed for same ids in same order", abc.hashCode(), abc2.hashCode());

GradoopIdSet cba = GradoopIdSet.fromExisting(c, b, a);
assertTrue("equals succeeds for same ids in different order", abc.equals(cba));
assertTrue("hashCode succeeds for same ids in different order", abc.hashCode() == cba.hashCode());
assertEquals("equals succeeds for same ids in different order", abc, cba);
assertEquals("hashCode succeeds for same ids in different order", abc.hashCode(), cba.hashCode());

GradoopIdSet aab = GradoopIdSet.fromExisting(a, a, b);
GradoopIdSet abb = GradoopIdSet.fromExisting(a, b, b);
assertTrue("equals succeeds for same ids in different cardinality", aab.equals(abb));
assertTrue("hashCode succeeds for same ids in different cardinality", aab.hashCode() == abb.hashCode());
assertEquals("equals succeeds for same ids in different cardinality", aab, abb);
assertEquals("hashCode succeeds for same ids in different cardinality", aab.hashCode(), abb.hashCode());

GradoopIdSet ab = GradoopIdSet.fromExisting(a, b);
assertTrue("equals succeeds for same ids but different sizes", aab.equals(ab));
assertTrue("hashCode succeeds for same ids but different sizes", aab.hashCode() == ab.hashCode());
assertEquals("equals succeeds for same ids but different sizes", aab, ab);
assertEquals("hashCode succeeds for same ids but different sizes", aab.hashCode(), ab.hashCode());

GradoopIdSet empty = new GradoopIdSet();
assertTrue("equals failed for one empty list", !abc.equals(empty));
assertTrue("hashCode failed for one empty list", abc.hashCode() != empty.hashCode());

GradoopIdSet empty2 = new GradoopIdSet();
assertTrue("equals failed for two empty lists", empty2.equals(empty));
assertTrue("hashCode failed two one empty lists", empty2.hashCode() == empty.hashCode());
assertEquals("equals failed for two empty lists", empty2, empty);
assertEquals("hashCode failed two one empty lists", empty2.hashCode(), empty.hashCode());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void createEdgePojoTest() {
assertThat(edge.getPropertyValue("k2").getString(), Is.<Object>is("v2"));
assertThat(edge.getGraphCount(), is(2));

for(GradoopId graphId : graphIds) {
for (GradoopId graphId : graphIds) {
assertTrue(edge.getGraphIds().contains(graphId));
}
}
Expand Down Expand Up @@ -110,4 +110,4 @@ public void createWithNullLabelTest() {
GradoopId targetId = GradoopId.get();
new EdgeFactory().initEdge(edgeId, null, sourceId, targetId);
}
}
}
Loading

0 comments on commit c5179c0

Please sign in to comment.