Compare commits
9 Commits
v1.3.8
...
25a70331f5
| Author | SHA1 | Date | |
|---|---|---|---|
|
25a70331f5
|
|||
|
d5fb7b4521
|
|||
|
abf61f5395
|
|||
|
2dfd645577
|
|||
|
284cd73b24
|
|||
|
2828fd4f58
|
|||
| 8877fc7193 | |||
| ba6d836c88 | |||
| 81fc3fdf95 |
21
README.md
21
README.md
@@ -1,23 +1,15 @@
|
|||||||
# JavaClasses
|
# JavaClasses
|
||||||
|
|
||||||
|
[](https://sonarqube.mattrixwv.com/dashboard?id=JavaClasses)
|
||||||
|
|
||||||
This is a set of classes and functions, not part of the standard library, that I have found it helpful to keep around.
|
This is a set of classes and functions, not part of the standard library, that I have found it helpful to keep around.
|
||||||
|
|
||||||
# Installation
|
## Stopwatch
|
||||||
In order to use these in a program they need to be installed with maven. I normally use `mvn clean package install`. From there you can import them into a maven project using
|
|
||||||
```XML
|
|
||||||
<dependency>
|
|
||||||
<groupId>mattrixwv</groupId>
|
|
||||||
<artifactId>myClasses</artifactId>
|
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
```
|
|
||||||
Then import them into a program by `import mattrixwv.Algorithms;` or `import mattrixwv.Stopwatch;`.
|
|
||||||
|
|
||||||
# Stopwatch
|
|
||||||
This is a class that allows you to determine the execution time of an algorithm.
|
This is a class that allows you to determine the execution time of an algorithm.
|
||||||
You can get specific resolutions of time through their own get functions, all of which return double.
|
You can get specific resolutions of time through their own get functions, all of which return double.
|
||||||
However I have built it a function, getStr(), that automatically chooses the best resolution and returns both the number and resolution as a string.
|
However I have built it a function, getStr(), that automatically chooses the best resolution and returns both the number and resolution as a string.
|
||||||
|
|
||||||
Example of usage:
|
|
||||||
```Java
|
```Java
|
||||||
Stopwatch timer = new Stopwatch();
|
Stopwatch timer = new Stopwatch();
|
||||||
timer.start();
|
timer.start();
|
||||||
@@ -28,6 +20,7 @@ Example of usage:
|
|||||||
System.out.printf("It took %f milliseconds to run this algorithm", timer.getMilli());
|
System.out.printf("It took %f milliseconds to run this algorithm", timer.getMilli());
|
||||||
```
|
```
|
||||||
|
|
||||||
# Algorithms
|
## Algorithms
|
||||||
This is a class that contains many different algorithms that I have found it useful to keep around. This is used extensively in my ProjectEuler code found at https://bitbucket.org/Mattrixwv/ProjectEuler
|
|
||||||
|
This is a class that contains many different algorithms that I have found it useful to keep around. This is used extensively in my [Project Euler](https://git.mattrixwv.com/ProjectEuler/ProjectEulerJava) project.
|
||||||
All methods are overloaded to allow for using Integer, Long, and BigInteger types.
|
All methods are overloaded to allow for using Integer, Long, and BigInteger types.
|
||||||
|
|||||||
162
pom.xml
162
pom.xml
@@ -20,14 +20,14 @@
|
|||||||
</developers>
|
</developers>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:git://bitbucket.org/Mattrixwv/JavaClasses.git</connection>
|
<connection>scm:git:git://git.mattrixwv.com/BaseLibraries/JavaClasses.git</connection>
|
||||||
<developerConnection>scm:git:ssh://bitbucket.org:Mattrixwv/JavaClasses.git</developerConnection>
|
<developerConnection>scm:git:ssh://git.mattrixwv.com/BaseLibraries/JavaClasses.git</developerConnection>
|
||||||
<url>https://bitbucket.org/Mattrixwv/JavaClasses/src</url>
|
<url>https://git.mattrixwv.com/BaseLibraries/JavaClasses</url>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<groupId>com.mattrixwv</groupId>
|
<groupId>com.mattrixwv</groupId>
|
||||||
<artifactId>myClasses</artifactId>
|
<artifactId>myClasses</artifactId>
|
||||||
<version>1.3.8</version>
|
<version>1.4.0</version>
|
||||||
|
|
||||||
<name>myClasses</name>
|
<name>myClasses</name>
|
||||||
<description>A grouping of functions that I've found useful</description>
|
<description>A grouping of functions that I've found useful</description>
|
||||||
@@ -38,42 +38,103 @@
|
|||||||
<!--Compile-->
|
<!--Compile-->
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<maven.compiler.source>21</maven.compiler.source>
|
<java.version>25</java.version>
|
||||||
<maven.compiler.target>21</maven.compiler.target>
|
<maven.compiler.source>25</maven.compiler.source>
|
||||||
<java.version>21</java.version>
|
<maven.compiler.target>25</maven.compiler.target>
|
||||||
|
|
||||||
<!--Sonarqube-->
|
<!--Sonarqube-->
|
||||||
<sonar.java.source>21</sonar.java.source>
|
<sonar.java.source>25</sonar.java.source>
|
||||||
<sonar.dependencyCheck.jsonReportPath>target/dependency-check-report.json</sonar.dependencyCheck.jsonReportPath>
|
<sonar.dependencyCheck.jsonReportPath>target/dependency-check-report.json</sonar.dependencyCheck.jsonReportPath>
|
||||||
<sonar.dependencyCheck.htmlReportPath>target/dependency-check-report.html</sonar.dependencyCheck.htmlReportPath>
|
<sonar.dependencyCheck.htmlReportPath>target/dependency-check-report.html</sonar.dependencyCheck.htmlReportPath>
|
||||||
|
|
||||||
<!--Deployment-->
|
|
||||||
<gpg.keyname>3BA6515C8FF145249BEBBEABA52FDEC4259179D4</gpg.keyname>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-api</artifactId>
|
<artifactId>junit-jupiter</artifactId>
|
||||||
<version>5.12.2</version>
|
<version>6.0.2</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<!--Ensure maven is the correct version-->
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
<version>3.5.0</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>enforce-maven</id>
|
<id>enforce-maven</id>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>enforce</goal>
|
<goal>enforce</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!--Sonarqube-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.owasp</groupId>
|
||||||
|
<artifactId>dependency-check-maven</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>dependency-check</id>
|
||||||
|
<phase>verify</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>check</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!--Deployment-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar-no-fork</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-javadocs</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-gpg-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>sign-artifacts</id>
|
||||||
|
<phase>verify</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>sign</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<!--Ensure maven is the correct version-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
|
<version>3.6.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<rules>
|
<rules>
|
||||||
<requireMavenVersion>
|
<requireMavenVersion>
|
||||||
@@ -81,20 +142,21 @@
|
|||||||
</requireMavenVersion>
|
</requireMavenVersion>
|
||||||
</rules>
|
</rules>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
<version>3.4.1</version>
|
<version>3.5.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
<version>3.3.1</version>
|
<version>3.4.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.14.0</version>
|
<version>3.14.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<release>${java.version}</release>
|
<release>${java.version}</release>
|
||||||
<compilerArgs>
|
<compilerArgs>
|
||||||
@@ -105,33 +167,34 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>3.5.3</version>
|
<version>3.5.4</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
<version>3.4.2</version>
|
<version>3.5.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
<version>3.1.4</version>
|
<version>3.1.4</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<version>3.1.4</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-site-plugin</artifactId>
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
<version>3.21.0</version>
|
<version>3.21.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
<version>3.9.0</version>
|
<version>3.9.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>versions-maven-plugin</artifactId>
|
<artifactId>versions-maven-plugin</artifactId>
|
||||||
<version>2.18.0</version>
|
<version>2.21.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<rulesUri>file://${session.executionRootDirectory}/version-rules.xml</rulesUri>
|
<rulesUri>file://${session.executionRootDirectory}/version-rules.xml</rulesUri>
|
||||||
</configuration>
|
</configuration>
|
||||||
@@ -139,19 +202,19 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>3.9.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!--Sonarqube-->
|
<!--Sonarqube-->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||||
<artifactId>sonar-maven-plugin</artifactId>
|
<artifactId>sonar-maven-plugin</artifactId>
|
||||||
<version>5.1.0.4751</version>
|
<version>5.5.0.6356</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
<version>0.8.13</version>
|
<version>0.8.14</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>jacoco-initialize</id>
|
<id>jacoco-initialize</id>
|
||||||
@@ -172,7 +235,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.owasp</groupId>
|
<groupId>org.owasp</groupId>
|
||||||
<artifactId>dependency-check-maven</artifactId>
|
<artifactId>dependency-check-maven</artifactId>
|
||||||
<version>12.1.1</version>
|
<version>12.2.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>none</phase>
|
<phase>none</phase>
|
||||||
@@ -187,6 +250,8 @@
|
|||||||
<format>html</format>
|
<format>html</format>
|
||||||
</formats>
|
</formats>
|
||||||
<nvdApiServerId>nvd</nvdApiServerId>
|
<nvdApiServerId>nvd</nvdApiServerId>
|
||||||
|
<failBuildOnCVSS>7</failBuildOnCVSS>
|
||||||
|
<ossIndexServerId>ossindex</ossIndexServerId>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
@@ -194,29 +259,27 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.sonatype.central</groupId>
|
<groupId>org.sonatype.central</groupId>
|
||||||
<artifactId>central-publishing-maven-plugin</artifactId>
|
<artifactId>central-publishing-maven-plugin</artifactId>
|
||||||
<version>0.7.0</version>
|
<version>0.10.0</version>
|
||||||
<extensions>true</extensions>
|
<extensions>true</extensions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<publishingServerId>ossrh</publishingServerId>
|
<publishingServerId>central</publishingServerId>
|
||||||
|
<autoPublish>true</autoPublish>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.sonatype.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
<version>1.7.0</version>
|
<version>3.1.4</version>
|
||||||
<extensions>true</extensions>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<serverId>ossrh</serverId>
|
<skip>true</skip>
|
||||||
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
|
|
||||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
<version>3.3.1</version>
|
<version>3.4.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>attach-sources</id>
|
<id>attach-sources</id>
|
||||||
@@ -230,7 +293,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.11.2</version>
|
<version>3.12.0</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>attach-javadocs</id>
|
<id>attach-javadocs</id>
|
||||||
@@ -244,20 +307,9 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
<artifactId>maven-gpg-plugin</artifactId>
|
||||||
<version>3.2.7</version>
|
<version>3.2.8</version>
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>sign-artifacts</id>
|
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>sign</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<keyname>${gpg.keyname}</keyname>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
//JavaClasses/src/main/java/mattrixwv/Exceptions/InvalidResult.java
|
|
||||||
//Matthew Ellison
|
|
||||||
// Created: 08-24-20
|
|
||||||
//Modified: 08-11-24
|
|
||||||
//This is an exception for an invalid result out of one of my algorithms
|
|
||||||
package com.mattrixwv.exceptions;
|
package com.mattrixwv.exceptions;
|
||||||
|
|
||||||
|
|
||||||
@@ -17,6 +12,11 @@ package com.mattrixwv.exceptions;
|
|||||||
* @see RuntimeException
|
* @see RuntimeException
|
||||||
*/
|
*/
|
||||||
public class InvalidResult extends RuntimeException{
|
public class InvalidResult extends RuntimeException{
|
||||||
|
/**
|
||||||
|
* Serialization identifier for this class
|
||||||
|
*/
|
||||||
|
public static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new runtime exception with {@code null} as its detail message.
|
* Constructs a new runtime exception with {@code null} as its detail message.
|
||||||
* The cause is not initialized and may subsequently be initialized by a call to {@link #initCause}.
|
* The cause is not initialized and may subsequently be initialized by a call to {@link #initCause}.
|
||||||
|
|||||||
@@ -1,28 +1,7 @@
|
|||||||
//JavaClasses/src/test/java/com/mattrixwv/TestTriple.java
|
|
||||||
//Mattrixwv
|
|
||||||
// Created: 08-20-22
|
|
||||||
//Modified: 04-13-23
|
|
||||||
/*
|
|
||||||
Copyright (C) 2023 Matthew Ellison
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
package com.mattrixwv;
|
package com.mattrixwv;
|
||||||
|
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@@ -40,6 +19,8 @@ public class TestTriple{
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testConstructor(){
|
public void testConstructor(){
|
||||||
|
triple = new Triple<>(1L, 2L, 3L);
|
||||||
|
|
||||||
assertEquals(1L, triple.getA());
|
assertEquals(1L, triple.getA());
|
||||||
assertEquals(2L, triple.getB());
|
assertEquals(2L, triple.getB());
|
||||||
assertEquals(3L, triple.getC());
|
assertEquals(3L, triple.getC());
|
||||||
|
|||||||
Reference in New Issue
Block a user