Skip to content

Instantly share code, notes, and snippets.

@axayjha
Created October 2, 2018 20:41
Show Gist options
  • Save axayjha/b209bf7d3125ae205dbe65621e58c9cf to your computer and use it in GitHub Desktop.
Save axayjha/b209bf7d3125ae205dbe65621e58c9cf to your computer and use it in GitHub Desktop.
package com.example.demo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class DemoApplicationTests {
@Test
public void contextLoads() {
}
public static void main(String[] args) {
//Triangle tr = new Triangle();
ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
Triangle tr = (Triangle)context.getBean("triangle");
tr.draw();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment