{"action":"created","comment":{"url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/comments/80886932","pull_request_review_id":1907435,"id":80886932,"diff_hunk":"@@ -0,0 +1,86 @@\n+/**\n+ * Copyright 2015-2016 Red Hat, Inc, and individual contributors.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.wildfly.swarm.logging;\n+\n+import java.io.BufferedReader;\n+import java.io.File;\n+import java.io.FileNotFoundException;\n+import java.io.FileReader;\n+import java.util.List;\n+import java.util.UUID;\n+import java.util.stream.Collectors;\n+\n+import org.jboss.arquillian.container.test.api.Deployment;\n+import org.jboss.arquillian.junit.Arquillian;\n+import org.jboss.logging.Logger;\n+import org.jboss.shrinkwrap.api.Archive;\n+import org.jboss.shrinkwrap.api.ShrinkWrap;\n+import org.jboss.shrinkwrap.api.asset.EmptyAsset;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.wildfly.swarm.Swarm;\n+import org.wildfly.swarm.arquillian.CreateSwarm;\n+import org.wildfly.swarm.config.logging.Level;\n+import org.wildfly.swarm.spi.api.JARArchive;\n+\n+import static org.junit.Assert.assertFalse;\n+import static org.junit.Assert.assertTrue;\n+\n+/**\n+ * @author Charles Moulliard\n+ */\n+@RunWith(Arquillian.class)\n+public class DefaultFileLoggingArquillianTest {\n+\n+    final static String logFile = System.getProperty(\"user.dir\") + File.separator + \"swarm.log\";\n+\n+    @Deployment\n+    public static Archive createDeployment() {\n+        JARArchive archive = ShrinkWrap.create(JARArchive.class, \"empty.jar\");\n+        archive.addPackage(DefaultFileLoggingArquillianTest.class.getPackage());\n+        return archive;\n+    }\n+\n+    @CreateSwarm\n+    public static Swarm newContainer() throws Exception {\n+        return new Swarm()\n+                .fraction(new LoggingFraction()\n+                                  .createFileLoggingFraction());\n+    }\n+\n+    @Test\n+    public void doLogging() throws FileNotFoundException {\n+        String message = \"testing: \" + UUID.randomUUID().toString();\n+        Logger logger = Logger.getLogger(\"org.wildfly.swarm.logging\");\n+        logger.info(message);\n+        assertTrue(\"File not found: \" + logFile, new File(logFile).exists());\n+\n+        BufferedReader reader = new BufferedReader(new FileReader(logFile));\n+        List<String> lines = reader.lines().collect(Collectors.toList());","path":"testsuite/testsuite-logging/src/test/java/org/wildfly/swarm/logging/DefaultFileLoggingArquillianTest.java","position":72,"original_position":72,"commit_id":"0f147df2ed6183956e1755c4932fb5fc7c653666","original_commit_id":"0f147df2ed6183956e1755c4932fb5fc7c653666","user":{"login":"gastaldi","id":54133,"avatar_url":"https://avatars.githubusercontent.com/u/54133?v=3","gravatar_id":"","url":"https://api.github.com/users/gastaldi","html_url":"https://github.com/gastaldi","followers_url":"https://api.github.com/users/gastaldi/followers","following_url":"https://api.github.com/users/gastaldi/following{/other_user}","gists_url":"https://api.github.com/users/gastaldi/gists{/gist_id}","starred_url":"https://api.github.com/users/gastaldi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gastaldi/subscriptions","organizations_url":"https://api.github.com/users/gastaldi/orgs","repos_url":"https://api.github.com/users/gastaldi/repos","events_url":"https://api.github.com/users/gastaldi/events{/privacy}","received_events_url":"https://api.github.com/users/gastaldi/received_events","type":"User","site_admin":false},"body":"You need to close this reader or use Files.readAllLines(Path) instead","created_at":"2016-09-28T10:33:02Z","updated_at":"2016-09-28T10:34:16Z","html_url":"https://github.com/wildfly-swarm/wildfly-swarm/pull/156#discussion_r80886932","pull_request_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/156","_links":{"self":{"href":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/comments/80886932"},"html":{"href":"https://github.com/wildfly-swarm/wildfly-swarm/pull/156#discussion_r80886932"},"pull_request":{"href":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/156"}}},"pull_request":{"url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/156","id":87089080,"html_url":"https://github.com/wildfly-swarm/wildfly-swarm/pull/156","diff_url":"https://github.com/wildfly-swarm/wildfly-swarm/pull/156.diff","patch_url":"https://github.com/wildfly-swarm/wildfly-swarm/pull/156.patch","issue_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/issues/156","number":156,"state":"open","locked":false,"title":"Swarm 720 - Update Logging Fraction to support the creation of a default File Logging handler","user":{"login":"cmoulliard","id":463790,"avatar_url":"https://avatars.githubusercontent.com/u/463790?v=3","gravatar_id":"","url":"https://api.github.com/users/cmoulliard","html_url":"https://github.com/cmoulliard","followers_url":"https://api.github.com/users/cmoulliard/followers","following_url":"https://api.github.com/users/cmoulliard/following{/other_user}","gists_url":"https://api.github.com/users/cmoulliard/gists{/gist_id}","starred_url":"https://api.github.com/users/cmoulliard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmoulliard/subscriptions","organizations_url":"https://api.github.com/users/cmoulliard/orgs","repos_url":"https://api.github.com/users/cmoulliard/repos","events_url":"https://api.github.com/users/cmoulliard/events{/privacy}","received_events_url":"https://api.github.com/users/cmoulliard/received_events","type":"User","site_admin":false},"body":"- Update Logging Fraction to support the creation of a default File Logging handler\r\n- Add new default values : DEFAULT_FILE_HANDLER_NAME, DEFAULT_LOGGING_FILE_NAME, DEFAULT_LOGGING_DIR\r\n- Design new test cases to support the DSL\r\n- Include package name to also configure the Logger with the level passed\r\n\r\n","created_at":"2016-09-28T10:01:00Z","updated_at":"2016-09-28T10:34:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02dbfcd45228001d5886972583bbb8d82c3b9f17","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/156/commits","review_comments_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/156/comments","review_comment_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/issues/156/comments","statuses_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/statuses/0f147df2ed6183956e1755c4932fb5fc7c653666","head":{"label":"cmoulliard:swarm-720","ref":"swarm-720","sha":"0f147df2ed6183956e1755c4932fb5fc7c653666","user":{"login":"cmoulliard","id":463790,"avatar_url":"https://avatars.githubusercontent.com/u/463790?v=3","gravatar_id":"","url":"https://api.github.com/users/cmoulliard","html_url":"https://github.com/cmoulliard","followers_url":"https://api.github.com/users/cmoulliard/followers","following_url":"https://api.github.com/users/cmoulliard/following{/other_user}","gists_url":"https://api.github.com/users/cmoulliard/gists{/gist_id}","starred_url":"https://api.github.com/users/cmoulliard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmoulliard/subscriptions","organizations_url":"https://api.github.com/users/cmoulliard/orgs","repos_url":"https://api.github.com/users/cmoulliard/repos","events_url":"https://api.github.com/users/cmoulliard/events{/privacy}","received_events_url":"https://api.github.com/users/cmoulliard/received_events","type":"User","site_admin":false},"repo":{"id":62284634,"name":"wildfly-swarm-core","full_name":"cmoulliard/wildfly-swarm-core","owner":{"login":"cmoulliard","id":463790,"avatar_url":"https://avatars.githubusercontent.com/u/463790?v=3","gravatar_id":"","url":"https://api.github.com/users/cmoulliard","html_url":"https://github.com/cmoulliard","followers_url":"https://api.github.com/users/cmoulliard/followers","following_url":"https://api.github.com/users/cmoulliard/following{/other_user}","gists_url":"https://api.github.com/users/cmoulliard/gists{/gist_id}","starred_url":"https://api.github.com/users/cmoulliard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmoulliard/subscriptions","organizations_url":"https://api.github.com/users/cmoulliard/orgs","repos_url":"https://api.github.com/users/cmoulliard/repos","events_url":"https://api.github.com/users/cmoulliard/events{/privacy}","received_events_url":"https://api.github.com/users/cmoulliard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cmoulliard/wildfly-swarm-core","description":"Core fractions","fork":true,"url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core","forks_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/forks","keys_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/teams","hooks_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/hooks","issue_events_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/issues/events{/number}","events_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/events","assignees_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/assignees{/user}","branches_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/branches{/branch}","tags_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/tags","blobs_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/languages","stargazers_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/stargazers","contributors_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/contributors","subscribers_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/subscribers","subscription_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/subscription","commits_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/contents/{+path}","compare_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/merges","archive_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/downloads","issues_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/issues{/number}","pulls_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/labels{/name}","releases_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/releases{/id}","deployments_url":"https://api.github.com/repos/cmoulliard/wildfly-swarm-core/deployments","created_at":"2016-06-30T06:17:16Z","updated_at":"2016-06-30T06:17:18Z","pushed_at":"2016-09-28T09:59:32Z","git_url":"git://github.com/cmoulliard/wildfly-swarm-core.git","ssh_url":"git@github.com:cmoulliard/wildfly-swarm-core.git","clone_url":"https://github.com/cmoulliard/wildfly-swarm-core.git","svn_url":"https://github.com/cmoulliard/wildfly-swarm-core","homepage":"","size":9170,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wildfly-swarm:master","ref":"master","sha":"635a19b363b965447c21b0f2343992b180640369","user":{"login":"wildfly-swarm","id":11523816,"avatar_url":"https://avatars.githubusercontent.com/u/11523816?v=3","gravatar_id":"","url":"https://api.github.com/users/wildfly-swarm","html_url":"https://github.com/wildfly-swarm","followers_url":"https://api.github.com/users/wildfly-swarm/followers","following_url":"https://api.github.com/users/wildfly-swarm/following{/other_user}","gists_url":"https://api.github.com/users/wildfly-swarm/gists{/gist_id}","starred_url":"https://api.github.com/users/wildfly-swarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wildfly-swarm/subscriptions","organizations_url":"https://api.github.com/users/wildfly-swarm/orgs","repos_url":"https://api.github.com/users/wildfly-swarm/repos","events_url":"https://api.github.com/users/wildfly-swarm/events{/privacy}","received_events_url":"https://api.github.com/users/wildfly-swarm/received_events","type":"Organization","site_admin":false},"repo":{"id":52040340,"name":"wildfly-swarm","full_name":"wildfly-swarm/wildfly-swarm","owner":{"login":"wildfly-swarm","id":11523816,"avatar_url":"https://avatars.githubusercontent.com/u/11523816?v=3","gravatar_id":"","url":"https://api.github.com/users/wildfly-swarm","html_url":"https://github.com/wildfly-swarm","followers_url":"https://api.github.com/users/wildfly-swarm/followers","following_url":"https://api.github.com/users/wildfly-swarm/following{/other_user}","gists_url":"https://api.github.com/users/wildfly-swarm/gists{/gist_id}","starred_url":"https://api.github.com/users/wildfly-swarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wildfly-swarm/subscriptions","organizations_url":"https://api.github.com/users/wildfly-swarm/orgs","repos_url":"https://api.github.com/users/wildfly-swarm/repos","events_url":"https://api.github.com/users/wildfly-swarm/events{/privacy}","received_events_url":"https://api.github.com/users/wildfly-swarm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wildfly-swarm/wildfly-swarm","description":"Source code for the WildFly Swarm project","fork":false,"url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm","forks_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/forks","keys_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/teams","hooks_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/hooks","issue_events_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/issues/events{/number}","events_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/events","assignees_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/assignees{/user}","branches_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/branches{/branch}","tags_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/tags","blobs_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/git/refs{/sha}","trees_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/statuses/{sha}","languages_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/languages","stargazers_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/stargazers","contributors_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/contributors","subscribers_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/subscribers","subscription_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/subscription","commits_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/commits{/sha}","git_commits_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/git/commits{/sha}","comments_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/comments{/number}","issue_comment_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/issues/comments{/number}","contents_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/contents/{+path}","compare_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/merges","archive_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/downloads","issues_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/issues{/number}","pulls_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls{/number}","milestones_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/milestones{/number}","notifications_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/labels{/name}","releases_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/releases{/id}","deployments_url":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/deployments","created_at":"2016-02-18T21:32:47Z","updated_at":"2016-09-28T03:00:33Z","pushed_at":"2016-09-28T10:01:00Z","git_url":"git://github.com/wildfly-swarm/wildfly-swarm.git","ssh_url":"git@github.com:wildfly-swarm/wildfly-swarm.git","clone_url":"https://github.com/wildfly-swarm/wildfly-swarm.git","svn_url":"https://github.com/wildfly-swarm/wildfly-swarm","homepage":"http://wildfly-swarm.io/","size":9362,"stargazers_count":71,"watchers_count":71,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":4,"forks":52,"open_issues":4,"watchers":71,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/156"},"html":{"href":"https://github.com/wildfly-swarm/wildfly-swarm/pull/156"},"issue":{"href":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/issues/156"},"comments":{"href":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/issues/156/comments"},"review_comments":{"href":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/156/comments"},"review_comment":{"href":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/pulls/156/commits"},"statuses":{"href":"https://api.github.com/repos/wildfly-swarm/wildfly-swarm/statuses/0f147df2ed6183956e1755c4932fb5fc7c653666"}}}}
{"actor":{"display_login":"gastaldi"}}