Skip to content

Commit fb4036e

Browse files
committed
add test folder for snpahost project
1 parent 0f532c4 commit fb4036e

3 files changed

Lines changed: 98 additions & 2 deletions

File tree

engine/storage/snapshot/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444
</dependencies>
4545
<build>
4646
<defaultGoal>install</defaultGoal>
47-
<sourceDirectory>src</sourceDirectory>
48-
<testSourceDirectory>test</testSourceDirectory>
47+
<testSourceDirectory>${project.basedir}/test</testSourceDirectory>
48+
<testResources>
49+
<testResource>
50+
<directory>${project.basedir}/test/resource</directory>
51+
</testResource>
52+
</testResources>
4953
</build>
5054
</project>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
2+
license agreements. See the NOTICE file distributed with this work for additional
3+
information regarding copyright ownership. The ASF licenses this file to
4+
you under the Apache License, Version 2.0 (the "License"); you may not use
5+
this file except in compliance with the License. You may obtain a copy of
6+
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
7+
by applicable law or agreed to in writing, software distributed under the
8+
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
9+
OF ANY KIND, either express or implied. See the License for the specific
10+
language governing permissions and limitations under the License. -->
11+
<beans xmlns="http://www.springframework.org/schema/beans"
12+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
13+
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
14+
xsi:schemaLocation="http://www.springframework.org/schema/beans
15+
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
16+
http://www.springframework.org/schema/tx
17+
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
18+
http://www.springframework.org/schema/aop
19+
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
20+
http://www.springframework.org/schema/context
21+
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
22+
23+
<context:annotation-config />
24+
25+
<!-- @DB support -->
26+
<aop:config proxy-target-class="true">
27+
<aop:aspect id="dbContextBuilder" ref="transactionContextBuilder">
28+
<aop:pointcut id="captureAnyMethod" expression="execution(* *(..))" />
29+
30+
<aop:around pointcut-ref="captureAnyMethod" method="AroundAnyMethod" />
31+
</aop:aspect>
32+
33+
</aop:config>
34+
35+
<bean id="transactionContextBuilder" class="com.cloud.utils.db.TransactionContextBuilder" />
36+
<bean id="componentContext" class="com.cloud.utils.component.ComponentContext"/>
37+
<bean id="TestConfiguration"
38+
class="com.cloud.network.security.SecurityGroupManagerTestConfiguration" />
39+
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor">
40+
<property name="requiredParameterValue" value="false" />
41+
</bean>
42+
</beans>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 src;
20+
21+
import javax.inject.Inject;
22+
23+
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory;
24+
import org.junit.Before;
25+
import org.junit.Test;
26+
import org.junit.runner.RunWith;
27+
import org.springframework.test.context.ContextConfiguration;
28+
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
29+
30+
import com.cloud.utils.component.ComponentContext;
31+
32+
import junit.framework.TestCase;
33+
34+
//@RunWith(SpringJUnit4ClassRunner.class)
35+
//@ContextConfiguration(locations = "classpath:/SnapshotManagerTestContext.xml")
36+
public class SnapshotDataFactoryTest extends TestCase {
37+
//@Inject SnapshotDataFactory snapshotFactory;
38+
39+
@Before
40+
public void setup() throws Exception {
41+
//ComponentContext.initComponentsLifeCycle();
42+
43+
}
44+
45+
@Test
46+
public void testGestSnapshot() {
47+
//snapshotFactory.getSnapshot(snapshotId);
48+
}
49+
50+
}

0 commit comments

Comments
 (0)