test de la classe commande
This commit is contained in:
parent
8f366b4003
commit
926b12ec55
@ -48,7 +48,8 @@ javac.source=21
|
|||||||
javac.target=21
|
javac.target=21
|
||||||
javac.test.classpath=\
|
javac.test.classpath=\
|
||||||
${javac.classpath}:\
|
${javac.classpath}:\
|
||||||
${build.classes.dir}
|
${build.classes.dir}:\
|
||||||
|
${libs.testng.classpath}
|
||||||
javac.test.modulepath=\
|
javac.test.modulepath=\
|
||||||
${javac.modulepath}
|
${javac.modulepath}
|
||||||
javac.test.processorpath=\
|
javac.test.processorpath=\
|
||||||
|
52
test/métiers/CommandeNGTest.java
Normal file
52
test/métiers/CommandeNGTest.java
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/UnitTests/EmptyTestNGTest.java to edit this template
|
||||||
|
*/
|
||||||
|
package métiers;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import static org.testng.Assert.*;
|
||||||
|
import org.testng.annotations.BeforeMethod;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author ines.benalia
|
||||||
|
*/
|
||||||
|
public class CommandeNGTest {
|
||||||
|
|
||||||
|
public CommandeNGTest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeMethod
|
||||||
|
public void setUpMethod() throws Exception {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAjouter() {
|
||||||
|
System.out.println("ajouter");
|
||||||
|
Instrument instr2=new Instrument(2,"Violon",9, 105f);
|
||||||
|
// Instrument instr3=new Instrument(3,"Guitare",8, 575f);
|
||||||
|
Commande laCommande = new Commande(1,1,"12/09/2024");
|
||||||
|
boolean expResult = true;
|
||||||
|
boolean result = laCommande.ajouter(instr2, 5);
|
||||||
|
|
||||||
|
assertEquals(result, expResult);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSupprimer() {
|
||||||
|
System.out.println("supprimer");
|
||||||
|
Instrument unInstrument = null;
|
||||||
|
Commande instance = null;
|
||||||
|
boolean expResult = false;
|
||||||
|
boolean result = instance.supprimer(unInstrument);
|
||||||
|
assertEquals(result, expResult);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
82
test/métiers/EntrepriseNGTest.java
Normal file
82
test/métiers/EntrepriseNGTest.java
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/UnitTests/EmptyTestNGTest.java to edit this template
|
||||||
|
*/
|
||||||
|
package métiers;
|
||||||
|
|
||||||
|
import static org.testng.Assert.*;
|
||||||
|
import org.testng.annotations.BeforeMethod;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author ines.benalia
|
||||||
|
*/
|
||||||
|
public class EntrepriseNGTest {
|
||||||
|
|
||||||
|
public EntrepriseNGTest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeMethod
|
||||||
|
public void setUpMethod() throws Exception {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetRaisonSociale() {
|
||||||
|
System.out.println("getRaisonSociale");
|
||||||
|
Entreprise instance = null;
|
||||||
|
String expResult = "";
|
||||||
|
String result = instance.getRaisonSociale();
|
||||||
|
assertEquals(result, expResult);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSetRaisonSociale() {
|
||||||
|
System.out.println("setRaisonSociale");
|
||||||
|
String raisonSociale = "";
|
||||||
|
Entreprise instance = null;
|
||||||
|
instance.setRaisonSociale(raisonSociale);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testToString() {
|
||||||
|
System.out.println("toString");
|
||||||
|
Entreprise instance = null;
|
||||||
|
String expResult = "";
|
||||||
|
String result = instance.toString();
|
||||||
|
assertEquals(result, expResult);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAjouterCommande() {
|
||||||
|
System.out.println("ajouterCommande");
|
||||||
|
Commande uneCommande = null;
|
||||||
|
Entreprise instance = null;
|
||||||
|
instance.ajouterCommande(uneCommande);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSupprimerCommande() {
|
||||||
|
System.out.println("supprimerCommande");
|
||||||
|
Commande uneCommande = null;
|
||||||
|
Entreprise instance = null;
|
||||||
|
instance.supprimerCommande(uneCommande);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRechercherCommande() {
|
||||||
|
System.out.println("rechercherCommande");
|
||||||
|
int noCom = 0;
|
||||||
|
Entreprise instance = null;
|
||||||
|
Commande expResult = null;
|
||||||
|
Commande result = instance.rechercherCommande(noCom);
|
||||||
|
assertEquals(result, expResult);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
110
test/métiers/InstrumentNGTest.java
Normal file
110
test/métiers/InstrumentNGTest.java
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||||
|
* Click nbfs://nbhost/SystemFileSystem/Templates/UnitTests/EmptyTestNGTest.java to edit this template
|
||||||
|
*/
|
||||||
|
package métiers;
|
||||||
|
|
||||||
|
import static org.testng.Assert.*;
|
||||||
|
import org.testng.annotations.BeforeMethod;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author ines.benalia
|
||||||
|
*/
|
||||||
|
public class InstrumentNGTest {
|
||||||
|
|
||||||
|
public InstrumentNGTest() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@BeforeMethod
|
||||||
|
public void setUpMethod() throws Exception {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testToString() {
|
||||||
|
System.out.println("toString");
|
||||||
|
Instrument instance = null;
|
||||||
|
String expResult = "";
|
||||||
|
String result = instance.toString();
|
||||||
|
assertEquals(result, expResult);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSetRef() {
|
||||||
|
System.out.println("setRef");
|
||||||
|
int ref = 0;
|
||||||
|
Instrument instance = null;
|
||||||
|
instance.setRef(ref);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSetDesignation() {
|
||||||
|
System.out.println("setDesignation");
|
||||||
|
String designation = "";
|
||||||
|
Instrument instance = null;
|
||||||
|
instance.setDesignation(designation);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSetQteStock() {
|
||||||
|
System.out.println("setQteStock");
|
||||||
|
int qteStock = 0;
|
||||||
|
Instrument instance = null;
|
||||||
|
instance.setQteStock(qteStock);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSetPrix() {
|
||||||
|
System.out.println("setPrix");
|
||||||
|
float prix = 0.0F;
|
||||||
|
Instrument instance = null;
|
||||||
|
instance.setPrix(prix);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetRef() {
|
||||||
|
System.out.println("getRef");
|
||||||
|
Instrument instance = null;
|
||||||
|
int expResult = 0;
|
||||||
|
int result = instance.getRef();
|
||||||
|
assertEquals(result, expResult);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetDesignation() {
|
||||||
|
System.out.println("getDesignation");
|
||||||
|
Instrument instance = null;
|
||||||
|
String expResult = "";
|
||||||
|
String result = instance.getDesignation();
|
||||||
|
assertEquals(result, expResult);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetQteStock() {
|
||||||
|
System.out.println("getQteStock");
|
||||||
|
Instrument instance = null;
|
||||||
|
int expResult = 0;
|
||||||
|
int result = instance.getQteStock();
|
||||||
|
assertEquals(result, expResult);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetPrix() {
|
||||||
|
System.out.println("getPrix");
|
||||||
|
Instrument instance = null;
|
||||||
|
float expResult = 0.0F;
|
||||||
|
float result = instance.getPrix();
|
||||||
|
assertEquals(result, expResult, 0.0);
|
||||||
|
fail("The test case is a prototype.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
27
test/métiers/MétiersSuite.xml
Normal file
27
test/métiers/MétiersSuite.xml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8' ?>
|
||||||
|
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
|
||||||
|
<suite name="MusicAndCo">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
see examples at http://testng.org/doc/documentation-main.html#testng-xml
|
||||||
|
|
||||||
|
<suite-files>
|
||||||
|
<suite-file path="./junit-suite.xml" />
|
||||||
|
</suite-files>
|
||||||
|
|
||||||
|
<test name="TimeOut">
|
||||||
|
<classes>
|
||||||
|
<class name="test.timeout.TimeOutTest" />
|
||||||
|
<class name="test.timeout.TimeOutFromXmlTest"/>
|
||||||
|
<class name="test.timeout.TimeOutThreadLocalSampleTest"/>
|
||||||
|
</classes>
|
||||||
|
</test>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<test name="métiers suite">
|
||||||
|
<packages>
|
||||||
|
<package name="métiers"/>
|
||||||
|
</packages>
|
||||||
|
</test>
|
||||||
|
|
||||||
|
</suite>
|
Loading…
x
Reference in New Issue
Block a user