Skip to content

Instantly share code, notes, and snippets.

View FranckSilvestre's full-sized avatar

Franck Silvestre FranckSilvestre

View GitHub Profile
@FranckSilvestre
FranckSilvestre / index.html
Created April 4, 2019 13:38
Template HTML pour application "myactivities"
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<style>
#activities {
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
@FranckSilvestre
FranckSilvestre / ZEvaluationLPMMSTest.java
Created January 24, 2019 07:51
Classe de test TP noté LPMMS 2018-2019
package ourbusinessproject;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.junit4.SpringRunner;
@FranckSilvestre
FranckSilvestre / ENONCE.md
Created January 24, 2019 07:50
Enonce TP noté LPMMS 2019-2019

Introduction

Récupérez le contenu du fichier "ZEvaluationLPMMSTest.java" disponible à l'adresse suivante et insérez le dans votre fichier "ZEvaluationLPMMSTest.java". Étudiez le code de la classe "ZEvaluationLPMMSTest". Votre travail consistera à faire en sorte que tous les tests commentés de cette classe passent en plus de tous les autres.

Partie 1 - Gestion améliorée de la sauvegarde des objets métiers (7 points)

Cette partie vise à évaluer votre capacité à faire un bon usage de la méthode "EntityManager.merge(...)".

@FranckSilvestre
FranckSilvestre / DatabaseUser.java
Created November 29, 2018 13:36 — forked from handakumbura/DatabaseUser.java
JDBC usage example.
package com.dumiduh;
import java.sql.Statement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
public class DatabaseUser {
private Connection connectionObj;
private Statement statementObj;
@FranckSilvestre
FranckSilvestre / my_activities_users.sql
Created October 30, 2018 13:05
SQL file to fill the "users" table.
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('bobdeniro', 1, 'bobdeniro@hollywood.com', 1);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('eliseB', 2, 'eliseb@ihm.com', 1);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('arthurH', 3, 'arthurH@michelin.com', 1);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('wandaL', 4, 'wandal@lalaland.com', 2);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('paulsimon', 5, 'paulsimon@guitare.org', 2);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('jessicaA', 6, 'jessicaa@hollywood.com', 2);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('steveM', 7, 'stevem@cars.com', 2);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('evaM', 8, 'evam@movieland.com', 2);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('alpacino', 9, 'alpacino@moviecountry.co
@FranckSilvestre
FranckSilvestre / TestBowlingWithUnittest.py
Created January 21, 2018 09:21
Tests du calcul du score d'une partie de bowling avec framework de tests
import unittest
import Bowling
class TestBowlingWithUnittest(unittest.TestCase):
def setUp(self):
self.strike = (10, 0)
self.spare_0_10 = (0, 10)
self.spare_5_5 = (5, 5)
@FranckSilvestre
FranckSilvestre / TestBowling.py
Created January 21, 2018 09:19
Tests du calcule du score d'une partie de bowling sans framework de test
from Bowling import *
# Ce fichier contient les fonctions permettant de tester les fonctions que vous devez écrire dans le fichier "Bowling.py"
# Ces fonctions de tests spécifient d'une part les structures de données que vous devez utiliser mais aussi les fonctions
# que vous devez implanter.
#
# Fonction lançant l'ensemble des fonctions de tests implantées dans la suite du fichier
#
def run_tests():
@FranckSilvestre
FranckSilvestre / EnterpriseProjectServiceIntegrationTest.java
Created November 11, 2017 14:55
Master 2DL - Spring Boot - Update to be compliant with "merge & refresh" approach
package ourbusinessproject;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.transaction.Transactional;
package ourbusinessproject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
package ourbusinessproject;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit4.SpringRunner;
import static org.mockito.ArgumentMatchers.isNull;