Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Maven Build
  • Loading branch information
shathor committed Aug 25, 2018
1 parent 204a7c6 commit 97559fe
Show file tree
Hide file tree
Showing 20 changed files with 221 additions and 97 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -8,10 +8,11 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

*.pydevproject
.metadata
.gradle
bin/
logs/
target/
tmp/
*.tmp
*.bak
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
135 changes: 135 additions & 0 deletions pom.xml
@@ -0,0 +1,135 @@
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>ch.hsr.ogv</groupId>
<artifactId>objgraphvis</artifactId>
<version>3.1.0</version>

<!-- Build -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>

<!-- Versions -->
<properties>
<log4j.version>2.11.1</log4j.version>
<jaxb-api.version>2.3.0</jaxb-api.version>
<jaxb-core.version>2.3.0</jaxb-core.version>
<jaxb-impl.version>2.3.0</jaxb-impl.version>
<fxyzlib.version>0.3.0</fxyzlib.version>
<objimporterjfx.version>0.8</objimporterjfx.version>
<junit.version>5.2.0</junit.version>
<junit-platform.version>1.2.0</junit-platform.version>
</properties>

<!-- Dependencies -->
<dependencies>

<!-- Logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
</dependency>

<!-- JAX-B -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb-api.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb-core.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb-impl.version}</version>
</dependency>

