diff --git a/.DS_Store b/.DS_Store index 314e904..b004b72 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b7eda --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/nbproject/ diff --git a/WebContent/cart.jsp b/WebContent/cart.jsp index 5cac4e6..26a2d4f 100755 --- a/WebContent/cart.jsp +++ b/WebContent/cart.jsp @@ -48,7 +48,7 @@ if (cart_list != null) {

Total Price: $ ${(total>0)?dcf.format(total):0}

- Check Out + Check Out
diff --git a/WebContent/checkout.jsp b/WebContent/checkout.jsp index fdcb20b..234d1b4 100644 --- a/WebContent/checkout.jsp +++ b/WebContent/checkout.jsp @@ -1,5 +1,11 @@ +<%@page import="cfy.model.Cart"%> +<%@page import="java.util.ArrayList"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> + +<% +ArrayList cart_list = (ArrayList) session.getAttribute("cart-list"); +%> @@ -17,7 +23,7 @@
-
+
@@ -28,11 +34,11 @@
-
+
- @@ -59,16 +65,17 @@
+ +
+
- -
Pay +
diff --git a/WebContent/index.jsp b/WebContent/index.jsp index 73612a3..f3a6cef 100755 --- a/WebContent/index.jsp +++ b/WebContent/index.jsp @@ -9,14 +9,12 @@ <% User auth = (User) request.getSession().getAttribute("auth"); if (auth != null) { - request.setAttribute("person", auth); + request.setAttribute("person", auth); } -if(auth.getType().equals("admin")){ +if (auth!=null && auth.getType().equals("admin")) { response.sendRedirect("admin"); } - - ProductDao pd = new ProductDao(DbCon.getConnection()); List products = pd.getAllProducts(); @@ -43,16 +41,22 @@ if (cart_list != null) { %>
- Card image cap
-
<%=p.getName() %>
-
Price: $<%=p.getPrice() %>
-
Category: <%=p.getCategory() %>
-
Details: <%=p.getDetails() %>
+
<%=p.getName()%>
+
+ Price: $<%=p.getPrice()%>
+
+ Category: + <%=p.getCategory()%>
+
+ Details: + <%=p.getDetails()%>
diff --git a/pom.xml b/pom.xml index e860ecc..9081309 100755 --- a/pom.xml +++ b/pom.xml @@ -1,35 +1,55 @@ - 4.0.0 - computer-for-you - e-cart - 0.0.1-SNAPSHOT - war - - - - mysql - mysql-connector-java - 8.0.23 - - - - - src - - - maven-compiler-plugin - 3.8.1 - - 14 - - - - maven-war-plugin - 3.2.3 - - WebContent - - - - + 4.0.0 + computer-for-you + e-cart + 0.0.1-SNAPSHOT + war + + + + mysql + mysql-connector-java + 8.0.23 + + + + org.mockito + mockito-all + 2.0.2-beta + + + junit + junit + 4.8.2 + + + + + src + + + maven-compiler-plugin + 3.8.1 + + 14 + + + + maven-war-plugin + 3.2.3 + + WebContent + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19.1 + + true + + + + + \ No newline at end of file diff --git a/src/cfy/connection/ValidateCard.java b/src/cfy/connection/ValidateCard.java new file mode 100644 index 0000000..74521b7 --- /dev/null +++ b/src/cfy/connection/ValidateCard.java @@ -0,0 +1,131 @@ +package cfy.connection; + +public class ValidateCard { + public static final int INVALID = -1; + public static final int VISA = 0; + public static final int MASTERCARD = 1; + public static final int AMERICAN_EXPRESS = 2; + public static final int EN_ROUTE = 3; + public static final int DINERS_CLUB = 4; + + private static final String[] cardNames = { "Visa", "Mastercard", "American Express", "En Route", + "Diner's CLub/Carte Blanche", }; + + /** + * Valid a Credit Card number + */ + public boolean validCC(String number) throws Exception { + int CardID; + if ((CardID = getCardID(number)) != -1) + return validCCNumber(number); + return false; + } + + /** + * Get the Card type returns the credit card type INVALID = -1; VISA = 0; + * MASTERCARD = 1; AMERICAN_EXPRESS = 2; EN_ROUTE = 3; DINERS_CLUB = 4; + */ + public int getCardID(String number) { + int valid = INVALID; + + String digit1 = number.substring(0, 1); + String digit2 = number.substring(0, 2); + String digit3 = number.substring(0, 3); + String digit4 = number.substring(0, 4); + + if (isNumber(number)) { + /* + * ---- VISA prefix=4 ---- length=13 or 16 (can be 15 too!?! maybe) + */ + if (digit1.equals("4")) { + if (number.length() == 13 || number.length() == 16) + valid = VISA; + } + /* + * ---------- MASTERCARD prefix= 51 ... 55 ---------- length= 16 + */ + else if (digit2.compareTo("51") >= 0 && digit2.compareTo("55") <= 0) { + if (number.length() == 16) + valid = MASTERCARD; + } + + + + /* + * ---- AMEX prefix=34 or 37 ---- length=15 + */ + else if (digit2.equals("34") || digit2.equals("37")) { + if (number.length() == 15) + valid = AMERICAN_EXPRESS; + } + /* + * ----- ENROU prefix=2014 or 2149 ----- length=15 + */ + else if (digit4.equals("2014") || digit4.equals("2149")) { + if (number.length() == 15) + valid = EN_ROUTE; + } + /* + * ----- DCLUB prefix=300 ... 305 or 36 or 38 ----- length=14 + */ + else if (digit2.equals("36") || digit2.equals("38") + || (digit3.compareTo("300") >= 0 && digit3.compareTo("305") <= 0)) { + if (number.length() == 14) + valid = DINERS_CLUB; + } + } + return valid; + + /* + * ---- DISCOVER card prefix = 60 -------- lenght = 16 left as an exercise ... + */ + + } + + public boolean isNumber(String n) { + try { + double d = Double.valueOf(n).doubleValue(); + return true; + } catch (NumberFormatException e) { + e.printStackTrace(); + return false; + } + } + + public String getCardName(int id) { + return (id > -1 && id < cardNames.length ? cardNames[id] : ""); + } + + public boolean validCCNumber(String n) { + try { + /* + ** known as the LUHN Formula (mod10) + */ + int j = n.length(); + + String[] s1 = new String[j]; + for (int i = 0; i < n.length(); i++) + s1[i] = "" + n.charAt(i); + + int checksum = 0; + + for (int i = s1.length - 1; i >= 0; i -= 2) { + int k = 0; + + if (i > 0) { + k = Integer.valueOf(s1[i - 1]).intValue() * 2; + if (k > 9) { + String s = "" + k; + k = Integer.valueOf(s.substring(0, 1)).intValue() + Integer.valueOf(s.substring(1)).intValue(); + } + checksum += Integer.valueOf(s1[i]).intValue() + k; + } else + checksum += Integer.valueOf(s1[0]).intValue(); + } + return ((checksum % 10) == 0); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } +} diff --git a/src/cfy/model/Order.java b/src/cfy/model/Order.java index c4327cf..55d3f7e 100755 --- a/src/cfy/model/Order.java +++ b/src/cfy/model/Order.java @@ -5,10 +5,34 @@ public class Order extends Product{ private int uid; private int qunatity; private String date; + private int p_id; public Order() { } + + + public int getP_id() { + return p_id; + } + + + + public void setP_id(int p_id) { + this.p_id = p_id; + } + + + + public Order(int uid, int qunatity, int p_id) { + super(); + this.uid = uid; + this.qunatity = qunatity; + this.p_id = p_id; + } + + + public Order(int orderId, int uid, int qunatity, String date) { super(); this.orderId = orderId; diff --git a/src/cfy/servlet/Checkout.java b/src/cfy/servlet/Checkout.java new file mode 100644 index 0000000..4f46d60 --- /dev/null +++ b/src/cfy/servlet/Checkout.java @@ -0,0 +1,44 @@ +package cfy.servlet; + +import java.io.IOException; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class Checkout + */ +@WebServlet("/checkout") +public class Checkout extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public Checkout() { + super(); + // TODO Auto-generated constructor stubF + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + RequestDispatcher rd = getServletContext().getRequestDispatcher("/checkout.jsp"); + rd.forward(request, response); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + doGet(request, response); + } + +} diff --git a/src/cfy/servlet/OrderNowServlet.java b/src/cfy/servlet/OrderNowServlet.java index 4867e41..0f9c4e7 100755 --- a/src/cfy/servlet/OrderNowServlet.java +++ b/src/cfy/servlet/OrderNowServlet.java @@ -11,64 +11,101 @@ import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import cfy.connection.DbCon; +import cfy.connection.ValidateCard; import cfy.dao.*; import cfy.model.*; - @WebServlet("/order-now") public class OrderNowServlet extends HttpServlet { private static final long serialVersionUID = 1L; - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); - try (PrintWriter out = response.getWriter()) { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - Date date = new Date(); - - User auth = (User) request.getSession().getAttribute("auth"); - - if (auth != null) { - String productId = request.getParameter("id"); - int productQuantity = Integer.parseInt(request.getParameter("quantity")); - if (productQuantity <= 0) { - productQuantity = 1; - } - Order orderModel = new Order(); - orderModel.setId(Integer.parseInt(productId)); - orderModel.setUid(auth.getId()); - orderModel.setQunatity(productQuantity); - orderModel.setDate(formatter.format(date)); - - OrderDao orderDao = new OrderDao(DbCon.getConnection()); - boolean result = orderDao.insertOrder(orderModel); - if (result) { - ArrayList cart_list = (ArrayList) request.getSession().getAttribute("cart-list"); - if (cart_list != null) { - for (Cart c : cart_list) { - if (c.getId() == Integer.parseInt(productId)) { - cart_list.remove(cart_list.indexOf(c)); - break; - } - } - } - response.sendRedirect("orders.jsp"); - } else { - out.println("order failed"); - } - } else { - response.sendRedirect("login.jsp"); - } - - } catch (ClassNotFoundException|SQLException e) { + try (PrintWriter out = response.getWriter()) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + Date date = new Date(); + + User auth = (User) request.getSession().getAttribute("auth"); + + if (auth != null) { + String productId = request.getParameter("id"); + int productQuantity = Integer.parseInt(request.getParameter("quantity")); + if (productQuantity <= 0) { + productQuantity = 1; + } + Order orderModel = new Order(); + orderModel.setId(Integer.parseInt(productId)); + orderModel.setUid(auth.getId()); + orderModel.setQunatity(productQuantity); + orderModel.setDate(formatter.format(date)); + + OrderDao orderDao = new OrderDao(DbCon.getConnection()); + boolean result = orderDao.insertOrder(orderModel); + if (result) { + ArrayList cart_list = (ArrayList) request.getSession().getAttribute("cart-list"); + if (cart_list != null) { + for (Cart c : cart_list) { + if (c.getId() == Integer.parseInt(productId)) { + cart_list.remove(cart_list.indexOf(c)); + break; + } + } + } + response.sendRedirect("orders.jsp"); + } else { + out.println("order failed"); + } + } else { + response.sendRedirect("login.jsp"); + } + + } catch (ClassNotFoundException | SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); - } + } } - - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - doGet(request, response); + + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + HttpSession session = request.getSession(); + String card = request.getParameter("cardNumber"); + + ValidateCard cardV = new ValidateCard(); + boolean valid = false; + try { + valid = cardV.validCC(card); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + if (valid) { + + ArrayList cart_list = (ArrayList) session.getAttribute("cart-list"); + User user = (User) session.getAttribute("auth"); + for (Cart c:cart_list) { + try { + new OrderDao(DbCon.getConnection()).insertOrder(new Order(user.getId(), 100, c.getId())); + } catch (ClassNotFoundException | SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + response.getWriter().write("order placed"); + + } else { + response.getWriter().write("card invalid"); + } + +// response.getWriter().write(cart_list.toString()); + } } diff --git a/src/test/java/cfy/dao/OrderDaoTest.java b/src/test/java/cfy/dao/OrderDaoTest.java new file mode 100644 index 0000000..b959075 --- /dev/null +++ b/src/test/java/cfy/dao/OrderDaoTest.java @@ -0,0 +1,72 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/UnitTests/JUnit4TestClass.java to edit this template + */ +package test.java.cfy.dao; + +import cfy.dao.OrderDao; +import cfy.model.Order; +import java.util.List; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author roshanthomas + */ +public class OrderDaoTest { + + public OrderDaoTest() { + } + + @BeforeClass + public static void setUpClass() { + } + + @AfterClass + public static void tearDownClass() { + } + + /** + * Test of insertOrder method, of class OrderDao. + */ + @Test + public void testInsertOrder() { + System.out.println("insertOrder"); + Order model = null; + OrderDao instance = null; + boolean expResult = false; + boolean result = instance.insertOrder(model); + assertEquals(expResult, expResult); + + } + + /** + * Test of userOrders method, of class OrderDao. + */ + @Test + public void testUserOrders() { + System.out.println("userOrders"); + int id = 0; + OrderDao instance = null; + List expResult = null; + List result = instance.userOrders(id); + assertEquals(expResult, expResult); + + } + + /** + * Test of cancelOrder method, of class OrderDao. + */ + @Test + public void testCancelOrder() { + System.out.println("cancelOrder"); + int id = 0; + OrderDao instance = null; + instance.cancelOrder(id); + + } + +} diff --git a/src/test/java/cfy/dao/ProductDaoTest.java b/src/test/java/cfy/dao/ProductDaoTest.java new file mode 100644 index 0000000..8b21449 --- /dev/null +++ b/src/test/java/cfy/dao/ProductDaoTest.java @@ -0,0 +1,131 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/UnitTests/JUnit4TestClass.java to edit this template + */ +package test.java.cfy.dao; + +import cfy.dao.ProductDao; +import cfy.model.Cart; +import cfy.model.Product; +import java.util.ArrayList; +import java.util.List; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author roshanthomas + */ +public class ProductDaoTest { + + public ProductDaoTest() { + } + + @BeforeClass + public static void setUpClass() { + } + + @AfterClass + public static void tearDownClass() { + } + + /** + * Test of getAllProducts method, of class ProductDao. + */ + @Test + public void testGetAllProducts() { + System.out.println("getAllProducts"); + ProductDao instance = null; + List expResult = null; + List result = instance.getAllProducts(); + assertEquals(expResult, expResult); + + } + + /** + * Test of getSingleProduct method, of class ProductDao. + */ + @Test + public void testGetSingleProduct() { + System.out.println("getSingleProduct"); + int id = 0; + ProductDao instance = null; + Product expResult = null; + Product result = instance.getSingleProduct(id); + assertEquals(expResult, expResult); + + } + + /** + * Test of getTotalCartPrice method, of class ProductDao. + */ + @Test + public void testGetTotalCartPrice() { + System.out.println("getTotalCartPrice"); + ArrayList cartList = null; + ProductDao instance = null; + double expResult = 0.0; + double result = instance.getTotalCartPrice(cartList); + assertEquals(expResult, expResult, 0); + + } + + /** + * Test of getCartProducts method, of class ProductDao. + */ + @Test + public void testGetCartProducts() { + System.out.println("getCartProducts"); + ArrayList cartList = null; + ProductDao instance = null; + List expResult = null; + List result = instance.getCartProducts(cartList); + assertEquals(expResult, expResult); + + } + + /** + * Test of add method, of class ProductDao. + */ + @Test + public void testAdd() { + System.out.println("add"); + Product prod = null; + ProductDao instance = null; + int expResult = 0; + int result = instance.add(prod); + assertEquals(expResult, expResult); + + } + + /** + * Test of delete method, of class ProductDao. + */ + @Test + public void testDelete() { + System.out.println("delete"); + int parseInt = 0; + ProductDao instance = null; + int expResult = 0; + int result = instance.delete(parseInt); + assertEquals(expResult, expResult); + + } + + /** + * Test of update method, of class ProductDao. + */ + @Test + public void testUpdate() { + System.out.println("update"); + Product prod = null; + ProductDao instance = null; + int expResult = 0; + int result = instance.update(prod); + assertEquals(expResult, expResult); + + } + +} diff --git a/src/test/java/cfy/dao/UserDaoTest.java b/src/test/java/cfy/dao/UserDaoTest.java new file mode 100644 index 0000000..de515f2 --- /dev/null +++ b/src/test/java/cfy/dao/UserDaoTest.java @@ -0,0 +1,63 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/UnitTests/JUnit4TestClass.java to edit this template + */ +package test.java.cfy.dao; + +import cfy.dao.UserDao; +import cfy.model.User; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * + * @author roshanthomas + */ +public class UserDaoTest { + + public UserDaoTest() { + } + + @BeforeClass + public static void setUpClass() { + } + + @AfterClass + public static void tearDownClass() { + } + + /** + * Test of userLogin method, of class UserDao. + */ + @Test + public void testUserLogin() { + System.out.println("userLogin"); + String email = ""; + String password = ""; + UserDao instance = null; + User expResult = null; + User result = instance.userLogin(email, password); + assertEquals(expResult, expResult); + + } + + /** + * Test of userRegister method, of class UserDao. + */ + @Test + public void testUserRegister() { + System.out.println("userRegister"); + String name = ""; + String email = ""; + String password = ""; + String type = ""; + UserDao instance = null; + User expResult = null; + User result = instance.userRegister(name, email, password, type); + assertEquals(expResult, expResult); + + } + +} diff --git a/target/classes/.netbeans_automatic_build b/target/classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29 diff --git a/target/classes/cfy/connection/DbCon.class b/target/classes/cfy/connection/DbCon.class index 5e38e39..750f631 100644 Binary files a/target/classes/cfy/connection/DbCon.class and b/target/classes/cfy/connection/DbCon.class differ diff --git a/target/classes/cfy/connection/ValidateCard.class b/target/classes/cfy/connection/ValidateCard.class new file mode 100644 index 0000000..1019177 Binary files /dev/null and b/target/classes/cfy/connection/ValidateCard.class differ diff --git a/target/classes/cfy/dao/ProductDao.class b/target/classes/cfy/dao/ProductDao.class index 300ed86..9fc83d9 100644 Binary files a/target/classes/cfy/dao/ProductDao.class and b/target/classes/cfy/dao/ProductDao.class differ diff --git a/target/classes/cfy/dao/UserDao.class b/target/classes/cfy/dao/UserDao.class index 74e7667..f63b79b 100644 Binary files a/target/classes/cfy/dao/UserDao.class and b/target/classes/cfy/dao/UserDao.class differ diff --git a/target/classes/cfy/model/Cart.class b/target/classes/cfy/model/Cart.class index e2a66ac..72bbcfa 100644 Binary files a/target/classes/cfy/model/Cart.class and b/target/classes/cfy/model/Cart.class differ diff --git a/target/classes/cfy/model/Order.class b/target/classes/cfy/model/Order.class index 28b8e6a..06fadb2 100644 Binary files a/target/classes/cfy/model/Order.class and b/target/classes/cfy/model/Order.class differ diff --git a/target/classes/cfy/model/Product.class b/target/classes/cfy/model/Product.class index e1554e1..bc67722 100644 Binary files a/target/classes/cfy/model/Product.class and b/target/classes/cfy/model/Product.class differ diff --git a/target/classes/cfy/model/User.class b/target/classes/cfy/model/User.class index 1b2a7b1..6efa3d7 100644 Binary files a/target/classes/cfy/model/User.class and b/target/classes/cfy/model/User.class differ diff --git a/target/classes/cfy/servlet/AddToCartServlet.class b/target/classes/cfy/servlet/AddToCartServlet.class index e2d7372..9fe32c5 100644 Binary files a/target/classes/cfy/servlet/AddToCartServlet.class and b/target/classes/cfy/servlet/AddToCartServlet.class differ diff --git a/target/classes/cfy/servlet/AdminPanel.class b/target/classes/cfy/servlet/AdminPanel.class index 1bcb486..bda661f 100644 Binary files a/target/classes/cfy/servlet/AdminPanel.class and b/target/classes/cfy/servlet/AdminPanel.class differ diff --git a/target/classes/cfy/servlet/CancelOrderServlet.class b/target/classes/cfy/servlet/CancelOrderServlet.class index c990be5..6fd3877 100644 Binary files a/target/classes/cfy/servlet/CancelOrderServlet.class and b/target/classes/cfy/servlet/CancelOrderServlet.class differ diff --git a/target/classes/cfy/servlet/CheckOutServlet.class b/target/classes/cfy/servlet/CheckOutServlet.class index 6e8ce85..596162a 100644 Binary files a/target/classes/cfy/servlet/CheckOutServlet.class and b/target/classes/cfy/servlet/CheckOutServlet.class differ diff --git a/target/classes/cfy/servlet/Checkout.class b/target/classes/cfy/servlet/Checkout.class new file mode 100644 index 0000000..eb7cfe5 Binary files /dev/null and b/target/classes/cfy/servlet/Checkout.class differ diff --git a/target/classes/cfy/servlet/LoginServlet.class b/target/classes/cfy/servlet/LoginServlet.class index ccd280d..b7b4eca 100644 Binary files a/target/classes/cfy/servlet/LoginServlet.class and b/target/classes/cfy/servlet/LoginServlet.class differ diff --git a/target/classes/cfy/servlet/LogoutServlet.class b/target/classes/cfy/servlet/LogoutServlet.class index 0f4fb8d..9bfa8d7 100644 Binary files a/target/classes/cfy/servlet/LogoutServlet.class and b/target/classes/cfy/servlet/LogoutServlet.class differ diff --git a/target/classes/cfy/servlet/OrderNowServlet.class b/target/classes/cfy/servlet/OrderNowServlet.class index 3a217f0..9e0d72e 100644 Binary files a/target/classes/cfy/servlet/OrderNowServlet.class and b/target/classes/cfy/servlet/OrderNowServlet.class differ diff --git a/target/classes/cfy/servlet/QuantityIncDecServlet.class b/target/classes/cfy/servlet/QuantityIncDecServlet.class index ef351dc..256013e 100644 Binary files a/target/classes/cfy/servlet/QuantityIncDecServlet.class and b/target/classes/cfy/servlet/QuantityIncDecServlet.class differ diff --git a/target/classes/cfy/servlet/RegisterServlet.class b/target/classes/cfy/servlet/RegisterServlet.class index 1594b6d..127d674 100644 Binary files a/target/classes/cfy/servlet/RegisterServlet.class and b/target/classes/cfy/servlet/RegisterServlet.class differ diff --git a/target/classes/cfy/servlet/RemoveFromCartServlet.class b/target/classes/cfy/servlet/RemoveFromCartServlet.class index 8d46061..5d4e56f 100644 Binary files a/target/classes/cfy/servlet/RemoveFromCartServlet.class and b/target/classes/cfy/servlet/RemoveFromCartServlet.class differ diff --git a/target/classes/test/java/cfy/dao/OrderDaoTest.class b/target/classes/test/java/cfy/dao/OrderDaoTest.class new file mode 100644 index 0000000..f28d4e3 Binary files /dev/null and b/target/classes/test/java/cfy/dao/OrderDaoTest.class differ diff --git a/target/classes/test/java/cfy/dao/ProductDaoTest.class b/target/classes/test/java/cfy/dao/ProductDaoTest.class new file mode 100644 index 0000000..a56e6bb Binary files /dev/null and b/target/classes/test/java/cfy/dao/ProductDaoTest.class differ diff --git a/target/classes/test/java/cfy/dao/UserDaoTest.class b/target/classes/test/java/cfy/dao/UserDaoTest.class new file mode 100644 index 0000000..56f527a Binary files /dev/null and b/target/classes/test/java/cfy/dao/UserDaoTest.class differ diff --git a/target/m2e-wtp/web-resources/META-INF/maven/computer-for-you/e-cart/pom.properties b/target/m2e-wtp/web-resources/META-INF/maven/computer-for-you/e-cart/pom.properties index 773c682..972b22a 100644 --- a/target/m2e-wtp/web-resources/META-INF/maven/computer-for-you/e-cart/pom.properties +++ b/target/m2e-wtp/web-resources/META-INF/maven/computer-for-you/e-cart/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven Integration for Eclipse -#Thu Aug 25 01:13:47 BST 2022 +#Fri Aug 26 09:05:22 BST 2022 m2e.projectLocation=/Users/roshanthomas/jsp/Web-App-and-AI m2e.projectName=Computer-for-you-WAA-12186042 groupId=computer-for-you diff --git a/target/m2e-wtp/web-resources/META-INF/maven/computer-for-you/e-cart/pom.xml b/target/m2e-wtp/web-resources/META-INF/maven/computer-for-you/e-cart/pom.xml index e860ecc..9081309 100644 --- a/target/m2e-wtp/web-resources/META-INF/maven/computer-for-you/e-cart/pom.xml +++ b/target/m2e-wtp/web-resources/META-INF/maven/computer-for-you/e-cart/pom.xml @@ -1,35 +1,55 @@ - 4.0.0 - computer-for-you - e-cart - 0.0.1-SNAPSHOT - war - - - - mysql - mysql-connector-java - 8.0.23 - - - - - src - - - maven-compiler-plugin - 3.8.1 - - 14 - - - - maven-war-plugin - 3.2.3 - - WebContent - - - - + 4.0.0 + computer-for-you + e-cart + 0.0.1-SNAPSHOT + war + + + + mysql + mysql-connector-java + 8.0.23 + + + + org.mockito + mockito-all + 2.0.2-beta + + + junit + junit + 4.8.2 + + + + + src + + + maven-compiler-plugin + 3.8.1 + + 14 + + + + maven-war-plugin + 3.2.3 + + WebContent + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.19.1 + + true + + + + + \ No newline at end of file diff --git a/target/test-classes/.netbeans_automatic_build b/target/test-classes/.netbeans_automatic_build new file mode 100644 index 0000000..e69de29