Repository: incubator-apex-core Updated Branches: refs/heads/devel-3 15ff42d8d -> 2c5ccb016
APEX-198 Modify test to create user directory under target. Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/commit/2c5ccb01 Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/tree/2c5ccb01 Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-core/diff/2c5ccb01 Branch: refs/heads/devel-3 Commit: 2c5ccb0166addee37cedaa495de29824e0f499a0 Parents: 15ff42d Author: David Yan <[email protected]> Authored: Tue Oct 20 14:50:02 2015 -0700 Committer: David Yan <[email protected]> Committed: Tue Oct 20 15:37:04 2015 -0700 ---------------------------------------------------------------------- .../com/datatorrent/stram/cli/DTCliTest.java | 7 +++- .../resources/testAppPackage/.dt/dt-site.xml | 39 -------------------- .../test/resources/testAppPackage/dt-site.xml | 39 ++++++++++++++++++++ 3 files changed, 44 insertions(+), 41 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/2c5ccb01/engine/src/test/java/com/datatorrent/stram/cli/DTCliTest.java ---------------------------------------------------------------------- diff --git a/engine/src/test/java/com/datatorrent/stram/cli/DTCliTest.java b/engine/src/test/java/com/datatorrent/stram/cli/DTCliTest.java index f8e1789..59a45aa 100644 --- a/engine/src/test/java/com/datatorrent/stram/cli/DTCliTest.java +++ b/engine/src/test/java/com/datatorrent/stram/cli/DTCliTest.java @@ -64,7 +64,10 @@ public class DTCliTest { try { userHome = System.getProperty("user.home"); - env.put("HOME", System.getProperty("user.dir") + "/src/test/resources/testAppPackage"); + String newHome = System.getProperty("user.dir") + "/target"; + FileUtils.forceMkdir(new File(newHome + "/.dt")); + FileUtils.copyFile(new File(System.getProperty("user.dir") + "/src/test/resources/testAppPackage/dt-site.xml"), new File(newHome + "/.dt/dt-site.xml")); + env.put("HOME", newHome); setEnv(env); cli.init(); @@ -83,7 +86,7 @@ public class DTCliTest public static void finished() { try { - env.put("HOME", System.getProperty("user.dir") + userHome); + env.put("HOME", userHome); setEnv(env); StramTestSupport.removeAppPackageFile(); http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/2c5ccb01/engine/src/test/resources/testAppPackage/.dt/dt-site.xml ---------------------------------------------------------------------- diff --git a/engine/src/test/resources/testAppPackage/.dt/dt-site.xml b/engine/src/test/resources/testAppPackage/.dt/dt-site.xml deleted file mode 100644 index f247ac9..0000000 --- a/engine/src/test/resources/testAppPackage/.dt/dt-site.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- - - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. - ---> -<configuration> - <property> - <name>dt.test.1</name> - <value>user-home-config</value> - </property> - <property> - <name>dt.test.2</name> - <value>user-home-config</value> - </property> - <property> - <name>dt.test.3</name> - <value>user-home-config</value> - </property> - <property> - <name>dt.test.4</name> - <value>user-home-config</value> - </property> -</configuration> http://git-wip-us.apache.org/repos/asf/incubator-apex-core/blob/2c5ccb01/engine/src/test/resources/testAppPackage/dt-site.xml ---------------------------------------------------------------------- diff --git a/engine/src/test/resources/testAppPackage/dt-site.xml b/engine/src/test/resources/testAppPackage/dt-site.xml new file mode 100644 index 0000000..f247ac9 --- /dev/null +++ b/engine/src/test/resources/testAppPackage/dt-site.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +--> +<configuration> + <property> + <name>dt.test.1</name> + <value>user-home-config</value> + </property> + <property> + <name>dt.test.2</name> + <value>user-home-config</value> + </property> + <property> + <name>dt.test.3</name> + <value>user-home-config</value> + </property> + <property> + <name>dt.test.4</name> + <value>user-home-config</value> + </property> +</configuration>
