-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run test cases for persisted CQ storage + install depends on jar
- Loading branch information
codingchili
committed
Sep 5, 2017
1 parent
259cffb
commit 623e1cb
Showing
9 changed files
with
257 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,43 @@ | ||
task sourcesJar(type: Jar) { | ||
classifier 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
jar { | ||
from { | ||
(configurations.runtime).collect { | ||
it.isDirectory() ? it : zipTree(it) | ||
} | ||
} | ||
manifest { | ||
attributes 'Implementation-Title': 'chili-core', | ||
'Implementation-Version': version, | ||
'Main-Class': 'com.codingchili.core.Launcher' | ||
} | ||
} | ||
|
||
test { | ||
maxHeapSize = "512m" | ||
} | ||
|
||
dependencies { | ||
compile group: 'junit', name: 'junit', version: '4.12' | ||
compile group: 'io.vertx', name: 'vertx-core', version: '3.4.1' | ||
compile group: 'io.vertx', name: 'vertx-unit', version: '3.4.1' | ||
compile group: 'io.vertx', name: 'vertx-web', version: '3.4.1' | ||
compile group: 'io.vertx', name: 'vertx-hazelcast', version: '3.4.1' | ||
compile group: 'io.vertx', name: 'vertx-mongo-client', version: '3.4.1' | ||
compile group: 'io.vertx', name: 'vertx-dropwizard-metrics', version: '3.4.1' | ||
compile group: 'de.neuland-bfi', name: 'jade4j', version: '1.2.5' | ||
compile group: 'de.mkammerer', name: 'argon2-jvm', version: '2.2' | ||
compile group: 'org.fusesource.jansi', name: 'jansi', version: '1.14' | ||
|
||
// the following dependencies are about 25MB in size.. | ||
compile group: 'org.elasticsearch.client', name: 'transport', version: '5.3.0' | ||
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.6.2' | ||
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.6.2' | ||
|
||
compile group: 'com.googlecode.cqengine', name: 'cqengine', version: '2.9.3' | ||
} | ||
task sourcesJar(type: Jar) { | ||
classifier 'sources' | ||
from sourceSets.main.allSource | ||
} | ||
|
||
install.dependsOn jar | ||
|
||
jar { | ||
from { | ||
(configurations.runtime).collect { | ||
it.isDirectory() ? it : zipTree(it) | ||
} | ||
} | ||
manifest { | ||
attributes 'Implementation-Title': 'chili-core', | ||
'Implementation-Version': version, | ||
'Main-Class': 'com.codingchili.core.Launcher' | ||
} | ||
} | ||
|
||
test { | ||
maxHeapSize = "512m" | ||
} | ||
|
||
dependencies { | ||
compile group: 'junit', name: 'junit', version: '4.12' | ||
compile group: 'io.vertx', name: 'vertx-core', version: '3.4.2' | ||
compile group: 'io.vertx', name: 'vertx-unit', version: '3.4.2' | ||
compile group: 'io.vertx', name: 'vertx-web', version: '3.4.2' | ||
compile group: 'io.vertx', name: 'vertx-hazelcast', version: '3.4.2' | ||
compile group: 'io.vertx', name: 'vertx-mongo-client', version: '3.4.2' | ||
compile group: 'io.vertx', name: 'vertx-dropwizard-metrics', version: '3.4.2' | ||
compile group: 'de.neuland-bfi', name: 'jade4j', version: '1.2.5' | ||
compile group: 'de.mkammerer', name: 'argon2-jvm', version: '2.2' | ||
compile group: 'org.fusesource.jansi', name: 'jansi', version: '1.14' | ||
|
||
// the following dependencies are about 25MB in size.. | ||
compile group: 'org.elasticsearch.client', name: 'transport', version: '5.3.0' | ||
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.6.2' | ||
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.6.2' | ||
|
||
compile group: 'com.googlecode.cqengine', name: 'cqengine', version: '2.12.1' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
195 changes: 98 additions & 97 deletions
195
core/main/java/com/codingchili/core/testing/StorageObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,98 @@ | ||
package com.codingchili.core.testing; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.codingchili.core.storage.Storable; | ||
|
||
/** | ||
* @author Robin Duda | ||
* <p> | ||
* Test class to simulate a stored object. | ||
*/ | ||
public class StorageObject implements Storable { | ||
public static final String NESTED_PREFIX = "nested."; | ||
public static String levelField = "level"; | ||
private String name; | ||
private Integer level; | ||
private NestedObject nested; | ||
private List<String> keywords = new ArrayList<>(); | ||
|
||
public StorageObject() { | ||
keywords.add("Z"); | ||
} | ||
|
||
public StorageObject(String name, Integer level) { | ||
this(); | ||
this.name = name; | ||
this.level = level; | ||
this.nested = new NestedObject(NESTED_PREFIX + name); | ||
} | ||
|
||
public Integer getLevel() { | ||
return level; | ||
} | ||
|
||
public StorageObject setLevel(Integer level) { | ||
this.level = level; | ||
return this; | ||
} | ||
|
||
public String id() { | ||
return name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public StorageObject setName(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
public NestedObject getNested() { | ||
return nested; | ||
} | ||
|
||
public void setNested(NestedObject nested) { | ||
this.nested = nested; | ||
} | ||
|
||
public List<String> getKeywords() { | ||
return keywords; | ||
} | ||
|
||
public void setKeywords(List<String> keywords) { | ||
this.keywords = keywords; | ||
} | ||
|
||
public String toString() { | ||
return "name=" + name + " " + "level=" + level; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return name.hashCode(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
return compareTo(other) == 0; | ||
} | ||
|
||
@Override | ||
public int compareToAttribute(Storable other, String attribute) { | ||
StorageObject item = (StorageObject) other; | ||
|
||
switch (attribute) { | ||
case "level": | ||
return level.compareTo(item.getLevel()); | ||
case "nested.name": | ||
return nested.getName().compareTo(item.getNested().getName()); | ||
default: | ||
return 0; | ||
} | ||
} | ||
} | ||
package com.codingchili.core.testing; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.codingchili.core.storage.Storable; | ||
|
||
/** | ||
* @author Robin Duda | ||
* <p> | ||
* Test class to simulate a stored object. | ||
*/ | ||
public class StorageObject implements Storable { | ||
public static final String NESTED_PREFIX = "nested."; | ||
public static String levelField = "level"; | ||
private String name; | ||
private Integer level; | ||
private NestedObject nested; | ||
private List<String> keywords = new ArrayList<>(); | ||
|
||
public StorageObject() { | ||
keywords.add("Z"); | ||
} | ||
|
||
public StorageObject(String name, Integer level) { | ||
this(); | ||
this.name = name; | ||
this.level = level; | ||
this.nested = new NestedObject(NESTED_PREFIX + name); | ||
} | ||
|
||
public Integer getLevel() { | ||
return level; | ||
} | ||
|
||
public StorageObject setLevel(Integer level) { | ||
this.level = level; | ||
return this; | ||
} | ||
|
||
@Override | ||
public String id() { | ||
return name; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public StorageObject setName(String name) { | ||
this.name = name; | ||
return this; | ||
} | ||
|
||
public NestedObject getNested() { | ||
return nested; | ||
} | ||
|
||
public void setNested(NestedObject nested) { | ||
this.nested = nested; | ||
} | ||
|
||
public List<String> getKeywords() { | ||
return keywords; | ||
} | ||
|
||
public void setKeywords(List<String> keywords) { | ||
this.keywords = keywords; | ||
} | ||
|
||
public String toString() { | ||
return "name=" + name + " " + "level=" + level; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return name.hashCode(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other) { | ||
return compareTo(other) == 0; | ||
} | ||
|
||
@Override | ||
public int compareToAttribute(Storable other, String attribute) { | ||
StorageObject item = (StorageObject) other; | ||
|
||
switch (attribute) { | ||
case "level": | ||
return level.compareTo(item.getLevel()); | ||
case "nested.name": | ||
return nested.getName().compareTo(item.getNested().getName()); | ||
default: | ||
return 0; | ||
} | ||
} | ||
} |
Oops, something went wrong.