File tree Expand file tree Collapse file tree
resources/com/cloud/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ // Licensed to the Apache Software Foundation (ASF) under one
2+ // or more contributor license agreements. See the NOTICE file
3+ // distributed with this work for additional information
4+ // regarding copyright ownership. The ASF licenses this file
5+ // to you under the Apache License, Version 2.0 (the
6+ // "License"); you may not use this file except in compliance
7+ // the License. You may obtain a copy of the License at
8+ //
9+ // http://www.apache.org/licenses/LICENSE-2.0
10+ //
11+ // Unless required by applicable law or agreed to in writing,
12+ // software distributed under the License is distributed on an
13+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ // KIND, either express or implied. See the License for the
15+ // specific language governing permissions and limitations
16+ // under the License.
17+ package com .cloud .utils ;
18+
19+ import org .springframework .stereotype .Component ;
20+
21+ @ Component
22+ public class DummyImpl implements DummyInterface {
23+
24+ @ Override
25+ public void foo () {
26+ System .out .println ("Basic foo implementation" );
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ // Licensed to the Apache Software Foundation (ASF) under one
2+ // or more contributor license agreements. See the NOTICE file
3+ // distributed with this work for additional information
4+ // regarding copyright ownership. The ASF licenses this file
5+ // to you under the Apache License, Version 2.0 (the
6+ // "License"); you may not use this file except in compliance
7+ // the License. You may obtain a copy of the License at
8+ //
9+ // http://www.apache.org/licenses/LICENSE-2.0
10+ //
11+ // Unless required by applicable law or agreed to in writing,
12+ // software distributed under the License is distributed on an
13+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ // KIND, either express or implied. See the License for the
15+ // specific language governing permissions and limitations
16+ // under the License.
17+ package com .cloud .utils ;
18+
19+ public interface DummyInterface {
20+ void foo ();
21+ }
Original file line number Diff line number Diff line change 1+ // Licensed to the Apache Software Foundation (ASF) under one
2+ // or more contributor license agreements. See the NOTICE file
3+ // distributed with this work for additional information
4+ // regarding copyright ownership. The ASF licenses this file
5+ // to you under the Apache License, Version 2.0 (the
6+ // "License"); you may not use this file except in compliance
7+ // the License. You may obtain a copy of the License at
8+ //
9+ // http://www.apache.org/licenses/LICENSE-2.0
10+ //
11+ // Unless required by applicable law or agreed to in writing,
12+ // software distributed under the License is distributed on an
13+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ // KIND, either express or implied. See the License for the
15+ // specific language governing permissions and limitations
16+ // under the License.
17+ package com .cloud .utils ;
18+
19+ import org .springframework .context .annotation .Primary ;
20+ import org .springframework .stereotype .Component ;
21+
22+ @ Component
23+ @ Primary
24+ public class DummyPremiumImpl implements DummyInterface {
25+
26+ @ Override
27+ public void foo () {
28+ System .out .println ("Premium foo implementation" );
29+ }
30+ }
Original file line number Diff line number Diff line change 1+ // Licensed to the Apache Software Foundation (ASF) under one
2+ // or more contributor license agreements. See the NOTICE file
3+ // distributed with this work for additional information
4+ // regarding copyright ownership. The ASF licenses this file
5+ // to you under the Apache License, Version 2.0 (the
6+ // "License"); you may not use this file except in compliance
7+ // the License. You may obtain a copy of the License at
8+ //
9+ // http://www.apache.org/licenses/LICENSE-2.0
10+ //
11+ // Unless required by applicable law or agreed to in writing,
12+ // software distributed under the License is distributed on an
13+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+ // KIND, either express or implied. See the License for the
15+ // specific language governing permissions and limitations
16+ // under the License.
17+ package com .cloud .utils ;
18+
19+ import org .junit .Test ;
20+ import org .junit .runner .RunWith ;
21+ import org .springframework .beans .factory .annotation .Autowired ;
22+ import org .springframework .test .context .ContextConfiguration ;
23+ import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
24+
25+ @ RunWith (SpringJUnit4ClassRunner .class )
26+ @ ContextConfiguration (locations ="classpath:/com/cloud/utils/QualifierTestContext.xml" )
27+ public class QualifierTest {
28+
29+ @ Autowired
30+ DummyInterface _dummy ;
31+
32+ @ Test
33+ public void test () {
34+ _dummy .foo ();
35+ }
36+ }
Original file line number Diff line number Diff line change 1616// under the License.
1717package com .cloud .utils .db ;
1818
19+
20+ import javax .annotation .PostConstruct ;
21+
22+ import junit .framework .Assert ;
23+
1924import org .apache .log4j .Logger ;
2025import org .springframework .stereotype .Component ;
2126
2429public class DbAnnotatedBase {
2530 private static final Logger s_logger = Logger .getLogger (DbAnnotatedBase .class );
2631
32+ @ PostConstruct
33+ public void initTest () {
34+ Assert .assertTrue (true );
35+ }
36+
2737 public void MethodWithClassDbAnnotated () {
2838 s_logger .info ("called" );
2939 }
Original file line number Diff line number Diff line change 88import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
99
1010@ RunWith (SpringJUnit4ClassRunner .class )
11- @ ContextConfiguration (locations ="classpath:/transactioncontextBuilderTest.xml" )
11+ @ ContextConfiguration (locations ="classpath:/com/cloud/utils/db/ transactioncontextBuilderTest.xml" )
1212public class TransactionContextBuilderTest {
1313
1414 @ Inject
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+
3+ <beans xmlns =" http://www.springframework.org/schema/beans"
4+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5+ xmlns : context =" http://www.springframework.org/schema/context"
6+ xmlns : tx =" http://www.springframework.org/schema/tx"
7+ xmlns : aop =" http://www.springframework.org/schema/aop"
8+ xsi : schemaLocation =" http://www.springframework.org/schema/beans
9+ http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
10+ http://www.springframework.org/schema/tx
11+ http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
12+ http://www.springframework.org/schema/aop
13+ http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
14+ http://www.springframework.org/schema/context
15+ http://www.springframework.org/schema/context/spring-context-3.0.xsd" >
16+ <context : annotation-config />
17+ <context : component-scan base-package =" org.apache.cloudstack, com.cloud" />
18+
19+ </beans >
Original file line number Diff line number Diff line change 1414 http://www.springframework.org/schema/context
1515 http://www.springframework.org/schema/context/spring-context-3.0.xsd" >
1616 <context : annotation-config />
17-
1817 <context : component-scan base-package =" org.apache.cloudstack, com.cloud" />
1918
2019 <aop : config proxy-target-class =" true" >
You can’t perform that action at this time.
0 commit comments