File tree Expand file tree Collapse file tree 12 files changed +41
-22
lines changed
Expand file tree Collapse file tree 12 files changed +41
-22
lines changed Original file line number Diff line number Diff line change 1313 </classpathentry >
1414 <classpathentry kind =" src" output =" target/test-classes" path =" src/test/java" >
1515 <attributes >
16+ <attribute name =" test" value =" true" />
1617 <attribute name =" optional" value =" true" />
1718 <attribute name =" maven.pomderived" value =" true" />
18- <attribute name =" test" value =" true" />
1919 </attributes >
2020 </classpathentry >
2121 <classpathentry excluding =" **" kind =" src" output =" target/test-classes" path =" src/test/resources" >
2222 <attributes >
23- <attribute name =" maven.pomderived" value =" true" />
2423 <attribute name =" test" value =" true" />
24+ <attribute name =" maven.pomderived" value =" true" />
2525 </attributes >
2626 </classpathentry >
2727 <classpathentry kind =" con" path =" org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5" >
2828 <attributes >
29+ <attribute name =" module" value =" true" />
2930 <attribute name =" maven.pomderived" value =" true" />
3031 </attributes >
3132 </classpathentry >
32- <classpathentry kind =" con" path =" org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" >
33+ <classpathentry exported = " true " kind =" con" path =" org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" >
3334 <attributes >
3435 <attribute name =" maven.pomderived" value =" true" />
3536 </attributes >
3637 </classpathentry >
37- <classpathentry kind =" con" path =" org.eclipse.jdt.junit.JUNIT_CONTAINER/4" />
38+ <classpathentry exported = " true " kind =" con" path =" org.eclipse.jdt.junit.JUNIT_CONTAINER/4" />
3839 <classpathentry kind =" output" path =" target/classes" />
3940</classpath >
Original file line number Diff line number Diff line change 33 <groupId >es.uca.dss.cruca</groupId >
44 <artifactId >projectcruca</artifactId >
55 <version >0.0.1-SNAPSHOT</version >
6+ <packaging >jar</packaging >
67 <name >CRUCA</name >
78 <description >Management software for the restaurants and cafes at UCA.</description >
89
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public class Cafeteria
1111 public ArrayList <Order > dailyOrders ;
1212 public OrderFactory ordFact ;
1313
14- Cafeteria ()
14+ public Cafeteria ()
1515 {
1616 productStock = new LinkedHashMap <Product , Integer >();
1717 ordFact = new OrderFactory ();
Original file line number Diff line number Diff line change @@ -22,10 +22,11 @@ public static int getOrderCount()
2222 */
2323 public static Order createOrder ()
2424 {
25- // We are increasing the number so that they are correlative
26- return new OrderImpl (orderCount ++, new Date (System .currentTimeMillis ()));
27-
25+ return createOrder (new Date (System .currentTimeMillis ()));
2826 }
2927
30-
28+ public static Order createOrder (Date creationDate )
29+ {
30+ return new OrderImpl (orderCount ++, creationDate );
31+ }
3132}
Original file line number Diff line number Diff line change 1- package coreapi ;
1+ package coreapiTest ;
2+
3+ import coreapi .*;
24
35import org .junit .runner .RunWith ;
46import org .junit .runners .Suite ;
Original file line number Diff line number Diff line change 1- package coreapi ;
2-
3- import org .junit .Assert ;
1+ package coreapiTest ;
42
53import java .util .List ;
64
75import org .junit .After ;
6+ import org .junit .Assert ;
87import org .junit .Before ;
98import org .junit .Test ;
109
10+ import coreapi .Menu ;
11+ import coreapi .Product ;
12+ import coreapi .ProductCatalog ;
13+
1114
1215public class MenuTest
1316{
Original file line number Diff line number Diff line change 1- package coreapi ;
1+ package coreapiTest ;
2+
3+ import coreapi .Cafeteria ;
4+ import coreapi .Order ;
25
36import org .junit .Assert .*;
47
Original file line number Diff line number Diff line change 1- package coreapi ;
1+ package coreapiTest ;
22
3+ import coreapi .*;
34import org .junit .Assert ;
45
56import java .util .List ;
Original file line number Diff line number Diff line change 1- package coreapi ;
1+ package coreapiTest ;
22
3+ import coreapi .*;
34import java .util .Date ;
45
56import org .junit .After ;
@@ -28,9 +29,9 @@ protected void setUp()
2829 {
2930 coffe = new Cafeteria ();
3031 date = new Date (System .currentTimeMillis ());
31- ord1 = new OrderImpl ( 17 , date );
32- ord2 = new OrderImpl ( 18 , date );
33- ord3 = new OrderImpl ( 19 , date );
32+ ord1 = ( OrderImpl ) OrderFactory . createOrder ( date );
33+ ord2 = ( OrderImpl ) OrderFactory . createOrder ( date );
34+ ord3 = ( OrderImpl ) OrderFactory . createOrder ( date );
3435 ordSer = new OrderService ();
3536
3637 // We introduce products from the catalog to the cafeteria with a certain stock
Original file line number Diff line number Diff line change 1- package coreapi ;
1+ package coreapiTest ;
2+
3+ import coreapi .ProductImpl ;
4+ import coreapi .ProductCatalog ;
25
36import org .junit .Assert ;
47
You can’t perform that action at this time.
0 commit comments