<!-- JavaFX -->
<dependency>
<groupId>com.github.FXyz</groupId>
<artifactId>FXyz</artifactId>
<version>${fxyzlib.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/fxyzlib.jar</systemPath>
</dependency>

<dependency>
<groupId>com.interactivemesh.jfx.importer</groupId>
<artifactId>interactivemesh.jimObjModelImporterJFX</artifactId>
<version>${objimporterjfx.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jimObjModelImporterJFX.jar</systemPath>
</dependency>

<!-- Testing -->
<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.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>${junit-platform.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>

</dependencies>

</project>
10 changes: 4 additions & 6 deletions src/ch/hsr/ogv/MainApp.java
@@ -1,17 +1,15 @@
package ch.hsr.ogv;

import java.lang.Thread.UncaughtExceptionHandler;
import java.util.Locale;

import ch.hsr.ogv.util.ResourceLocator;
import ch.hsr.ogv.util.ResourceLocator.Resource;
import javafx.application.Application;
import javafx.scene.text.Font;
import javafx.stage.Stage;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ch.hsr.ogv.util.ResourceLocator;
import ch.hsr.ogv.util.ResourceLocator.Resource;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.Locale;

/**
* Starts the application.
Expand Down
File renamed without changes.
10 changes: 4 additions & 6 deletions test/ch/hsr/ogv/model/EndpointTest.java
@@ -1,21 +1,19 @@
package ch.hsr.ogv.model;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import javafx.geometry.Point3D;
import javafx.scene.paint.Color;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import org.junit.Before;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.*;

public class EndpointTest {

private ModelClass modelClassA;
private ModelClass modelClassB;
private Relation relationAB;

@Before
@BeforeEach
public void setUp() throws Exception {
modelClassA = new ModelClass("A", new Point3D(0, 0, 0), 100.0, 100.0, Color.BEIGE);
modelClassB = new ModelClass("B", new Point3D(-200, 0, 0), 100.0, 100.0, Color.BEIGE);
Expand Down
100 changes: 50 additions & 50 deletions test/ch/hsr/ogv/model/ModelBoxTest.java
@@ -1,67 +1,67 @@
package ch.hsr.ogv.model;

import static org.junit.Assert.assertEquals;
import javafx.geometry.Point3D;
import javafx.scene.paint.Color;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import org.junit.Before;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.*;

public class ModelBoxTest {

private ModelBox mb;
private ModelBox mb;

@Before
public void setUp() throws Exception {
mb = new ModelClass("", new Point3D(-200, 200, 0), 100, 100, Color.BEIGE);
}
@BeforeEach
public void setUp() throws Exception {
mb = new ModelClass("", new Point3D(-200, 200, 0), 100, 100, Color.BEIGE);
}

@Test
public void testSetCoordinates() {
Point3D newPoint = new Point3D(123, 234, 345);
mb.setCoordinates(newPoint);
assertEquals(newPoint, mb.getCoordinates());
}
@Test
public void testSetCoordinates() {
Point3D newPoint = new Point3D(123, 234, 345);
mb.setCoordinates(newPoint);
assertEquals(newPoint, mb.getCoordinates());
}

@Test
public void testSetX() {
double newX = 123;
mb.setX(newX);
assertEquals(new Point3D(123, 200, 0), mb.getCoordinates());
}
@Test
public void testSetX() {
double newX = 123;
mb.setX(newX);
assertEquals(new Point3D(123, 200, 0), mb.getCoordinates());
}

@Test
public void testSetY() {
double newY = 123;
mb.setY(newY);
assertEquals(new Point3D(-200, 123, 0), mb.getCoordinates());
}
@Test
public void testSetY() {
double newY = 123;
mb.setY(newY);
assertEquals(new Point3D(-200, 123, 0), mb.getCoordinates());
}

@Test
public void testSetZ() {
double newZ = 123;
mb.setZ(newZ);
assertEquals(new Point3D(-200, 200, 123), mb.getCoordinates());
}
@Test
public void testSetZ() {
double newZ = 123;
mb.setZ(newZ);
assertEquals(new Point3D(-200, 200, 123), mb.getCoordinates());
}

@Test
public void testSetWidth() {
double newWidth = 123;
mb.setWidth(123);
assertEquals(newWidth, mb.getWidth(), 0.0);
}
@Test
public void testSetWidth() {
double newWidth = 123;
mb.setWidth(123);
assertEquals(newWidth, mb.getWidth());
}

@Test
public void testSetHeight() {
double newHeight = 123;
mb.setHeight(123);
assertEquals(newHeight, mb.getHeight(), 0.0);
}
@Test
public void testSetHeight() {
double newHeight = 123;
mb.setHeight(123);
assertEquals(newHeight, mb.getHeight());
}

@Test
public void testSetColor() {
Color newColor = Color.BLUE;
mb.setColor(newColor);
assertEquals(newColor, mb.getColor());
}
@Test
public void testSetColor() {
Color newColor = Color.BLUE;
mb.setColor(newColor);
assertEquals(newColor, mb.getColor());
}
}
20 changes: 9 additions & 11 deletions test/ch/hsr/ogv/model/ModelClassTest.java
@@ -1,32 +1,30 @@
package ch.hsr.ogv.model;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import javafx.geometry.Point3D;
import javafx.scene.paint.Color;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.List;

import javafx.geometry.Point3D;
import javafx.scene.paint.Color;

import org.junit.Before;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.*;

public class ModelClassTest {

private ModelManager mm;

@Before
@BeforeEach
public void setUp() throws Exception {
mm = new ModelManager();
}

@Test
public void testGetXYZ() {
ModelClass modelClassA = mm.createClass(new Point3D(100, 200, 300), 100.0, 100.0, Color.BEIGE);
assertEquals(100, modelClassA.getX(), 0.0);
assertEquals(200, modelClassA.getY(), 0.0);
assertEquals(300, modelClassA.getZ(), 0.0);
assertEquals(100, modelClassA.getX());
assertEquals(200, modelClassA.getY());
assertEquals(300, modelClassA.getZ());
}

@Test
Expand Down
12 changes: 4 additions & 8 deletions test/ch/hsr/ogv/model/ModelManagerTest.java
@@ -1,21 +1,17 @@
package ch.hsr.ogv.model;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import javafx.geometry.Point3D;
import javafx.scene.paint.Color;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import org.junit.Before;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.*;

public class ModelManagerTest {

private ModelManager mm;

@Before
@BeforeEach
public void setUp() throws Exception {
mm = new ModelManager();
}
Expand Down

0 comments on commit 97559fe

Please sign in to comment.