File tree 9 files changed +232
-0
lines changed
hibernate-reactive-core/src/test/java/org/hibernate/reactive/annotations/tests
9 files changed +232
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .annotations .tests ;
7
+
8
+
9
+ import org .hibernate .reactive .annotations .DisableFor ;
10
+ import org .hibernate .reactive .containers .DatabaseConfiguration ;
11
+
12
+ import org .junit .jupiter .api .Test ;
13
+
14
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .POSTGRESQL ;
15
+ import static org .junit .jupiter .api .Assertions .assertNotEquals ;
16
+
17
+ @ DisableFor (value = POSTGRESQL , reason = "some reason" )
18
+ public class DisableForClassTest {
19
+
20
+ @ Test
21
+ public void test () {
22
+ // Throw exception if this test is run with POSTGRESQL database
23
+ assertNotEquals ( POSTGRESQL , DatabaseConfiguration .dbType () );
24
+ }
25
+ }
Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .annotations .tests ;
7
+
8
+ import org .hibernate .reactive .annotations .DisableFor ;
9
+ import org .hibernate .reactive .containers .DatabaseConfiguration ;
10
+
11
+ import org .junit .jupiter .api .Test ;
12
+
13
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .POSTGRESQL ;
14
+ import static org .junit .jupiter .api .Assertions .assertNotEquals ;
15
+
16
+ public class DisableForMethodTest {
17
+
18
+ @ Test
19
+ @ DisableFor (value = POSTGRESQL , reason = "some reason" )
20
+ public void test () {
21
+ // Throw exception if this test is run with POSTGRESQL database
22
+ assertNotEquals ( POSTGRESQL , DatabaseConfiguration .dbType () );
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .annotations .tests ;
7
+
8
+ import org .hibernate .reactive .annotations .DisableFor ;
9
+
10
+ import org .junit .jupiter .api .Test ;
11
+
12
+ import static org .assertj .core .api .Assertions .assertThat ;
13
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .MYSQL ;
14
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .POSTGRESQL ;
15
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .dbType ;
16
+
17
+ @ DisableFor (value = MYSQL , reason = "some reason" )
18
+ @ DisableFor (value = POSTGRESQL , reason = "some reason" )
19
+ public class DisableForMultipleClassTest {
20
+
21
+ @ Test
22
+ public void test () {
23
+ // Throw exception if this test is run with POSTGRESQL or MYSQL database
24
+ assertThat ( dbType () ).isNotIn ( MYSQL , POSTGRESQL );
25
+ }
26
+ }
Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .annotations .tests ;
7
+
8
+
9
+ import org .hibernate .reactive .annotations .DisableFor ;
10
+ import org .hibernate .reactive .containers .DatabaseConfiguration ;
11
+
12
+ import org .junit .jupiter .api .Test ;
13
+
14
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .MYSQL ;
15
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .POSTGRESQL ;
16
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
17
+
18
+ public class DisableForMultipleMethodTest {
19
+
20
+ @ Test
21
+ @ DisableFor (value = MYSQL , reason = "some reason" )
22
+ @ DisableFor (value = POSTGRESQL , reason = "some reason" )
23
+ public void test () {
24
+ // Throw exception if this test is run with POSTGRESQL or MYSQL database
25
+ assertTrue ( DatabaseConfiguration .dbType () != POSTGRESQL &&
26
+ DatabaseConfiguration .dbType () != MYSQL );
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .annotations .tests ;
7
+
8
+ import org .hibernate .reactive .annotations .EnableFor ;
9
+ import org .hibernate .reactive .containers .DatabaseConfiguration ;
10
+
11
+ import org .junit .jupiter .api .Test ;
12
+
13
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .POSTGRESQL ;
14
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
15
+
16
+ @ EnableFor (value = POSTGRESQL )
17
+ public class EnableForClassTest {
18
+
19
+ @ Test
20
+ public void test () {
21
+ // Throw exception if this test is database is NOT POSTGRESQL
22
+ assertEquals ( POSTGRESQL , DatabaseConfiguration .dbType () );
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .annotations .tests ;
7
+
8
+ import org .hibernate .reactive .annotations .EnableFor ;
9
+ import org .hibernate .reactive .annotations .EnableForGroup ;
10
+
11
+ import org .junit .jupiter .api .Test ;
12
+
13
+ import static org .assertj .core .api .Assertions .assertThat ;
14
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .MYSQL ;
15
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .POSTGRESQL ;
16
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .dbType ;
17
+
18
+ @ EnableForGroup ({
19
+ @ EnableFor (value = MYSQL ),
20
+ @ EnableFor (value = POSTGRESQL )
21
+ })
22
+ public class EnableForGroupClassTest {
23
+
24
+ @ Test
25
+ public void test () {
26
+ // Throw exception if this test is run with POSTGRESQL or MYSQL database
27
+ assertThat ( dbType () ).isIn ( MYSQL , POSTGRESQL );
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .annotations .tests ;
7
+
8
+ import org .hibernate .reactive .annotations .EnableFor ;
9
+ import org .hibernate .reactive .containers .DatabaseConfiguration ;
10
+
11
+ import org .junit .jupiter .api .Test ;
12
+
13
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .POSTGRESQL ;
14
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
15
+
16
+ public class EnableForMethodTest {
17
+
18
+ @ Test
19
+ @ EnableFor (value = POSTGRESQL )
20
+ public void test () {
21
+ // Throw exception if this test is database is NOT POSTGRESQL
22
+ assertEquals ( POSTGRESQL , DatabaseConfiguration .dbType () );
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .annotations .tests ;
7
+
8
+ import org .hibernate .reactive .annotations .EnableFor ;
9
+
10
+ import org .junit .jupiter .api .Test ;
11
+
12
+ import static org .assertj .core .api .Assertions .assertThat ;
13
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .MYSQL ;
14
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .POSTGRESQL ;
15
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .dbType ;
16
+
17
+ @ EnableFor (value = MYSQL )
18
+ @ EnableFor (value = POSTGRESQL )
19
+ public class EnableForMultipleClassTest {
20
+
21
+ @ Test
22
+ public void test () {
23
+ // Throw exception if this test is run with POSTGRESQL or MYSQL database
24
+ assertThat ( dbType () ).isIn ( MYSQL , POSTGRESQL );
25
+ }
26
+ }
Original file line number Diff line number Diff line change
1
+ /* Hibernate, Relational Persistence for Idiomatic Java
2
+ *
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ * Copyright: Red Hat Inc. and Hibernate Authors
5
+ */
6
+ package org .hibernate .reactive .annotations .tests ;
7
+
8
+ import org .hibernate .reactive .annotations .EnableFor ;
9
+
10
+ import org .junit .jupiter .api .Test ;
11
+
12
+ import static org .assertj .core .api .Assertions .assertThat ;
13
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .MYSQL ;
14
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .DBType .POSTGRESQL ;
15
+ import static org .hibernate .reactive .containers .DatabaseConfiguration .dbType ;
16
+
17
+ public class EnableForMultipleMethodTest {
18
+
19
+ @ Test
20
+ @ EnableFor (value = MYSQL )
21
+ @ EnableFor (value = POSTGRESQL )
22
+ public void test () {
23
+ // Throw exception if this test is run with POSTGRESQL or MYSQL database
24
+ assertThat ( dbType () ).isIn ( MYSQL , POSTGRESQL );
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments