Skip to content

Instantly share code, notes, and snippets.

View FranckSilvestre's full-sized avatar

Franck Silvestre FranckSilvestre

View GitHub Profile
@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, '[email protected]', 1);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('eliseB', 2, '[email protected]', 1);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('arthurH', 3, '[email protected]', 1);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('wandaL', 4, '[email protected]', 2);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('paulsimon', 5, '[email protected]', 2);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('jessicaA', 6, '[email protected]', 2);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('steveM', 7, '[email protected]', 2);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('evaM', 8, '[email protected]', 2);
INSERT INTO my_activities.users (username, id, email, status_id) VALUES ('alpacino', 9, '[email protected]
@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;
@FranckSilvestre
FranckSilvestre / PartnershipServiceIntegrationTest.java
Last active April 12, 2021 13:46
Master 2 DL - Java / Spring Boot
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;
@FranckSilvestre
FranckSilvestre / BootstrapTest.java
Created October 30, 2017 10:06
Master 2 DL - Java / Spring Boot
package ourbusinessproject;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.mockito.BDDMockito.*;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit4.SpringRunner;
import static org.hamcrest.core.Is.*;
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;