Skip to content

Commit

Permalink
Merge pull request #315 from CorvusYe/master
Browse files Browse the repository at this point in the history
ci: fix style check and [install nebula-graph]
  • Loading branch information
CorvusYe authored Aug 26, 2024
2 parents 25914ed + 0c47b76 commit 4f6dba5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ jobs:
git clone https://github.com/vesoft-inc/nebula-docker-compose.git
pushd nebula-docker-compose/
cp ../../src/test/resources/docker-compose.yaml .
docker-compose up -d
docker compose up -d
sleep 30
docker-compose ps
docker compose ps
popd
popd
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
git clone https://github.com/vesoft-inc/nebula-docker-compose.git
pushd nebula-docker-compose/
cp ../../src/test/resources/docker-compose.yaml .
docker-compose up -d
docker compose up -d
sleep 30
docker-compose ps
docker compose ps
popd
popd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ public static Class<?> fieldType(Object o, String fieldName) {
* @return paramType 是否为 parentType 子类或实现类
*/
public static boolean isCurrentTypeOrParentType(Class<?> paramType, Class<?> parentType) {
if (paramType == null) return false;
if (parentType == null) return false;
if (paramType == null || parentType == null) {
return false;
}
if (paramType == parentType) {
return true;
}
Expand Down
54 changes: 32 additions & 22 deletions src/test/java/org/nebula/contrib/ngbatis/utils/ReflectUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public void testIsCurrentTypeOrParentType() {
@Test
public void testFindLeafClass() {
Set<Class<?>> classes = new HashSet<Class<?>>() {{
add(A.class);
add(E.class);
add(F.class);
add(G.class);
}};
add(A.class);
add(E.class);
add(F.class);
add(G.class);
}};
Class<?> leafType = ReflectUtil.findNoForkLeafClass(classes, C.class);
Assertions.assertEquals(D.class, leafType);

Expand All @@ -42,27 +42,37 @@ public void testFindLeafClass() {
leafType = ReflectUtil.findNoForkLeafClass(classes, B.class);
Assertions.assertEquals(B.class, leafType);
}
}

/*
* - A
* - B
* - C
* - D
* - F
* - G
* - E
*/
class A {}

class B extends A {}
/*
* - A
* - B
* - C
* - D
* - F
* - G
* - E
*/
static class A {

}

class C extends B {}
static class B extends A {
}

class D extends C {}
static class C extends B {
}

class F extends D {}
static class D extends C {
}

class G extends D {}
static class F extends D {
}

static class G extends D {
}

static class E extends B {
}
}

class E extends B {}

0 comments on commit 4f6dba5

Please sign in to comment.