From 85c88e08a7f290a03a88f7a5a39b2b91f3e72973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Weing=C3=A4rtner?= Date: Mon, 20 Aug 2018 10:16:07 -0300 Subject: [PATCH] Remove class snapshot data factory test (#2813) * rename package from "src" to "org.apache.cloudstack.storage.vmsnapshot" * Remove Empty test class "SnapshotDataFactoryTest" * Remove redundant imports (importing a class from its own package) --- .../vmsnapshot}/VMSnapshotStrategyTest.java | 22 ++++------ .../java/src/SnapshotDataFactoryTest.java | 42 ------------------- 2 files changed, 9 insertions(+), 55 deletions(-) rename engine/storage/snapshot/src/test/java/{src => org/apache/cloudstack/storage/vmsnapshot}/VMSnapshotStrategyTest.java (97%) delete mode 100644 engine/storage/snapshot/src/test/java/src/SnapshotDataFactoryTest.java diff --git a/engine/storage/snapshot/src/test/java/src/VMSnapshotStrategyTest.java b/engine/storage/snapshot/src/test/java/org/apache/cloudstack/storage/vmsnapshot/VMSnapshotStrategyTest.java similarity index 97% rename from engine/storage/snapshot/src/test/java/src/VMSnapshotStrategyTest.java rename to engine/storage/snapshot/src/test/java/org/apache/cloudstack/storage/vmsnapshot/VMSnapshotStrategyTest.java index 22cf9c1d52b..4420c19d6a0 100644 --- a/engine/storage/snapshot/src/test/java/src/VMSnapshotStrategyTest.java +++ b/engine/storage/snapshot/src/test/java/org/apache/cloudstack/storage/vmsnapshot/VMSnapshotStrategyTest.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package src; +package org.apache.cloudstack.storage.vmsnapshot; import java.io.IOException; import java.util.ArrayList; @@ -25,8 +25,10 @@ import java.util.List; import javax.inject.Inject; -import junit.framework.TestCase; - +import org.apache.cloudstack.engine.subsystem.api.storage.VMSnapshotStrategy; +import org.apache.cloudstack.framework.config.dao.ConfigurationDao; +import org.apache.cloudstack.storage.to.VolumeObjectTO; +import org.apache.cloudstack.test.utils.SpringUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -43,13 +45,6 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; -import org.apache.cloudstack.engine.subsystem.api.storage.VMSnapshotStrategy; -import org.apache.cloudstack.framework.config.dao.ConfigurationDao; -import org.apache.cloudstack.storage.to.VolumeObjectTO; -import org.apache.cloudstack.storage.vmsnapshot.DefaultVMSnapshotStrategy; -import org.apache.cloudstack.storage.vmsnapshot.VMSnapshotHelper; -import org.apache.cloudstack.test.utils.SpringUtils; - import com.cloud.agent.AgentManager; import com.cloud.agent.api.Command; import com.cloud.agent.api.CreateVMSnapshotAnswer; @@ -76,6 +71,8 @@ import com.cloud.vm.snapshot.VMSnapshot; import com.cloud.vm.snapshot.VMSnapshotVO; import com.cloud.vm.snapshot.dao.VMSnapshotDao; +import junit.framework.TestCase; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(loader = AnnotationConfigContextLoader.class) public class VMSnapshotStrategyTest extends TestCase { @@ -245,9 +242,8 @@ public class VMSnapshotStrategyTest extends TestCase { } @Configuration - @ComponentScan(basePackageClasses = {NetUtils.class, DefaultVMSnapshotStrategy.class}, - includeFilters = {@ComponentScan.Filter(value = TestConfiguration.Library.class, type = FilterType.CUSTOM)}, - useDefaultFilters = false) + @ComponentScan(basePackageClasses = {NetUtils.class, DefaultVMSnapshotStrategy.class}, includeFilters = { + @ComponentScan.Filter(value = TestConfiguration.Library.class, type = FilterType.CUSTOM)}, useDefaultFilters = false) public static class TestConfiguration extends SpringUtils.CloudStackTestConfiguration { public static class Library implements TypeFilter { diff --git a/engine/storage/snapshot/src/test/java/src/SnapshotDataFactoryTest.java b/engine/storage/snapshot/src/test/java/src/SnapshotDataFactoryTest.java deleted file mode 100644 index 6edaff1ce4e..00000000000 --- a/engine/storage/snapshot/src/test/java/src/SnapshotDataFactoryTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 src; - -import junit.framework.TestCase; - -import org.junit.Before; -import org.junit.Test; - -//@RunWith(SpringJUnit4ClassRunner.class) -//@ContextConfiguration(locations = "classpath:/SnapshotManagerTestContext.xml") -public class SnapshotDataFactoryTest extends TestCase { - // @Inject SnapshotDataFactory snapshotFactory; - - @Before - public void setup() throws Exception { - // ComponentContext.initComponentsLifeCycle(); - - } - - @Test - public void testGestSnapshot() { - // snapshotFactory.getSnapshot(snapshotId); - } - -}