Skip to content

Commit

Permalink
Move native test from infra module to test module
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Nov 21, 2023
1 parent 170ee43 commit 8974c14
Show file tree
Hide file tree
Showing 21 changed files with 66 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ ShardingSphere 定义了 `generateMetadata` 的 Maven Profile 用于在 GraalVM
Reachability Metadata 位于 `shardingsphere-infra-reachability-metadata` 子模块下。

对于测试类和测试文件独立使用的 GraalVM Reachability Metadata,贡献者应该放置到
`${user.dir}/infra/nativetest/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/`
`${user.dir}/test/natived/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/`
文件夹下。`${}` 内为相关子模块对应的 POM 4.0 的常规系统变量,自行替换。

```bash
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@
<version>${maven-surefire-plugin.version}</version>
<configuration>
<includes>
<include>org.apache.shardingsphere.infra.nativetest.**</include>
<include>org.apache.shardingsphere.test.natived.**</include>
</includes>
</configuration>
</plugin>
Expand All @@ -1041,8 +1041,8 @@
<defaultMode>Conditional</defaultMode>
<modes>
<conditional>
<userCodeFilterPath>${user.dir}/infra/nativetest/native-image-filter/user-code-filter.json</userCodeFilterPath>
<extraFilterPath>${user.dir}/infra/nativetest/native-image-filter/extra-filter.json</extraFilterPath>
<userCodeFilterPath>${user.dir}/test/natived/native-image-filter/user-code-filter.json</userCodeFilterPath>
<extraFilterPath>${user.dir}/test/natived/native-image-filter/extra-filter.json</extraFilterPath>
<parallel>true</parallel>
</conditional>
</modes>
Expand Down Expand Up @@ -1088,7 +1088,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>org.apache.shardingsphere.infra.nativetest.**</include>
<include>org.apache.shardingsphere.test.natived.**</include>
</includes>
</configuration>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion test/native/native-image-filter/extra-filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{"excludeClasses": "org.locationtech.jts.geom.**"},
{"excludeClasses": "org.slf4j.event.**"},

{"excludeClasses": "org.apache.shardingsphere.infra.nativetest.**"}
{"excludeClasses": "org.apache.shardingsphere.test.natived.**"}
],
"regexRules": [
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest;
package org.apache.shardingsphere.test.natived;

import java.io.BufferedReader;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features;
package org.apache.shardingsphere.test.natived.features;

import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
import org.apache.shardingsphere.infra.nativetest.FileTestUtils;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Address;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Order;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.OrderItem;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.AddressRepository;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.OrderItemRepository;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.OrderRepository;
import org.apache.shardingsphere.test.natived.FileTestUtils;
import org.apache.shardingsphere.test.natived.features.entity.Address;
import org.apache.shardingsphere.test.natived.features.entity.Order;
import org.apache.shardingsphere.test.natived.features.entity.OrderItem;
import org.apache.shardingsphere.test.natived.features.repository.AddressRepository;
import org.apache.shardingsphere.test.natived.features.repository.OrderItemRepository;
import org.apache.shardingsphere.test.natived.features.repository.OrderRepository;
import org.junit.jupiter.api.Test;

import javax.sql.DataSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features;
package org.apache.shardingsphere.test.natived.features;

import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
import org.apache.shardingsphere.infra.nativetest.FileTestUtils;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Address;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Order;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.OrderItem;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.AddressRepository;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.OrderItemRepository;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.OrderRepository;
import org.apache.shardingsphere.test.natived.FileTestUtils;
import org.apache.shardingsphere.test.natived.features.entity.Address;
import org.apache.shardingsphere.test.natived.features.entity.Order;
import org.apache.shardingsphere.test.natived.features.entity.OrderItem;
import org.apache.shardingsphere.test.natived.features.repository.AddressRepository;
import org.apache.shardingsphere.test.natived.features.repository.OrderItemRepository;
import org.apache.shardingsphere.test.natived.features.repository.OrderRepository;
import org.junit.jupiter.api.Test;

import javax.sql.DataSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features;
package org.apache.shardingsphere.test.natived.features;

import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
import org.apache.shardingsphere.infra.nativetest.FileTestUtils;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Address;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Order;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.OrderItem;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.AddressRepository;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.OrderItemRepository;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.OrderRepository;
import org.apache.shardingsphere.test.natived.FileTestUtils;
import org.apache.shardingsphere.test.natived.features.entity.Address;
import org.apache.shardingsphere.test.natived.features.entity.Order;
import org.apache.shardingsphere.test.natived.features.entity.OrderItem;
import org.apache.shardingsphere.test.natived.features.repository.AddressRepository;
import org.apache.shardingsphere.test.natived.features.repository.OrderItemRepository;
import org.apache.shardingsphere.test.natived.features.repository.OrderRepository;
import org.h2.jdbc.JdbcSQLSyntaxErrorException;
import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features;
package org.apache.shardingsphere.test.natived.features;

import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
import org.apache.shardingsphere.infra.nativetest.FileTestUtils;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Address;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Order;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.OrderItem;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.AddressRepository;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.OrderItemRepository;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.OrderRepository;
import org.apache.shardingsphere.test.natived.FileTestUtils;
import org.apache.shardingsphere.test.natived.features.entity.Address;
import org.apache.shardingsphere.test.natived.features.entity.Order;
import org.apache.shardingsphere.test.natived.features.entity.OrderItem;
import org.apache.shardingsphere.test.natived.features.repository.AddressRepository;
import org.apache.shardingsphere.test.natived.features.repository.OrderItemRepository;
import org.apache.shardingsphere.test.natived.features.repository.OrderRepository;
import org.junit.jupiter.api.Test;

import javax.sql.DataSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features;
package org.apache.shardingsphere.test.natived.features;

import org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory;
import org.apache.shardingsphere.infra.nativetest.FileTestUtils;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Address;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Order;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.OrderItem;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.AddressRepository;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.OrderItemRepository;
import org.apache.shardingsphere.infra.nativetest.jdbc.features.repository.OrderRepository;
import org.apache.shardingsphere.test.natived.FileTestUtils;
import org.apache.shardingsphere.test.natived.features.entity.Address;
import org.apache.shardingsphere.test.natived.features.entity.Order;
import org.apache.shardingsphere.test.natived.features.entity.OrderItem;
import org.apache.shardingsphere.test.natived.features.repository.AddressRepository;
import org.apache.shardingsphere.test.natived.features.repository.OrderItemRepository;
import org.apache.shardingsphere.test.natived.features.repository.OrderRepository;
import org.junit.jupiter.api.Test;

import javax.sql.DataSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features.algorithm;
package org.apache.shardingsphere.test.natived.features.algorithm;

import org.apache.shardingsphere.sharding.api.sharding.standard.PreciseShardingValue;
import org.apache.shardingsphere.sharding.api.sharding.standard.RangeShardingValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features.algorithm;
package org.apache.shardingsphere.test.natived.features.algorithm;

import lombok.Getter;
import org.apache.shardingsphere.encrypt.api.context.EncryptContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features.entity;
package org.apache.shardingsphere.test.natived.features.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features.entity;
package org.apache.shardingsphere.test.natived.features.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features.entity;
package org.apache.shardingsphere.test.natived.features.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features.repository;
package org.apache.shardingsphere.test.natived.features.repository;

import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Address;
import org.apache.shardingsphere.test.natived.features.entity.Address;

import javax.sql.DataSource;
import java.sql.Connection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features.repository;
package org.apache.shardingsphere.test.natived.features.repository;

import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.OrderItem;
import org.apache.shardingsphere.test.natived.features.entity.OrderItem;

import javax.sql.DataSource;
import java.sql.Connection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

package org.apache.shardingsphere.infra.nativetest.jdbc.features.repository;
package org.apache.shardingsphere.test.natived.features.repository;

import org.apache.shardingsphere.infra.nativetest.jdbc.features.entity.Order;
import org.apache.shardingsphere.test.natived.features.entity.Order;

import javax.sql.DataSource;
import java.sql.Connection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"condition":{"typeReachable":"org.apache.shardingsphere.sharding.algorithm.sharding.classbased.ClassBasedShardingAlgorithmFactory"},
"name":"org.apache.shardingsphere.infra.nativetest.jdbc.features.algorithm.ClassBasedInlineShardingAlgorithmFixture",
"name":"org.apache.shardingsphere.test.natived.jdbc.features.algorithm.ClassBasedInlineShardingAlgorithmFixture",
"methods":[{"name":"<init>","parameterTypes":[] }]
}
]
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"resources":{
"includes":[{
"condition":{"typeReachable":"org.apache.shardingsphere.infra.nativetest.jdbc.features.EncryptTest"},
"condition":{"typeReachable":"org.apache.shardingsphere.test.natived.jdbc.features.EncryptTest"},
"pattern":"\\Qyaml/encrypt.yaml\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.nativetest.jdbc.features.MaskTest"},
"condition":{"typeReachable":"org.apache.shardingsphere.test.natived.jdbc.features.MaskTest"},
"pattern":"\\Qyaml/mask.yaml\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.nativetest.jdbc.features.ReadWriteSplittingTest"},
"condition":{"typeReachable":"org.apache.shardingsphere.test.natived.jdbc.features.ReadWriteSplittingTest"},
"pattern":"\\Qyaml/readwrite-splitting.yaml\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.nativetest.jdbc.features.ShadowTest"},
"condition":{"typeReachable":"org.apache.shardingsphere.test.natived.jdbc.features.ShadowTest"},
"pattern":"\\Qyaml/shadow.yaml\\E"
}, {
"condition":{"typeReachable":"org.apache.shardingsphere.infra.nativetest.jdbc.features.ShardingTest"},
"condition":{"typeReachable":"org.apache.shardingsphere.test.natived.jdbc.features.ShardingTest"},
"pattern":"\\Qyaml/sharding.yaml\\E"
}
]},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# limitations under the License.
#

org.apache.shardingsphere.infra.nativetest.jdbc.features.algorithm.TestQueryAssistedShardingEncryptAlgorithm
org.apache.shardingsphere.test.natived.features.algorithm.TestQueryAssistedShardingEncryptAlgorithm
2 changes: 1 addition & 1 deletion test/native/src/test/resources/yaml/sharding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ rules:
type: CLASS_BASED
props:
strategy: STANDARD
algorithmClassName: org.apache.shardingsphere.infra.nativetest.jdbc.features.algorithm.ClassBasedInlineShardingAlgorithmFixture
algorithmClassName: org.apache.shardingsphere.test.natived.jdbc.features.algorithm.ClassBasedInlineShardingAlgorithmFixture
keyGenerators:
snowflake:
type: SNOWFLAKE
Expand Down

0 comments on commit 8974c14

Please sign in to comment.