You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dm...@apache.org on 2016/01/27 11:06:07 UTC
[1/2] ignite git commit: IGNITE-944: proper look up of a default log
file name
Repository: ignite
Updated Branches:
refs/heads/master b294ac924 -> da4da8b99
IGNITE-944: proper look up of a default log file name
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/31eb38d7
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/31eb38d7
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/31eb38d7
Branch: refs/heads/master
Commit: 31eb38d72cd451f8499725a1019a837cc7a6fe0c
Parents: 4edc7bd
Author: Saikat Maitra <sa...@gmail.com>
Authored: Wed Jan 27 13:01:41 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jan 27 13:01:41 2016 +0300
----------------------------------------------------------------------
modules/core/pom.xml | 3 -
.../handlers/log/GridLogCommandHandler.java | 16 ++----
.../handlers/log/GridLogCommandHandlerTest.java | 58 +++++++++++++++++---
3 files changed, 55 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/31eb38d7/modules/core/pom.xml
----------------------------------------------------------------------
diff --git a/modules/core/pom.xml b/modules/core/pom.xml
index bdf822b..b07a754 100644
--- a/modules/core/pom.xml
+++ b/modules/core/pom.xml
@@ -229,9 +229,6 @@
<exclude>**/*.java</exclude>
</excludes>
</testResource>
- <testResource>
- <directory>src/test/resources</directory>
- </testResource>
</testResources>
<plugins>
http://git-wip-us.apache.org/repos/asf/ignite/blob/31eb38d7/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
index 4957993..603faf3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandler.java
@@ -18,16 +18,11 @@ package org.apache.ignite.internal.processors.rest.handlers.log;
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
-import java.net.URI;
-import java.nio.charset.Charset;
-import java.nio.file.Files;
import java.nio.file.InvalidPathException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
import java.util.Collection;
+
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.GridKernalContext;
import org.apache.ignite.internal.IgniteInternalFuture;
@@ -51,11 +46,6 @@ public class GridLogCommandHandler extends GridRestCommandHandlerAdapter {
private static final Collection<GridRestCommand> SUPPORTED_COMMANDS = U.sealList(LOG);
/**
- * Default log file name *
- */
- private static final String DEFAULT_LOG_PATH = "work/log/ignite.log";
-
- /**
* Default log file start line number *
*/
private static final int DEFAULT_FROM = 0;
@@ -126,7 +116,9 @@ public class GridLogCommandHandler extends GridRestCommandHandlerAdapter {
if (req0.path() != null)
logFile = new File(req0.path());
else
- logFile = new File(ctx.config().getIgniteHome() + "/" + DEFAULT_LOG_PATH);
+ logFile = new File(log.fileName() == null ?
+ ctx.config().getIgniteHome() + "/" + "work/log/ignite.log" :
+ log.fileName());
}
catch (InvalidPathException e) {
return new GridFinishedFuture<>(new GridRestResponse(GridRestResponse.STATUS_FAILED,
http://git-wip-us.apache.org/repos/asf/ignite/blob/31eb38d7/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandlerTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandlerTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandlerTest.java
index cc673fb..572b267 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandlerTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/rest/handlers/log/GridLogCommandHandlerTest.java
@@ -16,7 +16,14 @@
*/
package org.apache.ignite.internal.processors.rest.handlers.log;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
import java.util.Collection;
+import java.util.List;
+
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.processors.rest.GridRestCommand;
import org.apache.ignite.internal.processors.rest.GridRestResponse;
@@ -28,6 +35,45 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
* REST log command handler tests.
*/
public class GridLogCommandHandlerTest extends GridCommonAbstractTest {
+ /** */
+ private String igniteHome = System.getProperty("user.dir");
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTestsStarted() throws Exception {
+ super.beforeTestsStarted();
+
+ List<String> lines = Arrays.asList("[22:01:30,329][INFO ][grid-load-test-thread-12][GridDeploymentLocalStore] ",
+ "[22:01:30,329][INFO ][grid-load-test-thread-18][GridDeploymentLocalStore] Removed undeployed class: \n",
+ "[22:01:30,329][INFO ][grid-load-test-thread-18][GridDeploymentLocalStore] Task locally undeployed: \n"
+ );
+
+ Path file = Paths.get("test.log");
+ Files.write(file, lines, Charset.forName("UTF-8"));
+
+ lines = Arrays.asList("[22:01:30,329][INFO ][grid-load-test-thread-12][GridDeploymentLocalStore] ",
+ "[22:01:30,329][INFO ][grid-load-test-thread-18][GridDeploymentLocalStore] Removed undeployed class: \n",
+ "[22:01:30,329][INFO ][grid-load-test-thread-18][GridDeploymentLocalStore] Task locally undeployed: \n"
+ );
+
+ Path dir = Paths.get(igniteHome + "/work/log");
+ Files.createDirectories(dir);
+
+ file = Paths.get(igniteHome + "/work/log/" + "ignite.log");
+ Files.write(file, lines, Charset.forName("UTF-8"));
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTestsStopped() throws Exception {
+ Path file = Paths.get("test.log");
+ Files.delete(file);
+
+ Files.delete(Paths.get(igniteHome + "/work/log/" + "ignite.log"));
+ Files.delete(Paths.get(igniteHome + "/work/log/"));
+ Files.delete(Paths.get(igniteHome + "/work/"));
+
+ super.afterTestsStopped();
+ }
+
/**
* @throws Exception If failed.
*/
@@ -62,8 +108,7 @@ public class GridLogCommandHandlerTest extends GridCommonAbstractTest {
req.to(5);
req.from(2);
- req.path(getClass().getResource("/test.log").getFile());
-
+ req.path("test.log");
IgniteInternalFuture<GridRestResponse> resp = cmdHandler.handleAsync(req);
assertNull(resp.result().getError());
@@ -78,7 +123,7 @@ public class GridLogCommandHandlerTest extends GridCommonAbstractTest {
GridLogCommandHandler cmdHandler = new GridLogCommandHandler(newContext());
GridRestLogRequest req = new GridRestLogRequest();
- req.path(getClass().getResource("/test.log").getFile());
+ req.path("test.log");
IgniteInternalFuture<GridRestResponse> resp = cmdHandler.handleAsync(req);
@@ -92,7 +137,7 @@ public class GridLogCommandHandlerTest extends GridCommonAbstractTest {
*/
public void testHandleAsyncPathNotSet() throws Exception {
GridTestKernalContext ctx = newContext();
- ctx.config().setIgniteHome(getClass().getResource("/").getFile());
+ ctx.config().setIgniteHome(igniteHome);
GridLogCommandHandler cmdHandler = new GridLogCommandHandler(ctx);
GridRestLogRequest req = new GridRestLogRequest();
@@ -116,8 +161,7 @@ public class GridLogCommandHandlerTest extends GridCommonAbstractTest {
req.to(2);
req.from(5);
- req.path(getClass().getResource("/test.log").getFile());
-
+ req.path("test.log");
IgniteInternalFuture<GridRestResponse> resp = cmdHandler.handleAsync(req);
@@ -135,7 +179,7 @@ public class GridLogCommandHandlerTest extends GridCommonAbstractTest {
req.to(2);
req.from(2);
- req.path(getClass().getResource("/test.log").getFile());
+ req.path("test.log");
IgniteInternalFuture<GridRestResponse> resp = cmdHandler.handleAsync(req);
[2/2] ignite git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/ignite into master-main
Posted by dm...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/ignite into master-main
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/da4da8b9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/da4da8b9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/da4da8b9
Branch: refs/heads/master
Commit: da4da8b9905daeb4aa98b88fa3f6c2f714a0c2b1
Parents: 31eb38d b294ac9
Author: Denis Magda <dm...@gridgain.com>
Authored: Wed Jan 27 13:02:20 2016 +0300
Committer: Denis Magda <dm...@gridgain.com>
Committed: Wed Jan 27 13:02:20 2016 +0300
----------------------------------------------------------------------
examples/pom.xml | 2 +-
examples/schema-import/pom.xml | 2 +-
modules/aop/pom.xml | 2 +-
modules/apache-license-gen/pom.xml | 2 +-
modules/aws/pom.xml | 2 +-
modules/benchmarks/pom.xml | 5 ++---
modules/camel/pom.xml | 2 +-
modules/clients/pom.xml | 2 +-
modules/cloud/pom.xml | 2 +-
modules/codegen/pom.xml | 2 +-
modules/core/pom.xml | 2 +-
modules/core/src/main/resources/ignite.properties | 2 +-
modules/extdata/p2p/pom.xml | 2 +-
modules/extdata/uri/modules/uri-dependency/pom.xml | 2 +-
modules/extdata/uri/pom.xml | 2 +-
modules/flume/pom.xml | 2 +-
modules/gce/pom.xml | 2 +-
modules/geospatial/pom.xml | 2 +-
modules/hadoop/pom.xml | 2 +-
modules/hibernate/pom.xml | 2 +-
modules/indexing/pom.xml | 2 +-
modules/jcl/pom.xml | 2 +-
modules/jms11/pom.xml | 2 +-
modules/jta/pom.xml | 2 +-
modules/kafka/pom.xml | 2 +-
modules/log4j/pom.xml | 2 +-
modules/log4j2/pom.xml | 2 +-
modules/mesos/pom.xml | 2 +-
modules/mqtt/pom.xml | 2 +-
modules/osgi-karaf/pom.xml | 2 +-
modules/osgi-paxlogging/pom.xml | 2 +-
modules/osgi/pom.xml | 2 +-
modules/platforms/cpp/common/configure.ac | 2 +-
modules/platforms/cpp/core-test/configure.ac | 2 +-
modules/platforms/cpp/core/configure.ac | 2 +-
modules/platforms/cpp/examples/configure.ac | 2 +-
modules/platforms/cpp/ignite/configure.ac | 2 +-
.../dotnet/Apache.Ignite.Benchmarks/Properties/AssemblyInfo.cs | 6 +++---
.../Properties/AssemblyInfo.cs | 6 +++---
.../dotnet/Apache.Ignite.Core.Tests/Properties/AssemblyInfo.cs | 6 +++---
.../dotnet/Apache.Ignite.Core/Properties/AssemblyInfo.cs | 6 +++---
.../platforms/dotnet/Apache.Ignite/Properties/AssemblyInfo.cs | 6 +++---
.../examples/Apache.Ignite.Examples/Properties/AssemblyInfo.cs | 6 +++---
.../Apache.Ignite.ExamplesDll/Properties/AssemblyInfo.cs | 6 +++---
modules/rest-http/pom.xml | 2 +-
modules/scalar-2.10/pom.xml | 2 +-
modules/scalar/pom.xml | 2 +-
modules/schedule/pom.xml | 2 +-
modules/schema-import/pom.xml | 2 +-
modules/slf4j/pom.xml | 2 +-
modules/spark-2.10/pom.xml | 2 +-
modules/spark/pom.xml | 2 +-
modules/spring/pom.xml | 2 +-
modules/ssh/pom.xml | 2 +-
modules/storm/pom.xml | 6 ++----
modules/tools/pom.xml | 2 +-
modules/twitter/pom.xml | 2 +-
modules/urideploy/pom.xml | 2 +-
modules/visor-console-2.10/pom.xml | 2 +-
modules/visor-console/pom.xml | 2 +-
modules/visor-plugins/pom.xml | 2 +-
modules/web/pom.xml | 2 +-
modules/yardstick/pom.xml | 2 +-
modules/yarn/pom.xml | 2 +-
modules/zookeeper/pom.xml | 2 +-
pom.xml | 2 +-
66 files changed, 82 insertions(+), 85 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/da4da8b9/modules/core/pom.xml
----------------------------------------------------------------------