Skip to content
Snippets Groups Projects
Commit 6b3901a2 authored by surkat's avatar surkat
Browse files

refactoring

parent 982ef309
No related branches found
No related tags found
No related merge requests found
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
##############################
## Maven
##############################
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
pom.xml.bak
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
##############################
## IntelliJ
##############################
out/
.idea/*
*.iml
*.ipr
*.iws
##############################
## Database
##############################
*.db
*.DS_Store
image: maven:eclipse-temurin
stages:
- build
- test
- package
- deploy
build:
stage: build
script:
- mvn compile
test:
stage: test
script:
- mvn clean test
package:
stage: package
script:
- mvn clean package
artifacts:
paths:
- target/idatt2002demo-1.0-SNAPSHOT-jar-with-dependencies.jar
generatepdf:
image: ubuntu:20.04 # vi kjører dette i en docker container, som kjører Ubuntu Linux
stage: deploy # vi kjører den parallelt med å publisere javadoc til Pages
......@@ -35,4 +62,4 @@ pages:
paths:
- public
only:
- master
- web
pom.xml 0 → 100644
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>no.ntnu.idatt1002.demo</groupId>
<artifactId>idatt2002demo</artifactId>
<version>1.0-SNAPSHOT</version>
<name>demo</name>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.8.1</junit.version>
<javafx.version>17.0.1</javafx.version>
</properties>
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics </artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-media</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.36.0.3</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.github.Dansoftowner</groupId>
<artifactId>jSystemThemeDetector</artifactId>
<version>3.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>default-jar</id>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
no.ntnu.idatt1002.demo.MyApp
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<executions>
<execution>
<!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id>
<configuration>
<mainClass>no.ntnu.idatt1002.demo/no.ntnu.idatt1002.demo.MyApp</mainClass>
<launcher>app</launcher>
<jlinkZipName>app</jlinkZipName>
<jlinkImageName>app</jlinkImageName>
<noManPages>true</noManPages>
<stripDebug>true</stripDebug>
<noHeaderFiles>true</noHeaderFiles>
<release>${maven.compiler.target}</release>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<reportSets>
<reportSet>
<id>aggregate</id>
<inherited>false</inherited>
<reports>
<report>aggregate</report>
</reports>
</reportSet>
<reportSet>
<id>default</id>
<reports>
<report>javadoc</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</project>
package myapp;
package no.ntnu.idatt1002.demo;
import myapp.view.MyWindow;
import no.ntnu.idatt1002.demo.view.MyWindow;
/**
* Use this class to start the application
......
package myapp.data;
package no.ntnu.idatt1002.demo.data;
import java.util.Date;
import java.util.List;
......
package myapp.repo;
package no.ntnu.idatt1002.demo.repo;
import myapp.data.MyEntity;
import no.ntnu.idatt1002.demo.data.MyEntity;
import java.util.Arrays;
import java.util.List;
......
package myapp.view;
package no.ntnu.idatt1002.demo.view;
import myapp.repo.MyEntityRepo;
import myapp.data.MyEntity;
import no.ntnu.idatt1002.demo.repo.MyEntityRepo;
import no.ntnu.idatt1002.demo.data.MyEntity;
import java.awt.GridLayout;
import java.awt.*;
import javax.swing.*;
/**
......@@ -17,7 +17,6 @@ public class MyWindow extends JFrame {
* Constructor for window
*
* @param title Title ow the window
* @return the image at the specified URL
* @see Image
*/
public MyWindow(String title) {
......
package myapp.repo;
package no.ntnu.idatt1002.demo.repo;
import no.ntnu.idatt1002.demo.data.MyEntity;
import org.junit.jupiter.api.Test;
import myapp.data.MyEntity;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class MyEntityRepoTest {
@Test
public void testThatWeCanReadMyEntityFromDatabase() {
MyEntity e = new MyEntityRepo().getMyEntity("id");
assertEquals(e.getName(), "name");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment