Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version synchronized with Celesta #220

Merged
merged 5 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: build

on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]

jobs:
build-main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'

- name: Setup Testcontainers Cloud Client
uses: atomicjar/testcontainers-cloud-setup-action@v1
with:
token: ${{ secrets.TC_CLOUD_TOKEN }}

- name: Build and test 2Bass
run: mvn verify
47 changes: 26 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>ru.curs</groupId>
<artifactId>2bass</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.1</version>
<packaging>jar</packaging>

<name>2bass</name>
Expand Down Expand Up @@ -50,12 +50,16 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--dependency versions -->
<celesta.version>7.4.8</celesta.version>
<celesta.version>8.0.1</celesta.version>
<checkstyle.version>9.0.1</checkstyle.version>
<junit.version>5.8.2</junit.version>
<junit.platform.version>1.5.2</junit.platform.version>
<testcontainers.version>1.15.3</testcontainers.version>
<testcontainers.firebird.version>1.1.0</testcontainers.firebird.version>
<testcontainers.version>1.20.3</testcontainers.version>
<testcontainers.firebird.version>1.4.0</testcontainers.firebird.version>
<jdbc.driver.oracle.version>23.5.0.24.07</jdbc.driver.oracle.version>
<jdbc.driver.sqlserver.version>12.8.1.jre11</jdbc.driver.sqlserver.version>
<jdbc.driver.postgres.version>42.7.4</jdbc.driver.postgres.version>
<jdbc.driver.firebird.version>4.0.9.java8</jdbc.driver.firebird.version>
<!--plugin versions -->
<javacc.maven.plugin.version>2.6</javacc.maven.plugin.version>
<maven.assembly.plugin.version>3.3.0</maven.assembly.plugin.version>
Expand Down Expand Up @@ -93,28 +97,32 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${jdbc.driver.postgres.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>${jdbc.driver.sqlserver.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<artifactId>ojdbc11</artifactId>
<version>${jdbc.driver.oracle.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.firebirdsql.jdbc</groupId>
<artifactId>jaybird-jdk18</artifactId>
<version>${jdbc.driver.firebird.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>info.macias</groupId>
<artifactId>kaconf</artifactId>
<version>0.9.0</version>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>org.fusesource.jansi</groupId>
Expand Down Expand Up @@ -162,12 +170,13 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-xe</artifactId>

<version>${testcontainers.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<artifactId>ojdbc8</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand All @@ -180,8 +189,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>11</source>
<target>11</target>
<encoding>utf-8</encoding>
</configuration>
</plugin>
Expand Down Expand Up @@ -299,24 +308,20 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<reportPlugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
</configuration>
</plugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down
1 change: 0 additions & 1 deletion src/main/java/ru/curs/bass/Bass.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ void setupDBConnection() {

DBType dbType = DBType.resolveByJdbcUrl(properties.getJdbcUrl());

cpc.setDriverClassName(dbType.getDriverClassName());
cpc.setLogin(properties.getJdbcUserName());
cpc.setPassword(properties.getJdbcPassword());
this.connectionPool = InternalConnectionPool.create(cpc);
Expand Down
5 changes: 2 additions & 3 deletions src/test/java/ru/curs/bass/BassTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ void afterEach() throws Exception {

AppProperties getProperties() {
AppProperties properties = new AppProperties();
String scorePath1 = getClass().getResource("appTestScores/applyScore/s1").getPath();
String scorePath2 = getClass().getResource("appTestScores/applyScore/s2").getPath();
properties.setScorePath(scorePath1 + File.pathSeparator + scorePath2);
String scorePath = getClass().getResource("appTestScores/applyScore").getPath();
properties.setScorePath(scorePath);
return properties;
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/ru/curs/bass/OracleBassTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class OracleBassTest extends BassTest {

@BeforeEach
void beforeEach() throws Exception {
oracle = new OracleContainer();
oracle = new OracleContainer("gvenzl/oracle-xe:21.3.0");
oracle.start();
super.beforeEach();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
CREATE SCHEMA "market" version '1.0';

create sequence "customers numerator";

create table customers(
id int DEFAULT NEXTVAL("customers numerator") not null,
name varchar(30),
CONSTRAINT pk_customers PRIMARY KEY (id)
);

create sequence shops_numerator;

create table shops(
id int DEFAULT NEXTVAL(shops_numerator) not null,
name varchar(30),
address varchar(200),
CONSTRAINT pk_shops PRIMARY KEY (id)
);

create sequence products_numerator;

create table products(
id int DEFAULT NEXTVAL(products_numerator) not null,
shop_id int foreign key references shops("id"),
name varchar(30),
description varchar(500),
cost real,
"count" int,
CONSTRAINT pk_products PRIMARY KEY (id)
);

create sequence orders_numerator;

create table orders(
id int DEFAULT NEXTVAL(orders_numerator) not null,
product_id int foreign key references products("id"),
customer_id int foreign key references customers("id"),
cost real,
order_date datetime not null,
expire_date datetime,
CONSTRAINT pk_orders PRIMARY KEY (id)
);

create view "get not exp ordrs" AS
select id, product_id, customer_id, cost, order_date, expire_date
from "orders"
where getdate() < expire_date;

create materialized view get_orders_stats as
select order_date, count(*) as "count", sum(cost) as summary_cost
from orders
group by order_date;

create function getOrdCountPerCus(shopId int) AS
select c.name as customer_name, count(*) as "count"
from orders o
LEFT JOIN products p ON o.product_id = p.id
LEFT JOIN customers c ON o.customer_id = c.id
WHERE $shopId = p.shop_id
group by customer_name;

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion src/test/resources/testcontainers.properties

This file was deleted.