Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#585 Exp on relationship IDs #586

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Adjust tests to current EntityPathCache behaviour
  • Loading branch information
m-dzianishchyts committed Feb 4, 2024
commit 6af4335f58fbd2e7d3f36ba9cbe750a2122d85ee
Original file line number Diff line number Diff line change
@@ -66,11 +66,22 @@ public void getOrCreate_Id() {
PathDescriptor pd = cache.getOrCreate("id");
assertNotNull(pd);
assertTrue(pd.isAttributeOrId());
assertEquals("java.lang.Integer", pd.getType());
assertEquals("id", pd.getPathExp().getPath());
assertEquals("java.lang.String", pd.getType());
assertEquals("pkx1", pd.getPathExp().getPath());
assertSame(pd, cache.getOrCreate("id"));
}

@Test
public void getOrCreate_RelatedId() {
EntityPathCache cache = new EntityPathCache(x);
PathDescriptor pd = cache.getOrCreate("y.db:pk1");
assertNotNull(pd);
assertTrue(pd.isAttributeOrId());
assertEquals("java.lang.Integer", pd.getType());
assertEquals("pk1", pd.getPathExp().getPath());
assertSame(pd, cache.getOrCreate("y.db:pk1"));
}

@Test
public void getOrCreate_Relationship() {
EntityPathCache cache = new EntityPathCache(x);
@@ -93,17 +104,6 @@ public void getOrCreate_RelatedAttribute() {
assertSame(pd, cache.getOrCreate("y.name"));
}

@Test
public void getOrCreate_RelatedId() {
EntityPathCache cache = new EntityPathCache(x);
PathDescriptor pd = cache.getOrCreate("y.id");
assertNotNull(pd);
assertTrue(pd.isAttributeOrId());
assertEquals("java.lang.Integer", pd.getType());
assertEquals("y.id", pd.getPathExp().getPath());
assertSame(pd, cache.getOrCreate("y.id"));
}

@Test
public void getOrCreate_BadPath() {
EntityPathCache cache = new EntityPathCache(x);
Loading