Skip to content

Commit

Permalink
bump to release version 2.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
evanchooly committed May 18, 2022
1 parent f69a53a commit 360d5b6
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>dev.morphia.morphia</groupId>
<artifactId>morphia</artifactId>
<version>2.2.7-SNAPSHOT</version>
<version>2.2.7</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.morphia.morphia</groupId>
<artifactId>morphia</artifactId>
<version>2.2.7-SNAPSHOT</version>
<version>2.2.7</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
import dev.morphia.annotations.Entity;
import dev.morphia.annotations.Id;
import dev.morphia.query.FindOptions;
import dev.morphia.query.experimental.filters.Filters;
import dev.morphia.test.TestBase;
import org.bson.types.ObjectId;
import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotSame;

public class InstanceCreationTest extends TestBase {
@Test
Expand All @@ -20,6 +27,27 @@ public void basicReference() {
assertEquals(author, loaded);
}

@Test
public void duplicates() {
SaveData toSave = new SaveData("id", new double[]{1,2,3}, List.of(
new SaveData.ChildData(new double[]{4,5,6}, new ArrayList<>()),
new SaveData.ChildData(new double[]{7,8,9}, new ArrayList<>()),
new SaveData.ChildData(new double[]{10,11,12}, new ArrayList<>())));
getDs().save(toSave);

SaveData loadedData = getDs().find(SaveData.class).first();

// Make sure the child objects are not the same
assertNotSame(loadedData.elements.get(0), loadedData.elements.get(1));
assertNotSame(loadedData.elements.get(0), loadedData.elements.get(2));
assertNotSame(loadedData.elements.get(1), loadedData.elements.get(2));

// Make sure the child position arrays are not the same
assertFalse(Arrays.equals(loadedData.elements.get(0).child_position, loadedData.elements.get(1).child_position));
assertFalse(Arrays.equals(loadedData.elements.get(0).child_position, loadedData.elements.get(2).child_position));
assertFalse(Arrays.equals(loadedData.elements.get(1).child_position, loadedData.elements.get(2).child_position));
}

@Entity
private static class Author extends BaseEntity {

Expand Down Expand Up @@ -63,4 +91,46 @@ public ObjectId getId() {
return id;
}
}

@Entity("saved_stuff")
public static class SaveData {
@Id
public final String saveName;
public final double[] position;
public final List<ChildData> elements;

public SaveData(String saveName, double[] position, List<ChildData> elements) {
this.saveName = saveName;
this.position = position;
this.elements = elements;
}

@Override
public String toString() {
return "SaveData{" +
"saveName='" + saveName + '\'' +
", position=" + Arrays.toString(position) +
", elements=" + elements +
'}';
}

@Entity
public static class ChildData {
public final double[] child_position;
public final List<ChildData> child_elements;

public ChildData(double[] child_position, List<ChildData> child_elements) {
this.child_position = child_position;
this.child_elements = child_elements;
}

@Override
public String toString() {
return "\nChildData{" +
"child_position=" + Arrays.toString(child_position) +
", child_elements=" + child_elements +
'}';
}
}
}
}
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>dev.morphia.morphia</groupId>
<artifactId>morphia</artifactId>
<version>2.2.7-SNAPSHOT</version>
<version>2.2.7</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.morphia.morphia</groupId>
<artifactId>morphia</artifactId>
<version>2.2.7-SNAPSHOT</version>
<version>2.2.7</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>dev.morphia.morphia</groupId>
<artifactId>morphia</artifactId>
<version>2.2.7-SNAPSHOT</version>
<version>2.2.7</version>
<packaging>pom</packaging>

<name>Morphia</name>
Expand Down
2 changes: 1 addition & 1 deletion util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>dev.morphia.morphia</groupId>
<artifactId>morphia</artifactId>
<version>2.2.7-SNAPSHOT</version>
<version>2.2.7</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down

0 comments on commit 360d5b6

Please sign in to comment.