forked from NeilAlishev/SpringCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestSpring.java
More file actions
34 lines (28 loc) · 984 Bytes
/
TestSpring.java
File metadata and controls
34 lines (28 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package ru.alishev.springcourse;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
* @author Neil Alishev
*/
public class TestSpring {
public static void main(String[] args) {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"applicationContext.xml"
);
// Music music = context.getBean("rockMusic", Music.class);
//
// MusicPlayer musicPlayer = new MusicPlayer(music);
//
// musicPlayer.playMusic();
//
// Music music2 = context.getBean("classicalMusic", Music.class);
//
// MusicPlayer classicalMusicPlayer = new MusicPlayer(music2);
//
// classicalMusicPlayer.playMusic();
// MusicPlayer musicPlayer = context.getBean("musicPlayer", MusicPlayer.class);
// musicPlayer.playMusic();
Computer computer = context.getBean("computer", Computer.class);
System.out.println(computer);
context.close();
}
}