Skip to content

Commit 9a65c66

Browse files
Repaired the movement of Test files to their corresponding package.
1 parent 185201d commit 9a65c66

File tree

12 files changed

+41
-22
lines changed

12 files changed

+41
-22
lines changed

.classpath

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,28 @@
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>

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
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

src/main/java/coreapi/Cafeteria.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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();

src/main/java/coreapi/OrderFactory.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

src/test/java/CoffeShopTestSuite.java renamed to src/test/java/coreapiTest/CoffeShopTestSuite.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
package coreapi;
1+
package coreapiTest;
2+
3+
import coreapi.*;
24

35
import org.junit.runner.RunWith;
46
import org.junit.runners.Suite;
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
package coreapi;
2-
3-
import org.junit.Assert;
1+
package coreapiTest;
42

53
import java.util.List;
64

75
import org.junit.After;
6+
import org.junit.Assert;
87
import org.junit.Before;
98
import org.junit.Test;
109

10+
import coreapi.Menu;
11+
import coreapi.Product;
12+
import coreapi.ProductCatalog;
13+
1114

1215
public class MenuTest
1316
{

src/test/java/OrderFactoryTest.java renamed to src/test/java/coreapiTest/OrderFactoryTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
package coreapi;
1+
package coreapiTest;
2+
3+
import coreapi.Cafeteria;
4+
import coreapi.Order;
25

36
import org.junit.Assert.*;
47

src/test/java/OrderImplTest.java renamed to src/test/java/coreapiTest/OrderImplTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
package coreapi;
1+
package coreapiTest;
22

3+
import coreapi.*;
34
import org.junit.Assert;
45

56
import java.util.List;

src/test/java/OrderServiceTest.java renamed to src/test/java/coreapiTest/OrderServiceTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
package coreapi;
1+
package coreapiTest;
22

3+
import coreapi.*;
34
import java.util.Date;
45

56
import 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

src/test/java/ProductImplTest.java renamed to src/test/java/coreapiTest/ProductImplTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
package coreapi;
1+
package coreapiTest;
2+
3+
import coreapi.ProductImpl;
4+
import coreapi.ProductCatalog;
25

36
import org.junit.Assert;
47

0 commit comments

Comments
 (0)