You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by wi...@apache.org on 2015/09/11 14:53:01 UTC

[1/3] git commit: updated refs/heads/master to 6330ef0

Repository: cloudstack
Updated Branches:
  refs/heads/master ba59a4333 -> 6330ef023


Removal of test/debug code.

Removed main() method from LocalTemplateDownloader.java

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5f2c732a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5f2c732a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5f2c732a

Branch: refs/heads/master
Commit: 5f2c732a2c3ff90c5d21c53477576b754d934305
Parents: 28d18dc
Author: borisroman <bo...@pcextreme.nl>
Authored: Wed Sep 9 11:16:14 2015 +0200
Committer: borisroman <bo...@pcextreme.nl>
Committed: Wed Sep 9 11:16:14 2015 +0200

----------------------------------------------------------------------
 .../cloud/storage/template/LocalTemplateDownloader.java | 12 ------------
 1 file changed, 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5f2c732a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java b/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
index d55a4a2..3d33a21 100644
--- a/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/LocalTemplateDownloader.java
@@ -159,16 +159,4 @@ public class LocalTemplateDownloader extends TemplateDownloaderBase implements T
             }
         }
     }
-
-    public static void main(String[] args) {
-        String url = "file:///home/ahuang/Download/E3921_P5N7A-VM_manual.zip";
-        TemplateDownloader td = new LocalTemplateDownloader(null, url, "/tmp/mysql", TemplateDownloader.DEFAULT_MAX_TEMPLATE_SIZE_IN_BYTES, null);
-        long bytes = td.download(true, null);
-        if (bytes > 0) {
-            System.out.println("Downloaded  (" + bytes + " bytes)" + " in " + td.getDownloadTime() / 1000 + " secs");
-        } else {
-            System.out.println("Failed download");
-        }
-
-    }
 }


[2/3] git commit: updated refs/heads/master to 6330ef0

Posted by wi...@apache.org.
Added Unit Test for LocalTemplateDownloader.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c3f2ea6a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c3f2ea6a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c3f2ea6a

Branch: refs/heads/master
Commit: c3f2ea6ae0aa5cf1f54d82aab5d9873b8753d541
Parents: 5f2c732
Author: Boris Schrijver <bo...@pcextreme.nl>
Authored: Thu Sep 10 01:26:23 2015 +0200
Committer: Boris Schrijver <bo...@pcextreme.nl>
Committed: Thu Sep 10 13:07:34 2015 +0200

----------------------------------------------------------------------
 .../template/LocalTemplateDownloaderTest.java   | 41 ++++++++++++++++++++
 1 file changed, 41 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c3f2ea6a/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
----------------------------------------------------------------------
diff --git a/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java b/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
new file mode 100644
index 0000000..74d1adc
--- /dev/null
+++ b/core/test/com/cloud/storage/template/LocalTemplateDownloaderTest.java
@@ -0,0 +1,41 @@
+//
+// 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.
+//
+
+package com.cloud.storage.template;
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import org.junit.Test;
+
+
+public class LocalTemplateDownloaderTest {
+
+    @Test
+    public void localTemplateDownloaderTest() {
+        String url =  "file://" + new File("pom.xml").getAbsolutePath();
+        TemplateDownloader td = new LocalTemplateDownloader(null, url, "/tmp", TemplateDownloader.DEFAULT_MAX_TEMPLATE_SIZE_IN_BYTES, null);
+        long bytes = td.download(true, null);
+        if (!(bytes > 0)) {
+            fail("Failed download");
+        }
+    }
+
+}


[3/3] git commit: updated refs/heads/master to 6330ef0

Posted by wi...@apache.org.
Merge pull request #794 from borisroman/LocalTemplateDownloader

Removal of test/debug code.Removed main() method from LocalTemplateDownloader.java

* pr/794:
  Added Unit Test for LocalTemplateDownloader.
  Removal of test/debug code.

Signed-off-by: Wido den Hollander <wi...@widodh.nl>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6330ef02
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6330ef02
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6330ef02

Branch: refs/heads/master
Commit: 6330ef0236069a610c27352ea7a54cff641025b9
Parents: ba59a43 c3f2ea6
Author: Wido den Hollander <wi...@widodh.nl>
Authored: Fri Sep 11 14:53:02 2015 +0200
Committer: Wido den Hollander <wi...@widodh.nl>
Committed: Fri Sep 11 14:53:02 2015 +0200

----------------------------------------------------------------------
 .../template/LocalTemplateDownloader.java       | 12 ------
 .../template/LocalTemplateDownloaderTest.java   | 41 ++++++++++++++++++++
 2 files changed, 41 insertions(+), 12 deletions(-)
----------------------------------------------------------------------