{"action":"created","issue":{"url":"https://api.github.com/repos/Valuya/comptoir/issues/140","repository_url":"https://api.github.com/repos/Valuya/comptoir","labels_url":"https://api.github.com/repos/Valuya/comptoir/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/Valuya/comptoir/issues/140/comments","events_url":"https://api.github.com/repos/Valuya/comptoir/issues/140/events","html_url":"https://github.com/Valuya/comptoir/pull/140","id":144948580,"number":140,"title":"Introduce Arquillian test environment","user":{"login":"cghislai","id":12647398,"avatar_url":"https://avatars.githubusercontent.com/u/12647398?v=3","gravatar_id":"","url":"https://api.github.com/users/cghislai","html_url":"https://github.com/cghislai","followers_url":"https://api.github.com/users/cghislai/followers","following_url":"https://api.github.com/users/cghislai/following{/other_user}","gists_url":"https://api.github.com/users/cghislai/gists{/gist_id}","starred_url":"https://api.github.com/users/cghislai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cghislai/subscriptions","organizations_url":"https://api.github.com/users/cghislai/orgs","repos_url":"https://api.github.com/users/cghislai/repos","events_url":"https://api.github.com/users/cghislai/events{/privacy}","received_events_url":"https://api.github.com/users/cghislai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-31T16:22:27Z","updated_at":"2016-04-05T03:48:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Valuya/comptoir/pulls/140","html_url":"https://github.com/Valuya/comptoir/pull/140","diff_url":"https://github.com/Valuya/comptoir/pull/140.diff","patch_url":"https://github.com/Valuya/comptoir/pull/140.patch"},"body":"I set up the Arquillian environment for comptoir-ejb\r\nIt is bound to a maven profile 'test'. \r\nI launch the maven test goal with the following settings:\r\n\r\n- WorkDir: comptoir-ejb\r\n- command line arguments: test -Ddb.napo.driver=com.mysql.jdbc.Driver -Ddb.napo.url=jdbc:mysql://localhost:3306/petitnapo -Ddb.napo.username=... -Ddb.napo.password=...\r\n-P test\r\n\r\nThe plugins in the POM will download a wildfly and start it as the Arquilllian container. I took Wildfly because it looked like the only JEE7 container supported.\r\nThe persistence.xml point to the default datasource enabled in the wildfly default config.\r\nThe persistence provider is Hibernate, so I had to make some small changes to support it.\r\nI created a StockEntries test to ensure stock entries are correctly updated when sales are open/closed.\r\n\r\nThe embedded wildfly will bind to port 8080, so it cannot be used when running the test suite."},"comment":{"url":"https://api.github.com/repos/Valuya/comptoir/issues/comments/205629367","html_url":"https://github.com/Valuya/comptoir/pull/140#issuecomment-205629367","issue_url":"https://api.github.com/repos/Valuya/comptoir/issues/140","id":205629367,"user":{"login":"ymajoros","id":2889296,"avatar_url":"https://avatars.githubusercontent.com/u/2889296?v=3","gravatar_id":"","url":"https://api.github.com/users/ymajoros","html_url":"https://github.com/ymajoros","followers_url":"https://api.github.com/users/ymajoros/followers","following_url":"https://api.github.com/users/ymajoros/following{/other_user}","gists_url":"https://api.github.com/users/ymajoros/gists{/gist_id}","starred_url":"https://api.github.com/users/ymajoros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymajoros/subscriptions","organizations_url":"https://api.github.com/users/ymajoros/orgs","repos_url":"https://api.github.com/users/ymajoros/repos","events_url":"https://api.github.com/users/ymajoros/events{/privacy}","received_events_url":"https://api.github.com/users/ymajoros/received_events","type":"User","site_admin":false},"created_at":"2016-04-05T03:48:57Z","updated_at":"2016-04-05T03:48:57Z","body":"Please do use the same database :-)\r\n\r\nThat way, you don't need to populate one. That also means: only one way to create a database, the test one is not different.\r\n\r\nThose tests won't ever run on production. They will run on a copy of it, from time to time, which is a good thing."}}