Compare commits
9 Commits
6bcc94486f
...
09a7279d52
Author | SHA1 | Date | |
---|---|---|---|
|
09a7279d52 | ||
|
c000fb78ee | ||
|
b109399da5 | ||
|
08e7254265 | ||
|
6472118666 | ||
|
8b82fb5acd | ||
|
a8cd335fa6 | ||
|
7136c719cc | ||
|
926b12ec55 |
@ -1,98 +1,99 @@
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processor.options=
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.modulepath=\
|
||||
${run.modulepath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
debug.test.modulepath=\
|
||||
${run.test.modulepath}
|
||||
# Files in build.classes.dir which should be excluded from distribution jar
|
||||
dist.archive.excludes=
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/MusicAndCo.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
dist.jlink.dir=${dist.dir}/jlink
|
||||
dist.jlink.output=${dist.jlink.dir}/MusicAndCo
|
||||
excludes=
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=\ --enable-preview --enable-preview
|
||||
javac.deprecation=false
|
||||
javac.external.vm=true
|
||||
javac.modulepath=
|
||||
javac.processormodulepath=
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=21
|
||||
javac.target=21
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}:\
|
||||
${libs.junit_5.classpath}:\
|
||||
${libs.junit_4.classpath}:\
|
||||
${libs.hamcrest.classpath}
|
||||
javac.test.modulepath=\
|
||||
${javac.modulepath}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.html5=false
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
# The jlink additional root modules to resolve
|
||||
jlink.additionalmodules=
|
||||
# The jlink additional command line parameters
|
||||
jlink.additionalparam=
|
||||
jlink.launcher=true
|
||||
jlink.launcher.name=MusicAndCo
|
||||
main.class=Test
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=default_platform
|
||||
run.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
# Space-separated list of JVM arguments used when running the project.
|
||||
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||
run.jvmargs=\ --enable-preview
|
||||
run.modulepath=\
|
||||
${javac.modulepath}
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
run.test.modulepath=\
|
||||
${javac.test.modulepath}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processor.options=
|
||||
annotation.processing.processors.list=
|
||||
annotation.processing.run.all.processors=true
|
||||
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||||
build.classes.dir=${build.dir}/classes
|
||||
build.classes.excludes=**/*.java,**/*.form
|
||||
# This directory is removed when the project is cleaned:
|
||||
build.dir=build
|
||||
build.generated.dir=${build.dir}/generated
|
||||
build.generated.sources.dir=${build.dir}/generated-sources
|
||||
# Only compile against the classpath explicitly listed here:
|
||||
build.sysclasspath=ignore
|
||||
build.test.classes.dir=${build.dir}/test/classes
|
||||
build.test.results.dir=${build.dir}/test/results
|
||||
# Uncomment to specify the preferred debugger connection transport:
|
||||
#debug.transport=dt_socket
|
||||
debug.classpath=\
|
||||
${run.classpath}
|
||||
debug.modulepath=\
|
||||
${run.modulepath}
|
||||
debug.test.classpath=\
|
||||
${run.test.classpath}
|
||||
debug.test.modulepath=\
|
||||
${run.test.modulepath}
|
||||
# Files in build.classes.dir which should be excluded from distribution jar
|
||||
dist.archive.excludes=
|
||||
# This directory is removed when the project is cleaned:
|
||||
dist.dir=dist
|
||||
dist.jar=${dist.dir}/MusicAndCo.jar
|
||||
dist.javadoc.dir=${dist.dir}/javadoc
|
||||
dist.jlink.dir=${dist.dir}/jlink
|
||||
dist.jlink.output=${dist.jlink.dir}/MusicAndCo
|
||||
excludes=
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=\ --enable-preview --enable-preview
|
||||
javac.deprecation=false
|
||||
javac.external.vm=true
|
||||
javac.modulepath=
|
||||
javac.processormodulepath=
|
||||
javac.processorpath=\
|
||||
${javac.classpath}
|
||||
javac.source=21
|
||||
javac.target=21
|
||||
javac.test.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}:\
|
||||
${libs.testng.classpath}:\
|
||||
${libs.junit_5.classpath}:\
|
||||
${libs.junit_4.classpath}:\
|
||||
${libs.hamcrest.classpath}
|
||||
javac.test.modulepath=\
|
||||
${javac.modulepath}
|
||||
javac.test.processorpath=\
|
||||
${javac.test.classpath}
|
||||
javadoc.additionalparam=
|
||||
javadoc.author=false
|
||||
javadoc.encoding=${source.encoding}
|
||||
javadoc.html5=false
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
# The jlink additional root modules to resolve
|
||||
jlink.additionalmodules=
|
||||
# The jlink additional command line parameters
|
||||
jlink.additionalparam=
|
||||
jlink.launcher=true
|
||||
jlink.launcher.name=MusicAndCo
|
||||
main.class=Test
|
||||
manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
platform.active=default_platform
|
||||
run.classpath=\
|
||||
${javac.classpath}:\
|
||||
${build.classes.dir}
|
||||
# Space-separated list of JVM arguments used when running the project.
|
||||
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
|
||||
# To set system properties for unit tests define test-sys-prop.name=value:
|
||||
run.jvmargs=\ --enable-preview
|
||||
run.modulepath=\
|
||||
${javac.modulepath}
|
||||
run.test.classpath=\
|
||||
${javac.test.classpath}:\
|
||||
${build.test.classes.dir}
|
||||
run.test.modulepath=\
|
||||
${javac.test.modulepath}
|
||||
source.encoding=UTF-8
|
||||
src.dir=src
|
||||
test.src.dir=test
|
||||
|
@ -19,16 +19,20 @@ public class Test {
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
Entreprise lEntreprise=new Entreprise("MusicAndCo");
|
||||
Instrument instr1=new Instrument(1,"Piano",10, 8300f);
|
||||
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");
|
||||
lEntreprise.ajouterCommande(laCommande);
|
||||
Commande laCommande1 = new Commande(1,1,"12/09/2024");
|
||||
|
||||
//Test Cas0-Ajouter à la commande une ligne de 2 instr1
|
||||
System.out.println("Résultat de l'ajout de 2 instr1 à la commande :" + laCommande.ajouter(instr1, 2) );
|
||||
System.out.println("Nouveau stock de instr1 : "+instr1.getQteStock());
|
||||
System.out.println("Quantité de la ligne de commande de instr1 :"+laCommande.getLesLignes().get(instr1));
|
||||
//ajouter des instruments de l'entreprise à la commande
|
||||
|
||||
//affecter la commande à l'entreprise si la comamnde est possible
|
||||
lEntreprise.ajouterCommande(laCommande1);
|
||||
|
||||
//créer une autre commande
|
||||
|
||||
|
||||
//rechercher et afficher une commande
|
||||
|
||||
|
||||
//supprimer une des 2 commande
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,8 @@
|
||||
package métiers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import métiers.Commande;
|
||||
import métiers.Instrument;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -14,9 +16,16 @@ public class Entreprise {
|
||||
private String raisonSociale;
|
||||
private ArrayList<Commande> lesCommandes = new ArrayList<>();
|
||||
private ArrayList<Instrument> lesInstruments = new ArrayList<>();
|
||||
|
||||
|
||||
public Entreprise(String raisonSociale) {
|
||||
this.raisonSociale = raisonSociale;
|
||||
|
||||
Instrument instr1=new Instrument(23,"Piano droit",3, 8300f);
|
||||
Instrument instr2=new Instrument(54,"Violon Alto",5, 105f);
|
||||
Instrument instr3=new Instrument(67,"Guitare Classique",8, 575f);
|
||||
lesInstruments.add(instr3);
|
||||
lesInstruments.add(instr2);
|
||||
lesInstruments.add(instr1);
|
||||
}
|
||||
|
||||
public String getRaisonSociale() {
|
||||
@ -38,6 +47,9 @@ public class Entreprise {
|
||||
}
|
||||
|
||||
public void supprimerCommande(Commande uneCommande){
|
||||
//parcours pour supprimer les instruments de la commande
|
||||
|
||||
//suppression de la commande
|
||||
lesCommandes.remove(uneCommande);
|
||||
}
|
||||
|
||||
|
@ -5,9 +5,7 @@
|
||||
package métiers;
|
||||
|
||||
import java.util.HashMap;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
@ -18,14 +16,14 @@ public class CommandeTest {
|
||||
public CommandeTest() {
|
||||
}
|
||||
|
||||
@Before
|
||||
|
||||
public void setUp() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of ajouter method, of class Commande.
|
||||
*/
|
||||
@Test
|
||||
|
||||
public void testAjouter() {
|
||||
Instrument instr1=new Instrument(1,"Piano",10, 8300f);
|
||||
Instrument instr2=new Instrument(2,"Violon",9, 105f);
|
||||
@ -109,6 +107,14 @@ public class CommandeTest {
|
||||
assertEquals("test6 stock",stockAttendu,stockRes );
|
||||
}
|
||||
|
||||
private void assertEquals(String test1_taille, int tailleAttendue, int tailleR) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
private void assertEquals(String la_méthode_ajouter_retourne_false, boolean testResultExpected, boolean test) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test of supprimer method, of class Commande.
|
||||
|
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