Skip to content
Snippets Groups Projects
Commit 38459e29 authored by Denis Arrivault's avatar Denis Arrivault
Browse files

Update doc and pages with doc and jar

parent ca953e2e
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -43,6 +43,8 @@ pages:
- mkdir -p public/ && cp -r index.html public/
- mkdir -p public/Tests_Results && cp -r build/reports/tests/test/* public/Tests_Results/
- mkdir -p public/Jacoco && cp -r build/jacocoHtml/* public/Jacoco/
- mkdir -p public/Javadoc && cp -r build/docs/* public/Javadoc/
- cp -r build/libs/ImmutableComplex-1.0.0.jar public/
artifacts:
paths:
- public
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -9,39 +9,26 @@ jacoco {
version = '1.0.0'
applicationName = "ImmutableComplex"
mainClassName = "main.java.Main"
mainClassName = "Main"
repositories {
jcenter()
//flatDir {dirs 'lib'}
}
dependencies {
//compile "hamcrest:hamcrest-all:1.3"
testCompile "junit:junit:4.11"
// testCompile name: 'junit-4.11'
testCompile "junit:junit:4+"
}
// Local path for Maven depository
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}
// Local installation task.
//'installDir' is property that should be defined with : "gradle installLocally -PinstallDir="/install/path""
task installLocally(type: Copy){
from installDist
into project.hasProperty('installDir') ? file(project.getProperty('installDir')) : file('install')
}
installLocally.onlyIf {
project.hasProperty('installDir')
// Specify the jar manifest to make it executable
jar {
manifest {
attributes 'Implementation-Title': applicationName,
'Implementation-Version': version,
'Main-Class': mainClassName
}
}
// Jacoco configuration
jacocoTestReport {
reports {
xml.enabled false
......
......@@ -7,6 +7,8 @@
<ul>
<li><a href="http://denis.arrivault.pages.lis-lab.fr/Test_Project/Tests_Results/">See the unit tests report</a></li>
<li><a href="http://denis.arrivault.pages.lis-lab.fr/Test_Project/Jacoco/">See the Jacoco coverage report</a></li>
<li><a href="http://denis.arrivault.pages.lis-lab.fr/Test_Project/Javadoc/">See the javadoc</a></li>
<li><a href="http://denis.arrivault.pages.lis-lab.fr/ImmutableComplex-1.0.0.jar" download="ImmutableComplex-1.0.0.jar">Download the executable jar</a>
</ul>
</body>
</html>
\ No newline at end of file
/**
* Complex class file
*/
package main.java;
/**
......@@ -20,30 +20,55 @@ public final class Complex {
this.im = im;
}
//Accessors without mutator
/**
* Accessor on real part
* @return double real part
*/
public double realPart(){return re;}
/**
* Accessor on imaginary part
* @return double imaginary part
*/
public double imaginaryPart(){return im;}
//Arithmetic operators
/**
* Arithmetic operator : addition
* @param c complex to add to this
* @return Complex this + c
*/
public Complex add(Complex c){
return new Complex(re + c.re, im + c.im);
}
/**
* Arithmetic operator : substraction
* @param c complex to substract from this
* @return Complex this - c
*/
public Complex subtract(Complex c){
return new Complex(re - c.re, im - c.im);
}
/**
* Arithmetic operator : multiplication
* @param c complex to multiply by this
* @return Complex this * c
*/
public Complex multiply(Complex c){
return new Complex(re * c.re - im * c.im, re * c.im + im * c.re);
}
/**
* Arithmetic operator : division
* @param c complex that divides this
* @return Complex this / c
*/
public Complex divide(Complex c){
double tmp = c.re * c.re + c.im * c.im;
return new Complex((re * c.re + im * c.im) / tmp,
(im * c.re - re * c.im) / tmp);
}
//Comparison operator
@Override
public boolean equals(Object o){
if (o == this)
......@@ -68,13 +93,16 @@ public final class Complex {
return (int) (longBits ^ (longBits >>> 32));
}
//Display
@Override
public String toString() {
return "(" + re + " + " + im + "i)";
}
//Conjugate
/**
* Return the conjugate of this
* @return Complex cojugate of this
*/
public Complex conj(){
return new Complex(re,-im);
}
......
package main.java;
public class Main {
......
/**
* Test file for Complex class
*/
package test.java;
import org.junit.Assert;
......@@ -11,8 +10,6 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import main.java.Complex;
/**
* Junit test case for my immutable complex class.
* @author arrivault
......@@ -41,7 +38,7 @@ public class ComplexTest {
}
/**
* Test method for {@link main.java.Complex#Complex(double, double)}.
* Test method for {@link Complex#Complex(double, double)}.
*/
@Test
public final void testComplex() {
......@@ -51,7 +48,7 @@ public class ComplexTest {
}
/**
* Test method for {@link main.java.Complex#realPart()}.
* Test method for {@link Complex#realPart()}.
*/
@Test
public final void testRealPart() {
......@@ -62,7 +59,7 @@ public class ComplexTest {
}
/**
* Test method for {@link main.java.Complex#imaginaryPart()}.
* Test method for {@link Complex#imaginaryPart()}.
*/
@Test
public final void testImaginaryPart() {
......@@ -73,7 +70,7 @@ public class ComplexTest {
}
/**
* Test method for {@link main.java.Complex#add(main.java.Complex)}.
* Test method for {@link Complex#add(Complex)}.
*/
@Test
public final void testAdd() {
......@@ -90,7 +87,7 @@ public class ComplexTest {
}
/**
* Test method for {@link main.java.Complex#subtract(main.java.Complex)}.
* Test method for {@link Complex#subtract(Complex)}.
*/
@Test
public final void testSubtract() {
......@@ -107,7 +104,7 @@ public class ComplexTest {
}
/**
* Test method for {@link main.java.Complex#multiply(main.java.Complex)}.
* Test method for {@link Complex#multiply(Complex)}.
*/
@Test
public final void testMulptiply() {
......@@ -124,7 +121,7 @@ public class ComplexTest {
}
/**
* Test method for {@link main.java.Complex#divide(main.java.Complex)}.
* Test method for {@link Complex#divide(Complex)}.
*/
@Test
public final void testDivide() {
......@@ -147,7 +144,7 @@ public class ComplexTest {
}
/**
* Test method for {@link main.java.Complex#equals(java.lang.Object)}.
* Test method for {@link Complex#equals(java.lang.Object)}.
*/
@Test
public final void testEqualsObject() {
......@@ -161,7 +158,7 @@ public class ComplexTest {
}
/**
* Test method for {@link main.java.Complex#toString()}.
* Test method for {@link Complex#toString()}.
*/
@Test
public final void testToString() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment