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

Format #39

Merged
merged 4 commits into from
Nov 13, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Sonarcloud
on:
push:
branches: [ master, ODINwhiteboard ]
branches: [ ]
pull_request:
branches: [ master, ODINwhiteboard ]
branches: [ ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Expand Down
80 changes: 40 additions & 40 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
name: Test, Analyze, and Generate documentation
# name: Test, Analyze, and Generate documentation

on:
push:
branches:
- main
# on:
# push:
# branches:
# - main

jobs:
test:
runs-on: ubuntu-latest
# jobs:
# test:
# runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
# - name: Set up JDK
# uses: actions/setup-java@v2
# with:
# java-version: '11'
# distribution: 'adopt'

- name: Debugging
run: |
pwd
ls -la
cd ${{ github.workspace }}
ls -la
# - name: Debugging
# run: |
# pwd
# ls -la
# cd ${{ github.workspace }}
# ls -la

- name: Grant execute permission to gradlew
run: |
chmod +x api/gradlew
# - name: Grant execute permission to gradlew
# run: |
# chmod +x api/gradlew

- name: Create test file
run: |
mkdir -p api/src/test/resources
touch api/src/test/resources/credentials.properties
echo "db.username=${{ secrets.DATABASE_USERNAME }}" >> api/src/test/resources/credentials.properties
echo "db.password=${{ secrets.DATABASE_PASSWORD }}" >> api/src/test/resources/credentials.properties
echo "db.url=${{ secrets.DATABASE_URL }}" >> api/src/test/resources/credentials.properties
# - name: Create test file
# run: |
# mkdir -p api/src/test/resources
# touch api/src/test/resources/credentials.properties
# echo "db.username=${{ secrets.DATABASE_USERNAME }}" >> api/src/test/resources/credentials.properties
# echo "db.password=${{ secrets.DATABASE_PASSWORD }}" >> api/src/test/resources/credentials.properties
# echo "db.url=${{ secrets.DATABASE_URL }}" >> api/src/test/resources/credentials.properties

- name: Build with Gradle
working-directory: api # Specify the correct working directory
run: |
./gradlew build --warning-mode all
# - name: Build with Gradle
# working-directory: api # Specify the correct working directory
# run: |
# ./gradlew build --warning-mode all

- name: Run tests with Gradle
working-directory: api # Specify the correct working directory
run: |
./gradlew test
# - name: Run tests with Gradle
# working-directory: api # Specify the correct working directory
# run: |
# ./gradlew test


# analyze:
Expand Down
49 changes: 25 additions & 24 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -133,27 +133,28 @@ sonarqube {
tasks['sonarqube'].dependsOn test


//para copiar la versión actualizada de NextiaCore y NextiaDI (modificar segun ruta propia)
def nextiaCoreJarPath = "C:\\Projects\\NextiaCore\\build\\libs"
def nextiaDIJarPath = "C:\\Projects\\NextiaDI\\source\\build\\libs\\nextiadi-0.1.0-SNAPSHOT-uber.jar"
def nextiaBSJarPath = "C:\\Projects\\NextiaBS\\build\\libs"
def nextiaDLJarPath = "C:\\Projects\\NextiaDataLayer\\build\\libs"
//def nextiaJDJarPath = "C:\\Projects\\NextiaJD2\\build\\libs"
//para copiar la versión actualizada de NextiaCore y NextiaDI (tener dependencias en misma carpeta que ODIN)
//por ejemplo carpeta Folder y dentro de Folder tener ODIN, NextiaCore, NextiaBS, etc.
def nextiaCoreJarPath = "..\\..\\NextiaCore\\build\\libs"
def nextiaDIJarPath = "..\\..\\NextiaDI\\source\\build\\libs"
def nextiaBSJarPath = "..\\..\\NextiaBS\\build\\libs"
def nextiaDLJarPath = "..\\..\\NextiaDataLayer\\build\\libs"
def nextiaJDJarPath = "..\\..\\NextiaJD2\\build\\libs"

task importExternalJar {
doLast {
def nextiaCorePath = project(':NextiaCore')
def nextiaDIPath = project(':NextiaDI')
def nextiaBSPath = project(':NextiaBS')
def nextiaDLPath = project(':NextiaDataLayer')
// def nextiaJDPath = project(':NextiaJD')
def nextiaJDPath = project(':NextiaJD')

// Verifica si los archivos JAR existen en las rutas especificadas
def nextiaCoreJar = file(nextiaCoreJarPath)
def nextiaDIJar = file(nextiaDIJarPath)
def nextiaBSJar = file(nextiaBSJarPath)
def nextiaDLJar = file(nextiaDLJarPath)
// def nextiaJDJar = file(nextiaJDJarPath)
def nextiaJDJar = file(nextiaJDJarPath)


if (!nextiaCoreJar.exists()) {
Expand Down Expand Up @@ -204,17 +205,17 @@ task importExternalJar {
}
}

// if (!nextiaJDJar.exists()) {
// nextiaJDPath.tasks.uberJar.dependsOn {
// println "Ejecutando uberJar para NextiaJD..."
// }
// nextiaJDPath.tasks.uberJar.execute()
// nextiaJDPath.tasks.uberJar.get()
//
// if (!nextiaJDar.exists()) {
// throw new GradleException("No se pudo generar el archivo JAR para NextiaJD.")
// }
// }
if (!nextiaJDJar.exists()) {
nextiaJDPath.tasks.uberJar.dependsOn {
println "Ejecutando uberJar para NextiaJD..."
}
nextiaJDPath.tasks.uberJar.execute()
nextiaJDPath.tasks.uberJar.get()

if (!nextiaJDar.exists()) {
throw new GradleException("No se pudo generar el archivo JAR para NextiaJD.")
}
}

// Copiar los JAR después de asegurarse de que existen
copy {
Expand All @@ -241,10 +242,10 @@ task importExternalJar {
rename { 'NextiaDataLayer.jar' }
}

// copy {
// from nextiaJDJarPath
// into "../api/lib"
// rename { 'NextiaJD.jar' }
// }
copy {
from nextiaJDJarPath
into "../api/lib"
rename { 'NextiaJD.jar' }
}
}
}
1 change: 1 addition & 0 deletions api/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ include 'NextiaCore'
include 'NextiaDI'
include 'NextiaBS'
include 'NextiaDataLayer'
include 'NextiaJD'

Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public Graph getGraph(String modelName) {

//miramos qué tipo de grafo es para constuir la interficie
ORMStoreInterface ormInterface = ORMStoreFactory.getInstance();
if(ormInterface.findById(LocalGraphJenaImpl.class, modelName) != null){
if (ormInterface.findById(LocalGraphJenaImpl.class, modelName) != null) {
graph = CoreGraphFactory.createLocalGraph();
} else if (ormInterface.findById(IntegratedGraphJenaImpl.class, modelName) != null) {
graph = CoreGraphFactory.createIntegratedGraph();
Expand All @@ -111,7 +111,7 @@ public Graph getGraph(String modelName) {
String graphicalSchema = visualLibInterface.generateVisualGraph(graph);
graph.setGraphicalSchema(graphicalSchema);

if (graph.getClass().equals(IntegratedGraphJenaImpl.class)){
if (graph.getClass().equals(IntegratedGraphJenaImpl.class)) {
integrationModuleInterface integrationInterface = new integrationModuleImpl();
Graph globalGraph = integrationInterface.generateGlobalGraph(graph);
((IntegratedGraphJenaImpl) graph).setGlobalGraph((GlobalGraphJenaImpl) globalGraph);
Expand All @@ -125,7 +125,6 @@ public Graph getGraph(String modelName) {
}



/**
* Saves the given graph.
*
Expand All @@ -149,7 +148,6 @@ public void saveGraph(Graph graph) {
*/



/**
* Retrieves the graph with the given name.
*
Expand Down
34 changes: 17 additions & 17 deletions api/src/main/java/edu/upc/essi/dtim/odin/OdinApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@
@SpringBootApplication
@PropertySource("classpath:credentials.properties")
public class OdinApplication {
private static final Logger logger = LoggerFactory.getLogger(OdinApplication.class);
private static AppConfig appConfig;
private static final Logger logger = LoggerFactory.getLogger(OdinApplication.class);
private static AppConfig appConfig;

public OdinApplication(@Autowired AppConfig appConfig) {
this.appConfig = appConfig;
}
public OdinApplication(@Autowired AppConfig appConfig) {
this.appConfig = appConfig;
}

public static void main(String[] args) {
// Inicia la aplicación Spring Boot
SpringApplication.run(OdinApplication.class, args);
public static void main(String[] args) {
// Inicia la aplicación Spring Boot
SpringApplication.run(OdinApplication.class, args);

//INICIALIZA DATALAYER
DataLoading dl = DataLoadingSingleton.getInstance(appConfig.getDataLayerPath());
//INICIALIZA DATALAYER
DataLoading dl = DataLoadingSingleton.getInstance(appConfig.getDataLayerPath());

// Registra un mensaje en el registro de eventos cuando la aplicación se inicia correctamente
logger.info("Application started. Ready to receive API requests.");
}
// Registra un mensaje en el registro de eventos cuando la aplicación se inicia correctamente
logger.info("Application started. Ready to receive API requests.");
}

@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}
Loading
Loading