diff --git a/platform/storage/pom.xml b/platform/storage/pom.xml index 0ff3346e858..e964486c03d 100644 --- a/platform/storage/pom.xml +++ b/platform/storage/pom.xml @@ -52,5 +52,6 @@ install src + test \ No newline at end of file diff --git a/platform/storage/resources/storageContext.xml b/platform/storage/resources/storageContext.xml new file mode 100644 index 00000000000..35d18a6b9e7 --- /dev/null +++ b/platform/storage/resources/storageContext.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/platform/storage/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java b/platform/storage/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java new file mode 100644 index 00000000000..83494372138 --- /dev/null +++ b/platform/storage/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java @@ -0,0 +1,59 @@ +/* + * 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 org.apache.cloudstack.storage.volume; + +import org.springframework.stereotype.Service; + +import com.cloud.api.commands.CreateVolumeCmd; +import com.cloud.storage.Volume; + +@Service +public class VolumeServiceImpl implements VolumeService { + + @Override + public Volume allocVolumeInDB(CreateVolumeCmd cmd) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Volume createVolume(CreateVolumeCmd cmd) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean deleteVolume(long volumeId) { + // TODO Auto-generated method stub + return false; + } + + @Override + public Volume migrateVolume(Long volumeId, Long storagePoolId) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Volume copyVolume(Long volumeId, Long destStoragePoolId) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/platform/storage/test/org/apache/cloudstack/storage/test/AllTests.java b/platform/storage/test/org/apache/cloudstack/storage/test/AllTests.java new file mode 100644 index 00000000000..dde4484db54 --- /dev/null +++ b/platform/storage/test/org/apache/cloudstack/storage/test/AllTests.java @@ -0,0 +1,29 @@ +/* + * 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 org.apache.cloudstack.storage.test; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.junit.runners.Suite.SuiteClasses; + +@RunWith(Suite.class) +@SuiteClasses({ volumeServiceTest.class }) +public class AllTests { + +} diff --git a/platform/storage/test/org/apache/cloudstack/storage/test/volumeServiceTest.java b/platform/storage/test/org/apache/cloudstack/storage/test/volumeServiceTest.java new file mode 100644 index 00000000000..1bc7d55ac05 --- /dev/null +++ b/platform/storage/test/org/apache/cloudstack/storage/test/volumeServiceTest.java @@ -0,0 +1,40 @@ +/* + * 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 org.apache.cloudstack.storage.test; + +import static org.junit.Assert.*; + +import org.apache.cloudstack.storage.volume.VolumeService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; + +@ContextConfiguration(locations="resources/storageContext.xml") +public class volumeServiceTest { + + @Autowired + protected VolumeService volService; + @Test + public void test() { + volService.deleteVolume(1); + fail("Not yet implemented"); + } + +}