Examples of ClassPathXmlApplicationContext


Examples of org.springframework.context.support.ClassPathXmlApplicationContext

public class InvalidateAssignCacheTest {
    private ApplicationContext context;

    @BeforeClass
    public void beforeClass() {
        context = new ClassPathXmlApplicationContext("/test-context.xml");
    }
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

public class ReadThroughAssignCacheTest {
    private ApplicationContext context;

    @BeforeClass
    public void beforeClass() {
        context = new ClassPathXmlApplicationContext("/test-context.xml");
    }
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

   }

   @Test
   public void validateTypeMappingsExistInSpring()
   {
      ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-typemapping-test-server.xml");
      SynchronousDispatcher dispatcher = (SynchronousDispatcher) ctx.getBean("resteasy.dispatcher");
      Map<String, MediaType> mappings = dispatcher.getMediaTypeMappings();
      assertEquals(2, mappings.size());
      assertEquals("application/xml", mappings.get("xml").toString());
      assertEquals("application/json", mappings.get("json").toString());
   }
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

public class UpdateAssignCacheTest {
    private ApplicationContext context;

    @BeforeClass
    public void beforeClass() {
        context = new ClassPathXmlApplicationContext("/test-context.xml");
    }
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

        this.configFilename = configFilename;
    }

    protected void setUp() throws Exception {
        Logger.getLogger("org.springframework").setLevel(Level.WARNING);
        contextHolder.context = new ClassPathXmlApplicationContext(configFilename);
        assertNotNull(contextHolder.context);
    }
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

public class HVAC {

    public static void main(String args[]) throws Exception {

        final ApplicationContext applicationContext = new ClassPathXmlApplicationContext(
                "org/drools/spring/examples/jiahvac/control/hvac.appctx.xml");

        final WorkingMemory workingMemory =
                (WorkingMemory) applicationContext.getBean("workingMemory");
       
        final Simulator simulator =
                (Simulator) applicationContext.getBean("simulator");
       
        final TempuratureControl control =
                (TempuratureControl) applicationContext.getBean("tempuratureControl");

        workingMemory.assertObject(control);

        for (Floor floor : simulator.getFloors()) {
            workingMemory.assertObject(floor.getThermometer(), true);
            workingMemory.assertObject(floor.getVent(), true);
        }
        for (HeatPump pump : simulator.getHeatPumps()) {
            workingMemory.assertObject(pump, true);
        }
        System.out.println("---- begin initial fireAllRules");
        workingMemory.fireAllRules();
        System.out.println("---- end initial fireAllRules");

        // The 'executor' bean is lazy-init so we can control when the simulator starts
        // (which is now). Alternatively, we could have defined a start method to begin
        // the simulation.
        applicationContext.getBean("executor");
    }
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

public class HelloWorldSpringInnerPojosExample {

    public static void main(String[] args) throws Exception {
        Logger.getLogger("org.springframework").setLevel(Level.WARNING);
        ApplicationContext context = new ClassPathXmlApplicationContext("org/drools/spring/examples/helloworld/helloworld.appctx.xml");

        RuleSet ruleSet = (RuleSet) context.getBean("innerPojosRuleSet");
        RuleBaseBuilder builder = new RuleBaseBuilder();
        builder.addRuleSet(ruleSet);
        RuleBase ruleBase = builder.build();

        HelloWorldRunner.run(ruleBase);
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

public class HelloWorldSpringOuterPojosExample {

    public static void main(String[] args) throws Exception {
        Logger.getLogger("org.springframework").setLevel(Level.WARNING);
        ApplicationContext context = new ClassPathXmlApplicationContext("org/drools/spring/examples/helloworld/helloworld.appctx.xml");

        RuleSet ruleSet = (RuleSet) context.getBean("outerPojosRuleSet");
        RuleBaseBuilder builder = new RuleBaseBuilder();
        builder.addRuleSet(ruleSet);
        RuleBase ruleBase = builder.build();

        HelloWorldRunner.run(ruleBase);
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

    @org.junit.Test
    public void testUsernameTokenInterceptorNoPasswordValidation() {
        System.setProperty("testutil.ports.JavaFirstPolicyServer", PORT);

        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
            "org/apache/cxf/systest/ws/policy/client/javafirstclient.xml");

        JavaFirstAttachmentPolicyService svc = ctx.getBean("JavaFirstAttachmentPolicyServiceClient",
                                                           JavaFirstAttachmentPolicyService.class);

        WSS4JOutInterceptor wssOut = addToClient(svc);

        // just some basic sanity tests first to make sure that auth is working where password is provided.
View Full Code Here

Examples of org.springframework.context.support.ClassPathXmlApplicationContext

    @org.junit.Test
    public void testUsernameTokenPolicyValidatorNoPasswordValidation() {
        System.setProperty("testutil.ports.JavaFirstPolicyServer.2", PORT2);

        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
            "org/apache/cxf/systest/ws/policy/client/javafirstclient.xml");

        SslUsernamePasswordAttachmentService svc = ctx.getBean("SslUsernamePasswordAttachmentServiceClient",
                                                               SslUsernamePasswordAttachmentService.class);

        WSS4JOutInterceptor wssOut = addToClient(svc);

        // just some basic sanity tests first to make sure that auth is working where password is provided.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.