在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:agoncal/agoncal-application-petstore-ee7开源软件地址:https://github.com/agoncal/agoncal-application-petstore-ee7开源编程语言:Java 63.4%开源软件介绍:Application - Petstore Java EE 7
Purpose of this applicationDo you remember the good old Java Petstore ? It was a sample application created by Sun for its Java BluePrints program. The Java Petstore was designed to illustrate how J2EE (and then Java EE) could be used to develop an eCommerce web application. Yes, the point of the Petstore is to sell pets online. The Petstore had a huge momentum and we started to see plenty of Petstore-like applications flourish. The idea was to build an application with a certain technology. Let's face it, the J2EE version was far too complex using plenty of (today outdated) design patterns. When I wrote my Java EE 5 book back in 2006, I decided to write a Petstore-like application but much simpler. But again, it's out-dated today. What you have here is another Petstore-like application but using Java EE 7 and all its goodies (CDI, EJB Lite, REST interface). It is based on the Petstore I developed for my Java EE 5 book (sorry, it's written in French). I've updated it based on my Java EE 6 book, and now I'm updating it again so it uses some new features of Java EE 7 described on my Java EE 7 book. The goals of this sample is to :
If you want to use a different web interface, external frameworks, add some sexy alternative JVM language... feel free to fork the code. But the goal of this EE 7 Petstore is to remain simple and to stick to Java EE 7. The only external framework used are Arquillian, Twitter Bootstrap and PrimeFaces. Arquillian is used for integration testing. Using Maven profile, you can test services, injection, persistence... against different application servers. Twitter Bootstrap and PrimeFaces bring a bit of beauty to the web interface. Compile and packageBeing Maven centric, you can compile and package it without tests using Test with ArquillianLaunching tests under WildFly is straight forward. You only have to launch WidlFly and execute the tests using the Maven profile :
Or if you prefer the managed mode :
Execute the sampleOnce deployed go to the following URL and start buying some pets: http://localhost:8080/applicationPetstore. The admin REST interface allows you to create/update/remove items in the catalog, orders or customers. You can run the following curl commands :
You can also get a JSON representation as follow :
Check the Swagger contract on : http://localhost:8080/applicationPetstore/swagger.json DatabasesThe
H2By default, the application uses the in-memory H2 database. If you log into the WildFly Admin Console, go to http://localhost:9990/console/App.html#profile/datasources;name=ExampleDS and you will see the H2 Driver as well as the Connection URL pointing at the in-memory H2 database PostgresqlIf instead a H2 in-memory database you want to use PostgreSQL, you need to do the following steps. Install the PostgreSQL driver into WildflyThis good article explains you how.
Modify the default DatasourceIn the Wildfly Admin Console check the default datasource ExampleDS. As you can see, it points to an in-memory H2 database. Make the following changes so it points at Postgres:
Once Postgres is up and running, you can hit the button Startup PostgreSQLThe easiest is to use the Docker file to start Postgres
Test this application on CloudBeesThird Party Tools & FrameworksTwitter BootstrapWhen, like me, you have no web designer skills at all and your web pages look ugly, you use Twitter Bootstrap ;o) IconsI use:
ArquillianArquillian for the integration tests. DeveloppersSome people who worked on this project :
Bugs & WorkaroundLicensing
antonio goncalves
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论