Commit a1afeeaa authored by HARMAND Frederic's avatar HARMAND Frederic
Browse files

Merci Ubuntu 19.10

parent 76cd3cad
# Created by https://www.gitignore.io/api/gradle
# Android built artifacts
*.apk
*.ap_
*.dex
### Gradle ###
.gradle
/build/
# Java build artifacts class files
*.class
# Ignore Gradle GUI config
gradle-app.setting
# other generated files
bin/
gen/
build/
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# local configuration file (for Android sdk path, etc)
local.properties
# Cache of project
.gradletasknamecache
# OSX files
.DS_Store
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
# Eclipse project files
.classpath
.project
### Gradle Patch ###
**/build/
# Android Studio
*.iml
.idea
.gradle
# End of https://www.gitignore.io/api/gradle
#NDK
obj/
# Gradle Bootstrap
The goal of this project is to allow users to easily bootstrap their gradle project without requiring they have locally their own gradle installation.
This project only contains the gradle wrapper (and git ignore rules related to gradle).
It was been generated using ``gradle wrapper``command.
HARMAND Frédéric
frederic.harmand@telecomnancy.eu
The goal of this project is to allow users to easily bootstrap their gradle project without requiring they have locally their own gradle installation.
Remerciements spéciaux à la mise à niveau d'Ubuntu 19.10 qui a fait planter la première version de ce projet.
Que mes commits reposent en paix.
\ No newline at end of file
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.6.2/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building a CLI application
id 'application'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is used by the application.
implementation 'com.google.guava:guava:28.0-jre'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.0'
}
application {
// Define the main class for the application
mainClassName = 'eu.telecomnancy.App'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed", "standardError"//, "standardOut"
}
}
jar {
manifest {
attributes "Main-Class": "eu.telecomnancy.App"
}
}
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/5.6.2/userguide/multi_project_builds.html
*/
rootProject.name = 'pcd'
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package eu.telecomnancy;
public class App {
public static void main(String[] args) {
Student s1 = new Student("Niko", 0);
Student s2 = new Student("Luka", 1);
System.out.println(s1.toString());
System.out.println(s2.toString());
}
}
package eu.telecomnancy;
public class Student {
private String name;
private int id;
public Student(String n, int i){
this.name = n;
this.id = i;
}
public String getName(){
return this.name;
}
public int getId(){
return this.id;
}
public void setName(String n){
this.name = n;
}
public void setId(int i){
this.id = i;
}
public String toString(){
return ("Student: " + this.name + " ; " + this.id);
}
public boolean equals(Student s){
return (this.name == s.getName() && this.id == s.getId());
}
}
package eu.telecomnancy;
import eu.telecomnancy.*;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class StudentTest {
@Test
public void testGet(){
Student s1 = new Student("Niko", 0);
assertEquals("Niko", s1.getName());
assertEquals(0, s1.getId());
}
@Test
public void testSet(){
Student s1 = new Student("Niko", 0);
s1.setName("Luka");
s1.setId(1);
assertEquals("Luka", s1.getName());
assertEquals(1, s1.getId());
}
@Test
public void testToString(){
Student s1 = new Student("Niko", 0);
assertEquals("Student: Niko ; 0", s1.toString());
}
@Test
public void testEquals(){
Student s1 = new Student("Niko", 0);
Student s2 = new Student("Luka", 1);
assertEquals(false, s1.equals(s2));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment