generated from konveyor/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
- Loading branch information
Showing
8 changed files
with
4,021 additions
and
0 deletions.
There are no files selected for viewing
3,748 changes: 3,748 additions & 0 deletions
3,748
default/generated/spring-boot/spring-boot-2.x-to-3.0-removals.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
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,76 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.example</groupId> | ||
<artifactId>spring-boot-2-7-example</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>Spring Boot 2.7.18 Example</name> | ||
<description>Example Spring Boot 2.7.18 project</description> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.7.18</version> | ||
<relativePath/> <!-- Lookup parent from Maven repository --> | ||
</parent> | ||
|
||
<properties> | ||
<java.version>11</java.version> <!-- Set Java version (11 or later for Spring Boot 2.7.x) --> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- Spring Boot Starter Web for building RESTful APIs --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
|
||
<!-- Spring Boot Starter Data JPA for database access --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-jpa</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-dbcp2</artifactId> | ||
<version>2.9.0</version> <!-- Use the latest version if needed --> | ||
</dependency> | ||
|
||
<!-- Uncomment if using MySQL instead --> | ||
<!-- | ||
<dependency> | ||
<groupId>mysql</groupId> | ||
<artifactId>mysql-connector-java</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
--> | ||
|
||
<!-- Spring Boot Starter Test for unit and integration tests --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- Lombok for reducing boilerplate code --> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
17 changes: 17 additions & 0 deletions
17
.../spring-boot/tests/data/removals/src/main/java/org/konveyor/deps/BootDepsApplication.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,17 @@ | ||
package org.konveyor.deps; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.context.config.ConfigFileApplicationListener; | ||
|
||
@SpringBootApplication | ||
public class BootDepsApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(BootDepsApplication.class, args); | ||
} | ||
|
||
public void method() { | ||
ConfigFileApplicationListener configFileApplicationListener = new ConfigFileApplicationListener(); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...boot/tests/data/removals/src/main/java/org/konveyor/deps/CustomDataSourceInitializer.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,45 @@ | ||
package org.konveyor.deps; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.jdbc.AbstractDataSourceInitializer; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.boot.jdbc.DataSourceInitializationMode; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.core.io.ResourceLoader; | ||
import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator; | ||
|
||
import javax.sql.DataSource; | ||
|
||
@Configuration | ||
@ConfigurationProperties(prefix = "spring.datasource") | ||
public class CustomDataSourceInitializer extends AbstractDataSourceInitializer { | ||
|
||
private ResourceLoader resourceLoader; | ||
|
||
@Autowired | ||
public CustomDataSourceInitializer(DataSource dataSource, ResourceLoader resourceLoader) { | ||
super(dataSource, resourceLoader); | ||
this.resourceLoader = resourceLoader; | ||
} | ||
|
||
@Override | ||
protected void customize(ResourceDatabasePopulator populator) { | ||
populator.addScript(resourceLoader.getResource("schema.sql")); | ||
} | ||
|
||
@Override | ||
protected DataSourceInitializationMode getMode() { | ||
return null; | ||
} | ||
|
||
@Override | ||
protected String getSchemaLocation() { | ||
return null; | ||
} | ||
|
||
@Override | ||
protected String getDatabaseName() { | ||
// Return the database name for which this initializer applies | ||
return "H2"; // Adjust based on your database type | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
...ted/spring-boot/tests/data/removals/src/main/java/org/konveyor/deps/DataSourceConfig.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,72 @@ | ||
package org.konveyor.deps; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.autoconfigure.batch.BatchDataSourceInitializer; | ||
import org.springframework.boot.autoconfigure.batch.BatchProperties; | ||
import org.springframework.boot.autoconfigure.integration.IntegrationDataSourceInitializer; | ||
import org.springframework.boot.autoconfigure.integration.IntegrationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.beans.factory.annotation.Value; | ||
|
||
import javax.sql.DataSource; | ||
|
||
import org.apache.commons.dbcp2.BasicDataSource; | ||
import org.springframework.core.io.ResourceLoader; | ||
|
||
@Configuration | ||
public class DataSourceConfig { | ||
|
||
@Value("${spring.datasource.url}") | ||
private String url; | ||
|
||
@Value("${spring.datasource.username}") | ||
private String username; | ||
|
||
@Value("${spring.datasource.password}") | ||
private String password; | ||
|
||
@Value("${spring.datasource.driver-class-name:org.h2.Driver}") | ||
private String driverClassName; | ||
|
||
@Value("${spring.datasource.initial-size:10}") | ||
private int initialSize; | ||
|
||
@Value("${spring.datasource.max-total:50}") | ||
private int maxTotal; | ||
|
||
@Bean | ||
public DataSource dataSource() { | ||
BasicDataSource dataSource = new BasicDataSource(); | ||
dataSource.setUrl(url); | ||
dataSource.setUsername(username); | ||
dataSource.setPassword(password); | ||
dataSource.setDriverClassName(driverClassName); | ||
dataSource.setInitialSize(initialSize); | ||
dataSource.setMaxTotal(maxTotal); | ||
return dataSource; | ||
} | ||
|
||
@Bean | ||
public BatchProperties batchProperties() { | ||
return new BatchProperties(); | ||
} | ||
|
||
@Bean | ||
public IntegrationProperties integrationProperties() { | ||
return new IntegrationProperties(); | ||
} | ||
|
||
@Bean | ||
@Autowired | ||
public BatchDataSourceInitializer batchDataSourceInitializer(DataSource dataSource, ResourceLoader resourceLoader, BatchProperties batchProperties) { | ||
return new BatchDataSourceInitializer(dataSource, resourceLoader, batchProperties); | ||
} | ||
|
||
@Bean | ||
@Autowired | ||
public IntegrationDataSourceInitializer integrationDataSourceInitializer(DataSource dataSource, ResourceLoader resourceLoader, IntegrationProperties integrationProperties) { | ||
return new IntegrationDataSourceInitializer(dataSource, resourceLoader, integrationProperties); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
default/generated/spring-boot/tests/data/removals/src/main/resources/application.properties
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 @@ | ||
spring.application.name=boot-deps |
13 changes: 13 additions & 0 deletions
13
...ot/tests/data/removals/src/test/java/org/konveyor/boot_deps/BootDepsApplicationTests.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,13 @@ | ||
package org.konveyor.boot_deps; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@SpringBootTest | ||
class BootDepsApplicationTests { | ||
|
||
@Test | ||
void contextLoads() { | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
default/generated/spring-boot/tests/spring-boot-2.x-to-3.0-removals.test.yaml
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,49 @@ | ||
rulesPath: ../spring-boot-2.x-to-3.0-removals.yaml | ||
providers: | ||
- name: java | ||
dataPath: ./data/removals | ||
- name: builtin | ||
dataPath: ./data/removals | ||
tests: | ||
- ruleID: spring-boot-2.x-to-3.0-removals-00010 | ||
testCases: | ||
- name: tc-1 | ||
analysisParams: | ||
mode: "source-only" | ||
hasIncidents: | ||
exactly: 1 | ||
- ruleID: spring-boot-2.x-to-3.0-removals-00020 | ||
testCases: | ||
- name: tc-1 | ||
analysisParams: | ||
mode: "source-only" | ||
hasIncidents: | ||
exactly: 1 | ||
- ruleID: spring-boot-2.x-to-3.0-removals-00030 | ||
testCases: | ||
- name: tc-1 | ||
analysisParams: | ||
mode: "source-only" | ||
hasIncidents: | ||
exactly: 3 | ||
- ruleID: spring-boot-2.x-to-3.0-removals-00040 | ||
testCases: | ||
- name: tc-1 | ||
analysisParams: | ||
mode: "source-only" | ||
hasIncidents: | ||
exactly: 2 | ||
# - ruleID: spring-boot-2.x-to-3.0-removals-00050 | ||
# testCases: | ||
# - name: tc-1 | ||
# analysisParams: | ||
# mode: "source-only" | ||
# hasIncidents: | ||
# exactly: 2 | ||
- ruleID: spring-boot-2.x-to-3.0-removals-00060 | ||
testCases: | ||
- name: tc-1 | ||
analysisParams: | ||
mode: "source-only" | ||
hasIncidents: | ||
exactly: 3 |