Skip to content

Commit 6a71110

Browse files
committed
add unit test
1 parent 8e59b3a commit 6a71110

5 files changed

Lines changed: 140 additions & 0 deletions

File tree

platform/storage/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,6 @@
5252
<build>
5353
<defaultGoal>install</defaultGoal>
5454
<sourceDirectory>src</sourceDirectory>
55+
<testSourceDirectory>test</testSourceDirectory>
5556
</build>
5657
</project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
4+
xsi:schemaLocation="http://www.springframework.org/schema/beans
5+
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
6+
http://www.springframework.org/schema/context
7+
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
8+
<context:annotation-config />
9+
<context:component-scan base-package="org.apache.cloudstack.storage" />
10+
11+
</beans>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.storage.volume;
20+
21+
import org.springframework.stereotype.Service;
22+
23+
import com.cloud.api.commands.CreateVolumeCmd;
24+
import com.cloud.storage.Volume;
25+
26+
@Service
27+
public class VolumeServiceImpl implements VolumeService {
28+
29+
@Override
30+
public Volume allocVolumeInDB(CreateVolumeCmd cmd) {
31+
// TODO Auto-generated method stub
32+
return null;
33+
}
34+
35+
@Override
36+
public Volume createVolume(CreateVolumeCmd cmd) {
37+
// TODO Auto-generated method stub
38+
return null;
39+
}
40+
41+
@Override
42+
public boolean deleteVolume(long volumeId) {
43+
// TODO Auto-generated method stub
44+
return false;
45+
}
46+
47+
@Override
48+
public Volume migrateVolume(Long volumeId, Long storagePoolId) {
49+
// TODO Auto-generated method stub
50+
return null;
51+
}
52+
53+
@Override
54+
public Volume copyVolume(Long volumeId, Long destStoragePoolId) {
55+
// TODO Auto-generated method stub
56+
return null;
57+
}
58+
59+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.storage.test;
20+
21+
import org.junit.runner.RunWith;
22+
import org.junit.runners.Suite;
23+
import org.junit.runners.Suite.SuiteClasses;
24+
25+
@RunWith(Suite.class)
26+
@SuiteClasses({ volumeServiceTest.class })
27+
public class AllTests {
28+
29+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.storage.test;
20+
21+
import static org.junit.Assert.*;
22+
23+
import org.apache.cloudstack.storage.volume.VolumeService;
24+
import org.junit.Test;
25+
import org.junit.runner.RunWith;
26+
import org.springframework.beans.factory.annotation.Autowired;
27+
import org.springframework.test.context.ContextConfiguration;
28+
29+
@ContextConfiguration(locations="resources/storageContext.xml")
30+
public class volumeServiceTest {
31+
32+
@Autowired
33+
protected VolumeService volService;
34+
@Test
35+
public void test() {
36+
volService.deleteVolume(1);
37+
fail("Not yet implemented");
38+
}
39+
40+
}

0 commit comments

Comments
 (0)