OK first of all don't load the context with file rather use classpath
For the second bit I can't think of very many use cases where you would ever want to do something like this. Exactly what is it you are trying to test? You are going about this in the wrong way but you would have to provide me with a bit more context to provide more help.
As for why you are not seeing anything printed, it is because you are not loading things correctly.
Now most of the time you would not use a GenericApplicationContext you would use a ClassPathXmlApplicationContext which is much easier to set up, but for a test case you would not use either. That is the whole point of this line
That line of code initializes your context for the test case. If you really want a handle to the ApplicationContext for some reason (I would say
you should not) then @Autowire in ApplicationContext.