maven compiles all tests independetly of which tests are run
This commit is contained in:
1
pom.xml
1
pom.xml
@@ -11,6 +11,7 @@
|
||||
<properties>
|
||||
<maven.compiler.source>25</maven.compiler.source>
|
||||
<maven.compiler.target>25</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -7,6 +7,5 @@ open module ovinger {
|
||||
requires javafx.controls;
|
||||
requires javafx.fxml;
|
||||
requires javafx.graphics;
|
||||
requires org.junit.jupiter.api;
|
||||
requires com.google.common;
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
package oving4.testing;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class CoffeeCupTest {
|
||||
|
||||
private CoffeeCup coffee;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
coffee = new CoffeeCup();
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Constructor")
|
||||
public void testConstructor() {
|
||||
assertEquals(0, coffee.getCapacity());
|
||||
assertEquals(0, coffee.getCurrentVolume());
|
||||
coffee.increaseCupSize(10);
|
||||
assertEquals(10, coffee.getCapacity());
|
||||
coffee.fillCoffee(10);
|
||||
assertEquals(10, coffee.getCurrentVolume());
|
||||
coffee.drinkCoffee(10);
|
||||
assertEquals(0, coffee.getCurrentVolume());
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("volume cannot be null")
|
||||
public void testAddChildException() {
|
||||
}
|
||||
|
||||
}
|
||||
21
src/main/java/oving5/BinaryComputingIterator.java
Normal file
21
src/main/java/oving5/BinaryComputingIterator.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package oving5;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.function.BinaryOperator;
|
||||
|
||||
public class BinaryComputingIterator {
|
||||
BinaryComputingIterator(Iterator<Double> iterator1, Iterator<Double> iterator2, BinaryOperator<Double> operator) {
|
||||
}
|
||||
|
||||
BinaryComputingIterator(Iterator<Double> iterator1, Iterator<Double> iterator2, Double default1, Double default2,
|
||||
BinaryOperator<Double> operator) {
|
||||
}
|
||||
|
||||
boolean hasNext() {
|
||||
return false;
|
||||
}
|
||||
|
||||
Double next() {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
25
src/main/java/oving5/RPNCalc.java
Normal file
25
src/main/java/oving5/RPNCalc.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package oving5;
|
||||
|
||||
import java.util.function.BinaryOperator;
|
||||
|
||||
public class RPNCalc {
|
||||
RPNCalc() {
|
||||
}
|
||||
|
||||
public void performOperation(char c) {
|
||||
}
|
||||
|
||||
public void removeOperator(char c) {
|
||||
}
|
||||
|
||||
public boolean addOperator(char c, BinaryOperator<Double> d) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Double pop() {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public void push(int i) {
|
||||
}
|
||||
}
|
||||
10
src/main/java/oving5/card/Card.java
Normal file
10
src/main/java/oving5/card/Card.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package oving5.card;
|
||||
|
||||
public class Card {
|
||||
Card(char suit, int card) {
|
||||
}
|
||||
|
||||
char getSuit() {
|
||||
return 'A';
|
||||
}
|
||||
}
|
||||
28
src/main/java/oving5/named/Person1.java
Normal file
28
src/main/java/oving5/named/Person1.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package oving5.named;
|
||||
|
||||
public class Person1 {
|
||||
Person1(String s) {
|
||||
}
|
||||
|
||||
public void setFullName(String s) {
|
||||
}
|
||||
|
||||
public void setFamilyName(String s) {
|
||||
}
|
||||
|
||||
public void setGivenName(String s) {
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getFamilyName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getGivenName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
28
src/main/java/oving5/named/Person2.java
Normal file
28
src/main/java/oving5/named/Person2.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package oving5.named;
|
||||
|
||||
public class Person2 {
|
||||
Person2(String s) {
|
||||
}
|
||||
|
||||
public void setFullName(String s) {
|
||||
}
|
||||
|
||||
public void setFamilyName(String s) {
|
||||
}
|
||||
|
||||
public void setGivenName(String s) {
|
||||
}
|
||||
|
||||
public String getFullName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getFamilyName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getGivenName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
23
src/main/java/oving5/stringgrid/StringGrid.java
Normal file
23
src/main/java/oving5/stringgrid/StringGrid.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package oving5.stringgrid;
|
||||
|
||||
/**
|
||||
* An interface with methods for managing the content of a String grid. The grid has a number of
|
||||
* rows (the grid's height) and columns (the grid's width). In each cell in the grid there is a
|
||||
* String that can be set with the setElement method and read with the getElement method.
|
||||
*/
|
||||
public interface StringGrid {
|
||||
|
||||
// Returns the number of rows in this StringGrid
|
||||
int getRowCount();
|
||||
|
||||
// Returns the number of columns in this StringGrid
|
||||
int getColumnCount();
|
||||
|
||||
// Returns the String at the given row and column. Throws an IllegalArgumentException if the
|
||||
// row or column is out of range
|
||||
String getElement(int row, int column);
|
||||
|
||||
// Sets the String at the given row and column. Throws an IllegalArgumentException if the row
|
||||
// or column is out of range
|
||||
void setElement(int row, int column, String element);
|
||||
}
|
||||
55
src/main/java/oving5/stringgrid/StringGridImpl.java
Normal file
55
src/main/java/oving5/stringgrid/StringGridImpl.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package oving5.stringgrid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
public class StringGridImpl implements StringGrid {
|
||||
private ArrayList<String> grid;
|
||||
private int rows;
|
||||
private int columns;
|
||||
|
||||
StringGridImpl(int rows, int columns) {
|
||||
grid = new ArrayList<String>(Collections.nCopies(rows * columns, ""));
|
||||
this.rows = rows;
|
||||
this.columns = columns;
|
||||
}
|
||||
|
||||
public int getRowCount() {
|
||||
return rows;
|
||||
}
|
||||
|
||||
public int getColumnCount() {
|
||||
return columns;
|
||||
}
|
||||
|
||||
public String getElement(int row, int column) {
|
||||
if (row < 0 || row >= rows || column < 0 || column >= columns) {
|
||||
throw new IllegalArgumentException(
|
||||
"Invalid value for row or column, got row: " + row + ", and column: " + column);
|
||||
}
|
||||
return grid.get(row * columns + column);
|
||||
}
|
||||
|
||||
public void setElement(int row, int column, String element) {
|
||||
if (row < 0 || row >= rows || column < 0 || column >= columns) {
|
||||
throw new IllegalArgumentException(
|
||||
"Invalid value for row or column, got row: " + row + ", and column: " + column);
|
||||
}
|
||||
grid.set(row * columns + column, element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String r = "";
|
||||
for (int y = 0; y < rows; y++) {
|
||||
for (int x = 0; x < columns; x++) {
|
||||
r += grid.get(y * columns + x);
|
||||
if (x < columns - 1) {
|
||||
r += " | ";
|
||||
}
|
||||
}
|
||||
r += "\n";
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
||||
35
src/main/java/oving5/stringgrid/StringGridIterator.java
Normal file
35
src/main/java/oving5/stringgrid/StringGridIterator.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package oving5.stringgrid;
|
||||
|
||||
public class StringGridIterator {
|
||||
private StringGrid grid;
|
||||
private boolean rowMajor;
|
||||
private int i = -1;
|
||||
|
||||
public StringGridIterator(StringGrid grid, boolean rowMajor) {
|
||||
this.grid = grid;
|
||||
this.rowMajor = rowMajor;
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
return (i + 1) < (grid.getRowCount() * grid.getColumnCount());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String next() {
|
||||
if (hasNext()) {
|
||||
i += 1;
|
||||
if (rowMajor) {
|
||||
return grid.getElement(i / grid.getColumnCount(), i % grid.getColumnCount());
|
||||
} else {
|
||||
return grid.getElement(i % grid.getRowCount(), i / grid.getRowCount());
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
12
src/main/java/oving5/ticket/PeriodTicket.java
Normal file
12
src/main/java/oving5/ticket/PeriodTicket.java
Normal file
@@ -0,0 +1,12 @@
|
||||
package oving5.ticket;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class PeriodTicket {
|
||||
PeriodTicket(LocalDateTime start, LocalDateTime end) {
|
||||
}
|
||||
|
||||
public boolean scan() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
6
src/main/java/oving5/ticket/SingleTicket.java
Normal file
6
src/main/java/oving5/ticket/SingleTicket.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package oving5.ticket;
|
||||
|
||||
public class SingleTicket {
|
||||
SingleTicket() {
|
||||
}
|
||||
}
|
||||
10
src/main/java/oving5/twitter/FollowersCountComparator.java
Normal file
10
src/main/java/oving5/twitter/FollowersCountComparator.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package oving5.twitter;
|
||||
|
||||
public class FollowersCountComparator {
|
||||
FollowersCountComparator() {
|
||||
}
|
||||
|
||||
int compare(TwitterAccount a, TwitterAccount b) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
10
src/main/java/oving5/twitter/TweetsCountComparator.java
Normal file
10
src/main/java/oving5/twitter/TweetsCountComparator.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package oving5.twitter;
|
||||
|
||||
public class TweetsCountComparator {
|
||||
TweetsCountComparator() {
|
||||
}
|
||||
|
||||
public int compare(TwitterAccount a, TwitterAccount b) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
50
src/main/java/oving5/twitter/TwitterAccount.java
Normal file
50
src/main/java/oving5/twitter/TwitterAccount.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package oving5.twitter;
|
||||
|
||||
public class TwitterAccount {
|
||||
TwitterAccount(String s) {
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public void tweet(String s) {
|
||||
}
|
||||
|
||||
public TwitterAccount getTweet(int i) {
|
||||
return new TwitterAccount("");
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public int getTweetCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void retweet(TwitterAccount s) {
|
||||
}
|
||||
|
||||
public int getRetweetCount() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public TwitterAccount getOriginalTweet() {
|
||||
return new TwitterAccount("");
|
||||
}
|
||||
|
||||
public void unfollow(TwitterAccount a) {
|
||||
}
|
||||
|
||||
public void follow(TwitterAccount a) {
|
||||
}
|
||||
|
||||
public boolean isFollowedBy(TwitterAccount a) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isFollowing(TwitterAccount a) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
7
src/main/java/oving5/twitter/UserNameComparator.java
Normal file
7
src/main/java/oving5/twitter/UserNameComparator.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package oving5.twitter;
|
||||
|
||||
public class UserNameComparator {
|
||||
public int compare(TwitterAccount a, TwitterAccount b) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user