-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
697 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
radiant/devs-codegen/src/test/java/pro/fessional/wings/devs/init/AutogenTestCodeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package pro.fessional.wings.devs.init; | ||
|
||
import lombok.Setter; | ||
import org.junit.jupiter.api.MethodOrderer; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.TestMethodOrder; | ||
import org.junit.jupiter.api.condition.EnabledIfSystemProperty; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import pro.fessional.wings.faceless.codegen.ConstantEnumGenerator; | ||
import pro.fessional.wings.faceless.codegen.ConstantEnumJdbcLoader; | ||
import pro.fessional.wings.faceless.codegen.JdbcDataLoadHelper; | ||
import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; | ||
import pro.fessional.wings.faceless.project.ProjectEnumGenerator; | ||
import pro.fessional.wings.faceless.project.ProjectJooqGenerator; | ||
import pro.fessional.wings.warlock.project.Warlock2EnumGenerator; | ||
import pro.fessional.wings.warlock.project.Warlock3JooqGenerator; | ||
import pro.fessional.wings.warlock.project.Warlock4AuthGenerator; | ||
|
||
import javax.sql.DataSource; | ||
import java.util.List; | ||
|
||
/** | ||
* @author trydofor | ||
* @since 2023-01-23 | ||
*/ | ||
@SpringBootTest(properties = "testing.dbname=wings_faceless") | ||
@EnabledIfSystemProperty(named = "devs-autogen", matches = "true") | ||
@TestMethodOrder(MethodOrderer.MethodName.class) | ||
public class AutogenTestCodeTest { | ||
@Setter(onMethod_ = {@Autowired}) | ||
private DataSource dataSource; | ||
@Setter(onMethod_ = {@Value("${spring.datasource.url}")}) | ||
private String jdbcUrl; | ||
@Setter(onMethod_ = {@Value("${spring.datasource.username}")}) | ||
private String jdbcUser; | ||
@Setter(onMethod_ = {@Value("${spring.datasource.password}")}) | ||
private String jdbcPass; | ||
|
||
private final String projectRoot = "../../"; | ||
|
||
@Test | ||
void autogen01AllTestJooq() { | ||
// use wings_faceless database | ||
autogen11FacelessJooqTest(); // faceless-jooq | ||
autogen11FacelessShardTest(); // faceless-shard | ||
} | ||
|
||
|
||
// ////////////////// individual test ////////////////// | ||
|
||
void autogen11FacelessJooqTest() { | ||
Warlock3JooqGenerator generator = new Warlock3JooqGenerator(); | ||
generator.setTargetDir(projectRoot + "wings/faceless-jooq/src/test/java/"); | ||
generator.setTargetPkg("pro.fessional.wings.faceless.app.database.autogen"); | ||
generator.gen(jdbcUrl, jdbcUser, jdbcPass, | ||
h -> h.databaseIncludes("sys_constant_enum", "sys_standard_i18n", "tst_sharding", "tst_normal_table") | ||
.forcedIntConsEnum(StandardLanguage.class, "tst_sharding.language") | ||
.forcedIntConsEnum(StandardLanguage.class, "tst_normal_table.value_lang") | ||
); | ||
} | ||
|
||
void autogen11FacelessShardTest() { | ||
Warlock3JooqGenerator generator = new Warlock3JooqGenerator(); | ||
generator.setTargetDir(projectRoot + "wings/faceless-shard/src/test/java/"); | ||
generator.setTargetPkg("pro.fessional.wings.faceless.app.database.autogen"); | ||
generator.gen(jdbcUrl, jdbcUser, jdbcPass, | ||
h -> h.databaseIncludes("tst_sharding", "tst_normal_table")); | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
...in/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/WinTaskDefineTable.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
22 changes: 11 additions & 11 deletions
22
...in/java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/WinTaskResultTable.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
56 changes: 28 additions & 28 deletions
56
...java-gen/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskDefineDao.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.