diff --git a/nbactions.xml b/nbactions.xml index 8e9c9c7b3b2637b9952b3b041de51256cfc9dc98..fcf24843b143c0740c61241c7d6daba30d4206dc 100644 --- a/nbactions.xml +++ b/nbactions.xml @@ -22,4 +22,25 @@ <goal>jetty:run</goal> </goals> </action> + <action> + <actionName>CUSTOM-run jetty</actionName> + <displayName>run jetty</displayName> + <goals> + <goal>jetty:run-war</goal> + </goals> + </action> + <action> + <actionName>debug</actionName> + <packagings> + <packaging>war</packaging> + <packaging>ear</packaging> + <packaging>ejb</packaging> + </packagings> + <goals> + <goal>package</goal> + </goals> + <properties> + <netbeans.deploy.debugmode>true</netbeans.deploy.debugmode> + </properties> + </action> </actions> diff --git a/pom.xml b/pom.xml index bb38ac252ffc2c9b75e824021433b93e1cc6e815..094c50b8be020a576ae2a6d78792175c02db0cca 100644 --- a/pom.xml +++ b/pom.xml @@ -66,6 +66,48 @@ <groupId>com.vaadin</groupId> <artifactId>vaadin-themes</artifactId> </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + <version>1.16.16</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.4</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.11</version> + <scope>test</scope> + <type>jar</type> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-core</artifactId> + <version>1.3</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-library</artifactId> + <version>1.3</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.postgresql</groupId> + <artifactId>postgresql</artifactId> + <version>42.0.0</version> +</dependency> + + + + + </dependencies> <build> @@ -124,6 +166,25 @@ <scanIntervalSeconds>2</scanIntervalSeconds> </configuration> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>0.7.1.201405082137</version> + <executions> + <execution> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + </executions> + </plugin> </plugins> </build> diff --git a/src/main/java/AppWidgetset.gwt.xml b/src/main/java/AppWidgetset.gwt.xml new file mode 100644 index 0000000000000000000000000000000000000000..04626bb011c978eaf63d9426dd804a8e0010a896 --- /dev/null +++ b/src/main/java/AppWidgetset.gwt.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd"> +<module> + <!-- + Uncomment the following to compile the widgetset for one browser only. + + Multiple browsers can be specified as a comma separated list. The + supported user agents at the moment of writing were: + ie8,ie9,gecko1_8,safari,opera + + The value gecko1_8 is used for Firefox and safari is used for webkit + based browsers including Google Chrome. + --> + <!-- <set-property name="user.agent" value="safari"/> --> + + <!-- + To enable SuperDevMode, uncomment this line. + + See https://vaadin.com/wiki/-/wiki/Main/Using%20SuperDevMode for more + information and instructions. + --> + <!-- <set-configuration-property name="devModeRedirectEnabled" value="true" /> --> + + + + <inherits name="com.vaadin.DefaultWidgetSet" /> +</module> diff --git a/src/main/java/org/s4s/View/MyUI.java b/src/main/java/org/s4s/View/MyUI.java index 552aefee0226b8eb07f3907fb5d609f7964c5978..520209a36c7375d24dd657a55302055e5bf6d203 100644 --- a/src/main/java/org/s4s/View/MyUI.java +++ b/src/main/java/org/s4s/View/MyUI.java @@ -5,10 +5,38 @@ import javax.servlet.annotation.WebServlet; import com.vaadin.annotations.Theme; import com.vaadin.annotations.Title; import com.vaadin.annotations.VaadinServletConfiguration; +import com.vaadin.data.util.BeanContainer; +import com.vaadin.navigator.Navigator; +import com.vaadin.server.FontAwesome; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinServlet; +import com.vaadin.shared.ui.label.ContentMode; +import com.vaadin.ui.Alignment; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Table; +import com.vaadin.ui.TextField; import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; +import java.util.List; +import org.s4s.gui.views.ArtikeldetailsView; +import org.s4s.gui.views.BenutzerkontoView; +import org.s4s.gui.views.CheckoutView; +import org.s4s.gui.views.FaqView; +import org.s4s.gui.views.ImpressumView; +import org.s4s.gui.views.KaufbestaetigungView; +import org.s4s.gui.views.LoginView; +import org.s4s.gui.views.PasswortView; +import org.s4s.gui.views.ShopView; +import org.s4s.gui.views.VerkaeuferbewertungView; +import org.s4s.gui.views.WelcomeView; +import org.s4s.gui.views.WarenkorbView; +import org.s4s.modell.objects.dto.Product; +import org.s4s.dao.impl.ProductSearch; +import org.s4s.services.util.Views; /** * This UI is the application entry point. A UI may either represent a browser window @@ -23,12 +51,25 @@ public class MyUI extends UI { @Override protected void init(VaadinRequest vaadinRequest) { - Label label = new Label("Das erste Label unseres Shop in Shop System"); - setContent(label); + Navigator navi = new Navigator ( this , this ); + navi.addView(Views.SHOP, ShopView.class ); + navi.addView(Views.WELCOME, WelcomeView.class); + navi.addView(Views.LOGIN, LoginView.class); + navi.addView(Views.WARENKORB, WarenkorbView.class); + navi.addView(Views.PASSWORT, PasswortView.class); + navi.addView(Views.BENUTZERKONTO, BenutzerkontoView.class); + navi.addView(Views.ARTIKELDETAILS, ArtikeldetailsView.class); + navi.addView(Views.CHECKOUT, CheckoutView.class); + navi.addView(Views.IMPRESSUM, ImpressumView.class); + navi.addView(Views.FAQ, FaqView.class); + navi.addView(Views.KAUFBESTAETIGUNG, KaufbestaetigungView.class); + navi.addView(Views.VERKAEUFERBEWERTUNG, VerkaeuferbewertungView.class); + UI.getCurrent().getNavigator().navigateTo(Views.WELCOME); } + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) @VaadinServletConfiguration(ui = MyUI.class, productionMode = false) public static class MyUIServlet extends VaadinServlet { } -} +} \ No newline at end of file diff --git a/src/main/java/org/s4s/dao/DAOException.java b/src/main/java/org/s4s/dao/DAOException.java new file mode 100644 index 0000000000000000000000000000000000000000..72bda56ce64a9af1942737736553593f6be6dcc8 --- /dev/null +++ b/src/main/java/org/s4s/dao/DAOException.java @@ -0,0 +1,29 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.dao; + +/** + * + * @author Holger + */ +public class DAOException extends Exception { + + public DAOException() { + super(); + } + + public DAOException(String message) { + super(message); + } + + public DAOException(String message, Throwable cause) { + super(message, cause); + } + + public DAOException(Throwable cause) { + super(cause); + } +} diff --git a/src/main/java/org/s4s/dao/KundenDAO.java b/src/main/java/org/s4s/dao/KundenDAO.java new file mode 100644 index 0000000000000000000000000000000000000000..adeb3287a11f99880d13e63d654534bf9f1819c1 --- /dev/null +++ b/src/main/java/org/s4s/dao/KundenDAO.java @@ -0,0 +1,17 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.dao; + +import org.s4s.modell.objects.dto.User; + +/** + * + * @author Holger + */ +public interface KundenDAO { + + User getUserByCredentials(String username, String password) throws NoSuchUserOrPassword, DAOException; +} diff --git a/src/main/java/org/s4s/dao/NoSuchUserOrPassword.java b/src/main/java/org/s4s/dao/NoSuchUserOrPassword.java new file mode 100644 index 0000000000000000000000000000000000000000..29c799772f6431ba852890805f84940f3022c51a --- /dev/null +++ b/src/main/java/org/s4s/dao/NoSuchUserOrPassword.java @@ -0,0 +1,29 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.dao; + +/** + * + * @author Holger + */ +public class NoSuchUserOrPassword extends Exception { + + public NoSuchUserOrPassword() { + super(); + } + + public NoSuchUserOrPassword(String message) { + super(message); + } + + public NoSuchUserOrPassword(String message, Throwable cause) { + super(message, cause); + } + + public NoSuchUserOrPassword(Throwable cause) { + super(cause); + } +} diff --git a/src/main/java/org/s4s/dao/ProductDAO.java b/src/main/java/org/s4s/dao/ProductDAO.java new file mode 100644 index 0000000000000000000000000000000000000000..ee5a43dd2ab6119e2ced75826ac9da9985e94bfb --- /dev/null +++ b/src/main/java/org/s4s/dao/ProductDAO.java @@ -0,0 +1,18 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.dao; + +import java.util.List; +import org.s4s.modell.objects.dto.Product; + +/** + * + * @author Holger + */ +public interface ProductDAO { + List<Product> getProductByTyp(String typ); + List<Product> getProductByDescription(String typ); +} diff --git a/src/main/java/org/s4s/dao/impl/AbstractDatabaseClass.java b/src/main/java/org/s4s/dao/impl/AbstractDatabaseClass.java new file mode 100644 index 0000000000000000000000000000000000000000..e98ec72bb07c7579633ceedece27aaaf84d664ba --- /dev/null +++ b/src/main/java/org/s4s/dao/impl/AbstractDatabaseClass.java @@ -0,0 +1,27 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.dao.impl; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import org.s4s.services.db.JDBCConnection; + +/** + * + * @author Holger + */ +public abstract class AbstractDatabaseClass { + + private final JDBCConnection conn = JDBCConnection.getInstance(); + + protected ResultSet executeQuery(String sql) throws SQLException { + Statement stat = conn.getStatement(); + ResultSet set = stat.executeQuery(sql); + stat.closeOnCompletion(); + return set; + } +} diff --git a/src/main/java/org/s4s/dao/impl/LoginControl.java b/src/main/java/org/s4s/dao/impl/LoginControl.java new file mode 100644 index 0000000000000000000000000000000000000000..39af53bdd10edbf1e18e86dc3deeb339eb592bd1 --- /dev/null +++ b/src/main/java/org/s4s/dao/impl/LoginControl.java @@ -0,0 +1,37 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.dao.impl; + +import java.sql.*; +import org.s4s.dao.DAOException; +import org.s4s.dao.KundenDAO; +import org.s4s.dao.NoSuchUserOrPassword; +import org.s4s.modell.objects.dto.User; + +/** + * + * @author Holger + */ +public class LoginControl extends AbstractDatabaseClass implements KundenDAO { + + @Override + public User getUserByCredentials(String username, String password) throws NoSuchUserOrPassword, DAOException { + try (ResultSet set = executeQuery("SELECT username, vorname, nachname FROM realm.user WHERE login = " + username + + " AND password = " + password + ";")) { + if (!set.next()) { + throw new NoSuchUserOrPassword(); + } + String vname = set.getString("vorname"); + String nname = set.getString("nachname"); + String uname = set.getString("username"); + + return new User(vname, nname, uname); + + } catch (SQLException ex) { + throw new DAOException(ex); + } + } +} diff --git a/src/main/java/org/s4s/dao/impl/ProductSearch.java b/src/main/java/org/s4s/dao/impl/ProductSearch.java new file mode 100644 index 0000000000000000000000000000000000000000..6b5315df6a451e095f3447690808c050ebdd577b --- /dev/null +++ b/src/main/java/org/s4s/dao/impl/ProductSearch.java @@ -0,0 +1,68 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.dao.impl; + +import java.util.ArrayList; +import java.util.List; +import org.s4s.dao.ProductDAO; +import org.s4s.modell.objects.dto.Product; + +/** + * + * @author Holger + */ +public class ProductSearch extends AbstractDatabaseClass implements ProductDAO { + + Product p1 = new Product("Nachhilfe Algebra", 1, "Nachhilfe", 2.00, "Biete Nachhilfe in Algebra an!"); + Product p2 = new Product("F&I", 2, "Mitschriften", 5.00, "Mitschriften aus dem WS16/17 in F&I!"); + Product p3 = new Product("Ãœbungen Eidip", 3, "Lösungen", 10.50, "Lösungen zu alten Eidip Aufgaben!"); + + private ProductSearch() { + + } + + public static ProductSearch search = null; + + public static ProductSearch getInstance() { + if (search == null) { + search = new ProductSearch(); + } + return search; + } + + @Override + public List<Product> getProductByTyp(String typ) { + List<Product> liste = new ArrayList<>(); + String lowerTyp = typ.toLowerCase(); + if (lowerTyp.contains("nachhilfe")) { + liste.add(p1); + } + if (lowerTyp.contains("mitschrift")) { + liste.add(p2); + } + if (lowerTyp.contains("lösungen")) { + liste.add(p3); + } + + return liste; + } + + @Override + public List<Product> getProductByDescription(String typ) { + List<Product> liste = new ArrayList<>(); + String lowerTyp = typ.toLowerCase(); + if (lowerTyp.contains("algebra")) { + liste.add(p1); + } + if (lowerTyp.contains("f&i")) { + liste.add(p2); + } + if (lowerTyp.contains("eidip")) { + liste.add(p3); + } + return liste; + } +} diff --git a/src/main/java/org/s4s/gui/views/ArtikeldetailsView.java b/src/main/java/org/s4s/gui/views/ArtikeldetailsView.java new file mode 100644 index 0000000000000000000000000000000000000000..d5d27c24459f5adf3e354502db727ce71337f1b1 --- /dev/null +++ b/src/main/java/org/s4s/gui/views/ArtikeldetailsView.java @@ -0,0 +1,23 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.VerticalLayout; + +/** + * + * @author Holger + */ +public class ArtikeldetailsView extends VerticalLayout implements View{ + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} diff --git a/src/main/java/org/s4s/gui/views/BenutzerkontoView.java b/src/main/java/org/s4s/gui/views/BenutzerkontoView.java new file mode 100644 index 0000000000000000000000000000000000000000..2cd0b54a370b4aa85b19165790c839c0082bbbd8 --- /dev/null +++ b/src/main/java/org/s4s/gui/views/BenutzerkontoView.java @@ -0,0 +1,23 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.VerticalLayout; + +/** + * + * @author Holger + */ +public class BenutzerkontoView extends VerticalLayout implements View{ + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} diff --git a/src/main/java/org/s4s/gui/views/CheckoutView.java b/src/main/java/org/s4s/gui/views/CheckoutView.java new file mode 100644 index 0000000000000000000000000000000000000000..51d921a6e394339aa44c40c731bd12ed8c294b00 --- /dev/null +++ b/src/main/java/org/s4s/gui/views/CheckoutView.java @@ -0,0 +1,23 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.VerticalLayout; + +/** + * + * @author Holger + */ +public class CheckoutView extends VerticalLayout implements View{ + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} diff --git a/src/main/java/org/s4s/gui/views/FaqView.java b/src/main/java/org/s4s/gui/views/FaqView.java new file mode 100644 index 0000000000000000000000000000000000000000..5d7c4dfcf6a43d9f6a76440c5711b24ac5f09c12 --- /dev/null +++ b/src/main/java/org/s4s/gui/views/FaqView.java @@ -0,0 +1,23 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.VerticalLayout; + +/** + * + * @author Holger + */ +public class FaqView extends VerticalLayout implements View{ + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} diff --git a/src/main/java/org/s4s/gui/views/ImpressumView.java b/src/main/java/org/s4s/gui/views/ImpressumView.java new file mode 100644 index 0000000000000000000000000000000000000000..3fb284142e4ed4fc326c0e51cc69a94426584989 --- /dev/null +++ b/src/main/java/org/s4s/gui/views/ImpressumView.java @@ -0,0 +1,39 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.Alignment; +import com.vaadin.ui.Label; +import com.vaadin.ui.VerticalLayout; + +/** + * + * @author Holger + */ +public class ImpressumView extends VerticalLayout implements View{ + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + this.setUp(); + } + + private void setUp(){ + setSizeFull(); + setMargin(true); + Label label = new Label("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, " + + "sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat," + + " sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum." + + " Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." + + " Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod" + + " tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua." + + " At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, " + + "no sea takimata sanctus est Lorem ipsum dolor sit amet."); + addComponent(label); + setComponentAlignment(label,Alignment.MIDDLE_CENTER); + } +} diff --git a/src/main/java/org/s4s/gui/views/KaufbestaetigungView.java b/src/main/java/org/s4s/gui/views/KaufbestaetigungView.java new file mode 100644 index 0000000000000000000000000000000000000000..3056dffd5cbc3aac294ec904b97f1581c87b95fa --- /dev/null +++ b/src/main/java/org/s4s/gui/views/KaufbestaetigungView.java @@ -0,0 +1,23 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.VerticalLayout; + +/** + * + * @author Holger + */ +public class KaufbestaetigungView extends VerticalLayout implements View{ + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} diff --git a/src/main/java/org/s4s/gui/views/LoginView.java b/src/main/java/org/s4s/gui/views/LoginView.java new file mode 100644 index 0000000000000000000000000000000000000000..23d3697e258469ee9c0be36d32abeb7aac3bc82d --- /dev/null +++ b/src/main/java/org/s4s/gui/views/LoginView.java @@ -0,0 +1,80 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.server.FontAwesome; +import com.vaadin.shared.ui.label.ContentMode; +import com.vaadin.ui.Button; +import com.vaadin.ui.Label; +import com.vaadin.ui.Notification; +import com.vaadin.ui.PasswordField; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.s4s.dao.DAOException; +import org.s4s.dao.KundenDAO; +import org.s4s.dao.NoSuchUserOrPassword; +import org.s4s.dao.impl.LoginControl; + +/** + * + * @author Holger + */ +public class LoginView extends VerticalLayout implements View { + + private final KundenDAO kundenDAO = new LoginControl(); + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + this.setUp(); + } + + public void setUp() { + setSizeFull(); + + final TextField userLogin = new TextField(); + userLogin.setCaption("Login-Name: "); + final PasswordField passwordField = new PasswordField(); + passwordField.setCaption("Passwort: "); + + VerticalLayout layout = new VerticalLayout(); + + layout.addComponent(userLogin); + layout.addComponent(passwordField); + + Label label = new Label(" ", ContentMode.HTML); + layout.addComponent(label); + + Button button = new Button("Login", FontAwesome.BEER); + layout.addComponent(button); + + this.addComponent(layout); + + button.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + String login = userLogin.getValue(); + String password = passwordField.getValue(); + + try { + kundenDAO.getUserByCredentials(login, password); + + } catch (NoSuchUserOrPassword ex) { + Notification.show("Fehler", "Login oder Passwort falsch", Notification.Type.ERROR_MESSAGE); + userLogin.setValue(""); + passwordField.setValue(""); + } catch (DAOException ex) { + Notification.show("Fehler", "interner Fehler", Notification.Type.ERROR_MESSAGE); + Logger.getLogger(LoginView.class.getName()).log(Level.SEVERE, null, ex); + } + } + }); + } + +} diff --git a/src/main/java/org/s4s/gui/views/PasswortView.java b/src/main/java/org/s4s/gui/views/PasswortView.java new file mode 100644 index 0000000000000000000000000000000000000000..06779817aa6f59a492033cabb57b46c25aaa9f6b --- /dev/null +++ b/src/main/java/org/s4s/gui/views/PasswortView.java @@ -0,0 +1,23 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.VerticalLayout; + +/** + * + * @author Holger + */ +public class PasswortView extends VerticalLayout implements View{ + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + +} diff --git a/src/main/java/org/s4s/gui/views/ShopView.java b/src/main/java/org/s4s/gui/views/ShopView.java new file mode 100644 index 0000000000000000000000000000000000000000..ed3b47e5744bf2fef547878cd0ce0c765c238410 --- /dev/null +++ b/src/main/java/org/s4s/gui/views/ShopView.java @@ -0,0 +1,88 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.data.util.BeanContainer; +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.server.FontAwesome; +import com.vaadin.ui.Alignment; +import com.vaadin.ui.Button; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Table; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.s4s.dao.ProductDAO; +import org.s4s.modell.objects.dto.Product; +import org.s4s.dao.impl.ProductSearch; + +/** + * + * @author Holger + */ +public class ShopView extends VerticalLayout implements View{ + + private final ProductDAO products = ProductSearch.getInstance(); + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + this.setUp(); + } + + + public void setUp(){ + // setSizeFull(); + setMargin(true); + + final HorizontalLayout searchLayout = new HorizontalLayout(); + final HorizontalLayout buttonLayout = new HorizontalLayout(); + + TextField textfield = new TextField(); + Button button = new Button("Suche" , FontAwesome.SEARCH); + Label label = new Label("Das erste Label unseres Shop in Shop System"); + + buttonLayout.addComponent(label); + buttonLayout.setComponentAlignment(label, Alignment.TOP_LEFT); + + searchLayout.addComponent(textfield); + searchLayout.addComponent(button); + buttonLayout.addComponent(searchLayout); + buttonLayout.setComponentAlignment(searchLayout, Alignment.TOP_RIGHT); + buttonLayout.setSizeFull(); + addComponent(buttonLayout); + //setComponentAlignment(buttonLayout, Alignment.TOP_CENTER); + + + final BeanContainer<Integer, Product> data = new BeanContainer<>(Product.class); + data.setBeanIdProperty("id"); + final Table table = new Table ("Products" , data); + table.setSizeFull(); + table.setSelectable(true); + + + button.addClickListener((Button.ClickEvent event) -> { + String str = textfield.getValue().trim(); + + if(str.equals("")){ + Notification.show(null, "Bitte gesuchtes Produkt eingeben!", Notification.Type.WARNING_MESSAGE); + } else{ + addComponent(table); + + Set<Product> liste = new HashSet<>(); + liste.addAll(products.getProductByTyp(str)); + liste.addAll(products.getProductByDescription(str)); + data.removeAllItems(); + data.addAll(liste); + table.setPageLength(table.size()); + } + }); + } +} \ No newline at end of file diff --git a/src/main/java/org/s4s/gui/views/VerkaeuferbewertungView.java b/src/main/java/org/s4s/gui/views/VerkaeuferbewertungView.java new file mode 100644 index 0000000000000000000000000000000000000000..dba00eafb715ee82545a332a69ee23fde1728fdc --- /dev/null +++ b/src/main/java/org/s4s/gui/views/VerkaeuferbewertungView.java @@ -0,0 +1,27 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.VerticalLayout; + +/** + * + * @author Holger + */ +public class VerkaeuferbewertungView extends VerticalLayout implements View{ + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + this.setUp(); + } + + public void setUp(){ + + } + +} diff --git a/src/main/java/org/s4s/gui/views/WarenkorbView.java b/src/main/java/org/s4s/gui/views/WarenkorbView.java new file mode 100644 index 0000000000000000000000000000000000000000..048d56096c5d611ab1eca00b9927b002d80c57f1 --- /dev/null +++ b/src/main/java/org/s4s/gui/views/WarenkorbView.java @@ -0,0 +1,23 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.VerticalLayout; + +/** + * + * @author Holger + */ +public class WarenkorbView extends VerticalLayout implements View{ + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + + } + +} diff --git a/src/main/java/org/s4s/gui/views/WelcomeView.java b/src/main/java/org/s4s/gui/views/WelcomeView.java new file mode 100644 index 0000000000000000000000000000000000000000..5e01a1fe47bb97a015da76358e95de14b1419d2a --- /dev/null +++ b/src/main/java/org/s4s/gui/views/WelcomeView.java @@ -0,0 +1,72 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.gui.views; + +import com.vaadin.navigator.View; +import com.vaadin.navigator.ViewChangeListener; +import com.vaadin.ui.Alignment; +import com.vaadin.ui.Button; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; +import org.s4s.services.util.Views; + +/** + * + * @author Holger + */ +public class WelcomeView extends VerticalLayout implements View{ + + @Override + public void enter(ViewChangeListener.ViewChangeEvent event) { + this.setUp(); + } + + public void setUp(){ + setSizeFull(); + setMargin(true); + final HorizontalLayout horizontalLayout = new HorizontalLayout(); + final HorizontalLayout buttonLayout = new HorizontalLayout(); + + + Button sucheButton = new Button("Besuche Shop"); + buttonLayout.addComponent(sucheButton); + buttonLayout.setComponentAlignment(sucheButton, Alignment.TOP_LEFT); + + + Button loginButton = new Button("Login"); + buttonLayout.addComponent(loginButton); + buttonLayout.setComponentAlignment(loginButton, Alignment.TOP_RIGHT); + + + Button impressumButton = new Button("Impressum"); + horizontalLayout.addComponent(impressumButton); + horizontalLayout.setComponentAlignment(impressumButton, Alignment.MIDDLE_LEFT); + + + addComponent(buttonLayout); + buttonLayout.setSizeFull(); + sucheButton.addClickListener((Button.ClickEvent event) ->{ + UI.getCurrent().getNavigator().navigateTo(Views.SHOP); + }); + + loginButton.addClickListener((Button.ClickEvent event) ->{ + UI.getCurrent().getNavigator().navigateTo(Views.LOGIN); + }); + + impressumButton.addClickListener((Button.ClickEvent event) -> { + UI.getCurrent().getNavigator().navigateTo(Views.IMPRESSUM); + }); + + Label label = new Label("Willkommen in unserem Shop in Shop System!"); + horizontalLayout.addComponent(label); + horizontalLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER); + addComponent(horizontalLayout); + setComponentAlignment(horizontalLayout, Alignment.TOP_CENTER); + } + +} diff --git a/src/main/java/org/s4s/modell/objects/dto/Product.java b/src/main/java/org/s4s/modell/objects/dto/Product.java new file mode 100644 index 0000000000000000000000000000000000000000..ea55275a45ad857dffb4a2568c8de49a4cc8f99c --- /dev/null +++ b/src/main/java/org/s4s/modell/objects/dto/Product.java @@ -0,0 +1,105 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.modell.objects.dto; + +import java.util.Objects; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + * + * @author Holger Karwanni + */ +public class Product { + + private String name; + private Integer id; + private String typ; + private double price; + private String description; + + public Product(String name, Integer id, String typ, double price, String description){ + this.name = name; + this.id = id; + this.typ = typ; + this.price = price; + this.description = description; + } + + public Product(){ + + } + + @Override + public boolean equals(Object other){ + if(other == null){ + return false; + } + if(!(other instanceof Product)){ + return false; + } + Product p = (Product) other; + return new EqualsBuilder() + .append(p.getName(), name) + .append(p.getId(), id) + .append(p.getTyp(), typ) + .append(p.getPrice(), price) + .append(p.getDescription(), description) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder() + .append(name) + .append(id) + .append(typ) + .append(price) + .append(description) + .hashCode(); + } + + public String getName(){ + return name; + } + + public void setName(String name){ + this.name = name; + } + + public Integer getId(){ + return id; + } + + public void setId(Integer id){ + this.id = id; + } + + public String getTyp(){ + return typ; + } + + public void setTyp(String typ){ + this.typ = typ; + } + + public double getPrice(){ + return price; + } + + public void setPrice(double price){ + this.price = price; + } + + public String getDescription(){ + return description; + } + + public void setDescription (String description){ + this.description = description; + } + +} diff --git a/src/main/java/org/s4s/modell/objects/dto/User.java b/src/main/java/org/s4s/modell/objects/dto/User.java new file mode 100644 index 0000000000000000000000000000000000000000..015bab2cd2d1b78b56cc89998b378faf8dbf5356 --- /dev/null +++ b/src/main/java/org/s4s/modell/objects/dto/User.java @@ -0,0 +1,36 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.modell.objects.dto; + +/** + * + * @author Holger + */ +public class User { + + private String vorname; + private String nachname; + private String username; + + public User(String vorname, String nachname, String username) { + this.vorname = vorname; + this.nachname = nachname; + this.username = username; + } + + public String getVorname() { + return vorname; + } + + public String getNachname() { + return nachname; + } + + public String getUsername() { + return username; + } + +} diff --git a/src/main/java/org/s4s/modell/objects/dto/Warenkorb.java b/src/main/java/org/s4s/modell/objects/dto/Warenkorb.java new file mode 100644 index 0000000000000000000000000000000000000000..26df7dccdae4b8dd83305d6682964dfb332f3678 --- /dev/null +++ b/src/main/java/org/s4s/modell/objects/dto/Warenkorb.java @@ -0,0 +1,57 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.modell.objects.dto; + +import java.util.ArrayList; +import java.util.List; + +/** + * + * @author Holger + */ +public class Warenkorb { + + private final List<Product> products; + private int anzahl = 0; + + public Warenkorb() { + products = new ArrayList<>(); + } + + public void add(Product p) { + if (p == null) { + throw new NullPointerException("Produkt darf nicht null sein!"); + } + ++anzahl; + products.add(p); + } + + public void remove(Product p) { + if (p == null) { + throw new NullPointerException("Produkt darf nicht null sein!"); + } + if (!products.contains(p)) { + throw new IllegalArgumentException("Das Produkt ist nicht im Warenkorb enthalten!"); + } + products.remove(p); + --anzahl; + } + + public double sum() { + return products.stream().mapToDouble(p -> p.getPrice()).sum(); + } + + public boolean contains(Product p) { + if (p == null) { + throw new NullPointerException("Produkt darf nicht null sein!"); + } + return products.contains(p); + } + + public int getAnzahl() { + return anzahl; + } +} diff --git a/src/main/java/org/s4s/services/db/JDBCConnection.java b/src/main/java/org/s4s/services/db/JDBCConnection.java new file mode 100644 index 0000000000000000000000000000000000000000..bab50cd45de2ca940937d3dbefeebfc828143889 --- /dev/null +++ b/src/main/java/org/s4s/services/db/JDBCConnection.java @@ -0,0 +1,79 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.services.db; + +import java.sql.*; +import java.util.*; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author Holger + */ +public class JDBCConnection { + + private static JDBCConnection connection = null; + + private String url = "jdbc:postgresql://dumbo.inf.fh-bonn-rhein-sieg.de/svolle2s"; + private Connection conn; + + public static JDBCConnection getInstance() { + if (connection == null) { + connection = new JDBCConnection(); + } + return connection; + } + + private JDBCConnection() { + this.initConnection(); + } + + private void initConnection() { + try { + DriverManager.registerDriver(new org.postgresql.Driver()); + this.openConnection(); + } catch (SQLException ex) { + Logger.getLogger(JDBCConnection.class.getName()).log(Level.SEVERE, null, ex); + } + } + + private void openConnection() { + try { + + // if (!this.conn.isClosed()) { + // return; + // } + Properties props = new Properties(); + props.setProperty("userLogin", "svolle2s"); + props.setProperty("password", "svolle2s"); + this.conn = DriverManager.getConnection(this.url, props); + + } catch (SQLException ex) { + Logger.getLogger(JDBCConnection.class.getName()).log(Level.SEVERE, null, ex); + } + } + + public Statement getStatement() { + try { + if (this.conn.isClosed()) { + this.openConnection(); + } + return this.conn.createStatement(); + } catch (SQLException ex) { + Logger.getLogger(JDBCConnection.class.getName()).log(Level.SEVERE, null, ex); + return null; + } + } + + public void closeConnection() { + try { + conn.close(); + } catch (SQLException ex) { + Logger.getLogger(JDBCConnection.class.getName()).log(Level.SEVERE, null, ex); + } + } +} diff --git a/src/main/java/org/s4s/services/util/Views.java b/src/main/java/org/s4s/services/util/Views.java new file mode 100644 index 0000000000000000000000000000000000000000..263d4d67ff3aa0185ab8aee5a450a021f88b8df9 --- /dev/null +++ b/src/main/java/org/s4s/services/util/Views.java @@ -0,0 +1,29 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.services.util; + +/** + * + * @author Holger + */ +public final class Views { + public final static String WELCOME = "welcome"; + public final static String SHOP = "shop"; + public final static String LOGIN = "login"; + public final static String WARENKORB = "warenkorb"; + public final static String BENUTZERKONTO = "benutzerkonto"; + public final static String PASSWORT = "passwort"; + public final static String ARTIKELDETAILS = "artikeldetails"; + public final static String CHECKOUT = "checkout"; + public final static String IMPRESSUM = "impressum"; + public final static String FAQ = "faq"; + public final static String KAUFBESTAETIGUNG = "kaufbestaetigung"; + public final static String VERKAEUFERBEWERTUNG = "verkaeuferbewertung"; + + private Views(){ + + } +} diff --git a/src/test/java/org/s4s/matchers/UtilityMatchers.java b/src/test/java/org/s4s/matchers/UtilityMatchers.java new file mode 100644 index 0000000000000000000000000000000000000000..4a05d90d2c7cde0f1d6f75183e0173d7a2686540 --- /dev/null +++ b/src/test/java/org/s4s/matchers/UtilityMatchers.java @@ -0,0 +1,77 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.matchers; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import lombok.SneakyThrows; +import org.hamcrest.Description; +import org.hamcrest.Matcher; +import org.hamcrest.TypeSafeMatcher; + +public class UtilityMatchers { + + public static Matcher isWellDefinedUtilityClass() { + return new TypeSafeMatcher<Class>() { + private boolean isFinal; + private boolean onlyOneCtor; + private boolean isConstructorPrivate; + private Method nonStaticMethod; + + @Override + @SneakyThrows({NoSuchMethodException.class, InstantiationException.class, IllegalAccessException.class, InvocationTargetException.class}) + protected boolean matchesSafely(Class clazz) { + isFinal = Modifier.isFinal(clazz.getModifiers()); + if (!isFinal) { + return false; + } + + onlyOneCtor = clazz.getDeclaredConstructors().length == 1; + if (!onlyOneCtor) { + return false; + } + + final Constructor<?> constructor = clazz.getDeclaredConstructor(); + isConstructorPrivate = !constructor.isAccessible() && Modifier.isPrivate(constructor.getModifiers()); + if (!isConstructorPrivate) { + return false; + } + + constructor.setAccessible(true); + constructor.newInstance(); + constructor.setAccessible(false); + for (final Method method : clazz.getMethods()) { + if (!Modifier.isStatic(method.getModifiers()) + && method.getDeclaringClass().equals(clazz)) { + nonStaticMethod = method; + return false; + } + } + + return true; + } + + @Override + public void describeTo(Description description) { + description.appendText("Class must be a well defined utility class "); + } + + @Override + protected void describeMismatchSafely(final Class item, final Description mismatchDescription) { + if (!isFinal) { + mismatchDescription.appendText(" class is not final"); + } else if (!onlyOneCtor) { + mismatchDescription.appendText(" has not exactly one constructor"); + } else if (!isConstructorPrivate) { + mismatchDescription.appendText(" constructor is not private"); + } else if (nonStaticMethod != null) { + mismatchDescription.appendText(" method ").appendValue(nonStaticMethod).appendText(" is not static"); + } + } + }; + } +} diff --git a/src/test/java/org/s4s/modell/object/dto/ProductTest.java b/src/test/java/org/s4s/modell/object/dto/ProductTest.java new file mode 100644 index 0000000000000000000000000000000000000000..3891b1c3af47b392624a87d5eceaeec2a0a48270 --- /dev/null +++ b/src/test/java/org/s4s/modell/object/dto/ProductTest.java @@ -0,0 +1,40 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.modell.object.dto; +import java.util.HashMap; +import java.util.Map; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.hasEntry; +import static org.hamcrest.Matchers.not; +import org.junit.Before; +import org.junit.Test; +import org.s4s.modell.objects.dto.Product; + +/** + * + * @author Holger + */ +public class ProductTest { + + @Test + public void shouldComplyHashCodeContract() { + + Product p1 = new Product("Glühbirne", 1, "Elektronik",1.50, "Halt ne Glühbirne"); + Product p2 = new Product("Glühbirne", 1, "Elektronik",1.50, "Halt ne Glühbirne"); + Product p3 = new Product("LED", 2, "Elektronik",7.99, "Halt ein LED"); + + Map<Product, String> map = new HashMap<>(); + + map.put(p1, "a"); + map.put(p2, "b"); + map.put(p3, "c"); + + assertThat(map, not(hasEntry(new Product("Glühbirne", 1, "Elektronik",1.50, "Halt ne Glühbirne"), "a"))); + assertThat(map, hasEntry(new Product("Glühbirne", 1, "Elektronik",1.50, "Halt ne Glühbirne"), "b")); + assertThat(map, hasEntry(new Product("LED", 2, "Elektronik",7.99, "Halt ein LED"), "c")); + } + +} diff --git a/src/test/java/org/s4s/modell/object/dto/WarenkorbTest.java b/src/test/java/org/s4s/modell/object/dto/WarenkorbTest.java new file mode 100644 index 0000000000000000000000000000000000000000..0fef861cc5a8b7d2a568dc69c143f65064310ccb --- /dev/null +++ b/src/test/java/org/s4s/modell/object/dto/WarenkorbTest.java @@ -0,0 +1,74 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.modell.object.dto; + + +import org.junit.Assert; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import org.junit.Before; +import org.junit.Test; +import org.s4s.modell.objects.dto.Product; +import org.s4s.modell.objects.dto.Warenkorb; + +/** + * + * @author Holger + */ +public class WarenkorbTest { + Product p1 = new Product(); + Product p2 = new Product(); + Product p3 = new Product(); + Warenkorb warenkorb; + + @Before + public void setUp(){ + warenkorb = new Warenkorb(); + p1 = new Product("Glühbirne", 1, "Elektronik",1.50, "Halt ne Glühbirne"); + p2 = new Product("LED", 2, "Elektronik",7.99, "Halt ein LED"); + p3 = new Product("Neonröhre", 3, "Elektronik",19.95, "Halt ne Neonröhre"); + } + @Test(expected = NullPointerException.class) + public void test_add(){ + warenkorb.add(p1); + assertTrue(warenkorb.contains(p1)); + warenkorb.add(p2); + assertTrue(warenkorb.contains(p2)); + warenkorb.add(p3); + assertTrue(warenkorb.contains(p3)); + warenkorb.add(null); + + } + + @Test(expected = NullPointerException.class) + public void test_remove(){ + warenkorb.add(p1); + warenkorb.remove(p1); + assertFalse(warenkorb.contains(p1)); + warenkorb.remove(null); + } + + @Test(expected = IllegalArgumentException.class) + public void test_remove_notcontains(){ + warenkorb.remove(p1); + + } + @Test + public void test_sum(){ + warenkorb.add(p1); + assertEquals(1.50,warenkorb.sum(), 0.001); + warenkorb.add(p2); + assertEquals(9.49,warenkorb.sum(), 0.001); + warenkorb.add(p3); + assertEquals(29.44,warenkorb.sum(), 0.001); + } + + @Test(expected = NullPointerException.class) + public void test_contains(){ + warenkorb.contains(null); + } +} diff --git a/src/test/java/org/s4s/services/util/ViewsTest.java b/src/test/java/org/s4s/services/util/ViewsTest.java new file mode 100644 index 0000000000000000000000000000000000000000..28527ef24aecab1ad4a6bf6bdcaaf534c28e9f47 --- /dev/null +++ b/src/test/java/org/s4s/services/util/ViewsTest.java @@ -0,0 +1,21 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.s4s.services.util; + +import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.Test; +import static org.s4s.matchers.UtilityMatchers.isWellDefinedUtilityClass; + +/** + * + * @author Holger + */ +public class ViewsTest { + @Test + public void shouldCheckIfUtilityClassIsWellCoded() throws Exception { + assertThat(Views.class, isWellDefinedUtilityClass()); + } +} diff --git a/target/classes/org/s4s/MyUI$MyUIServlet.class b/target/classes/org/s4s/MyUI$MyUIServlet.class index 2ee6f97f5dd8ede813ee17667fe276ea918ffcaf..4fabc72c0a6cea28aa4c3c0ecb4b0523252f2231 100644 Binary files a/target/classes/org/s4s/MyUI$MyUIServlet.class and b/target/classes/org/s4s/MyUI$MyUIServlet.class differ diff --git a/target/classes/org/s4s/MyUI.class b/target/classes/org/s4s/MyUI.class index 7fd5e05e59bc505fb02cd67306c886da9bc764ec..b7c2a3afa945bd0a41c50b09c320e030d3531a00 100644 Binary files a/target/classes/org/s4s/MyUI.class and b/target/classes/org/s4s/MyUI.class differ diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst index 43046df845f418ea34302c9696ae1d0e2580f749..2c5883f675cfb93063ef62f0607974fbfc870217 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -1,2 +1,18 @@ -org\s4s\MyUI$MyUIServlet.class +org\s4s\gui\views\PasswortView.class +org\s4s\modell\objects\dto\Product.class +org\s4s\gui\views\VerkaeuferbewertungView.class +org\s4s\modell\objects\dto\Warenkorb.class org\s4s\MyUI.class +org\s4s\gui\views\ImpressumView.class +org\s4s\gui\views\FaqView.class +org\s4s\gui\views\KaufbestaetigungView.class +org\s4s\gui\views\WarenkorbView.class +org\s4s\gui\views\CheckoutView.class +org\s4s\gui\views\WelcomeView.class +org\s4s\gui\views\ShopView.class +org\s4s\dao\DAOException.class +org\s4s\gui\views\BenutzerkontoView.class +org\s4s\dao\NoSuchUserOrPassword.class +org\s4s\services\util\Views.class +org\s4s\gui\views\ArtikeldetailsView.class +org\s4s\MyUI$MyUIServlet.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst index 775437f85ab3f83838724a5f87b37de1997b5907..d5ef86ce3e216908225081a34ea0d21d51aafc0e 100644 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -1 +1,25 @@ -C:\Users\Holger\Documents\NetBeansProjects\s4s\src\main\java\org\s4s\MyUI.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\WelcomeView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\dao\ProductDAO.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\PasswortView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\ArtikeldetailsView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\BenutzerkontoView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\CheckoutView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\WarenkorbView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\dao\KundenDAO.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\MyUI.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\LoginView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\modell\objects\dto\Warenkorb.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\ShopView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\dao\impl\AbstractDatabaseClass.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\KaufbestaetigungView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\dao\impl\ProductSearch.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\dao\DAOException.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\services\db\JDBCConnection.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\FaqView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\dao\impl\LoginControl.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\modell\objects\dto\Product.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\ImpressumView.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\modell\objects\dto\User.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\services\util\Views.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\dao\NoSuchUserOrPassword.java +C:\Users\Holger\Documents\NetBeansProjects\s4s_MeineTests\src\main\java\org\s4s\gui\views\VerkaeuferbewertungView.java