Package org.springframework.osgi.extender.support

Examples of org.springframework.osgi.extender.support.ApplicationContextConfiguration


    Dictionary headers = new Hashtable();
    headers.put("Spring-Context", "*;wait-for-dependencies:=false");
    EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
    aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
    aBundle.setEntryReturnOnNextCallToGetEntry(new URL(META_INF_SPRING_CONTENT[0]));
    ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
    String[] configFiles = config.getConfigurationLocations();
    assertTrue("bundle should be Spring powered", config.isSpringPoweredBundle());
    assertEquals("1 config files", 1, configFiles.length);
    assertEquals(OsgiBundleXmlApplicationContext.DEFAULT_CONFIG_LOCATION, configFiles[0]);
  }
View Full Code Here


    Dictionary headers = new Hashtable();
    headers.put("Spring-Context", ";wait-for-dependencies:=false");
    EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
    aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
    aBundle.setEntryReturnOnNextCallToGetEntry(new URL(META_INF_SPRING_CONTENT[0]));
    ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
    String[] configFiles = config.getConfigurationLocations();
    assertTrue("bundle should be Spring powered", config.isSpringPoweredBundle());
    assertEquals("1 config files", 1, configFiles.length);
    assertEquals(OsgiBundleXmlApplicationContext.DEFAULT_CONFIG_LOCATION, configFiles[0]);
  }
View Full Code Here

    Dictionary headers = new Hashtable();
    headers.put("Spring-Context", "META-INF/spring/context.xml;wait-for-dependencies:=false");
    EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
    aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
    aBundle.setEntryReturnOnNextCallToGetEntry(new URL(META_INF_SPRING_CONTENT[0]));
    ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
    String[] configFiles = config.getConfigurationLocations();
    assertTrue("bundle should be Spring powered", config.isSpringPoweredBundle());
    assertEquals("2 config files", 1, configFiles.length);
    assertEquals("osgibundle:META-INF/spring/context.xml", configFiles[0]);
  }
View Full Code Here

  public void tstBundleWithHeaderWithBadEntriesAndNoMetaInfResourcesIsNotSpringPowered() {
    Dictionary headers = new Hashtable();
    headers.put("Spring-Context", "META-INF/splurge/context.xml");
    EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
    aBundle.setResultsToReturnOnNextCallToFindEntries(null);
    ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
    assertFalse("bundle is not spring powered", config.isSpringPoweredBundle());
  }
View Full Code Here

  public void tstHeaderWithWildcardEntryAndNoMetaInfResources() {
    Dictionary headers = new Hashtable();
    headers.put("Spring-Context", "*;wait-for-dependencies:=false");
    EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
    aBundle.setResultsToReturnOnNextCallToFindEntries(null);
    ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
    assertFalse("not spring powered", config.isSpringPoweredBundle());
  }
View Full Code Here

  public void tstHeaderWithBadEntry() throws Exception {
    Dictionary headers = new Hashtable();
    headers.put("Spring-Context", "META-INF/spring/context-two.xml,META-INF/splurge/context.xml,");
    EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
    aBundle.setEntryReturnOnNextCallToGetEntry(new URL("file://META-INF/spring/context-two.xml"));
    ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
    assertFalse("bundle is not spring powered", config.isSpringPoweredBundle());
    String[] configFiles = config.getConfigurationLocations();
    assertEquals("0 config file", 0, configFiles.length);
  }
View Full Code Here

    Dictionary headers = new Hashtable();
    headers.put("Spring-Context", "*;timeout:=none");
    EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
    aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
    aBundle.setEntryReturnOnNextCallToGetEntry(new URL(META_INF_SPRING_CONTENT[0]));
    ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
    assertTrue("bundle should be Spring powered", config.isSpringPoweredBundle());
    assertTrue("bundle should have create-asynchronously = true", config.isCreateAsynchronously());
  }
View Full Code Here

    // *;flavour
    Dictionary headers = new Hashtable();
    headers.put("Spring-Context", "*;create-asynchronously:=true");
    EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
    aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
    ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
    assertTrue("bundle should be Spring powered", config.isSpringPoweredBundle());
    assertTrue("bundle should have create-asynchronously = true", config.isCreateAsynchronously());
  }
View Full Code Here

    Dictionary headers = new Hashtable();
    headers.put("Spring-Context", "META-INF/spring/context.xml;create-asynchronously:=false");
    EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
    aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
    aBundle.setEntryReturnOnNextCallToGetEntry(new URL(META_INF_SPRING_CONTENT[0]));
    ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
    assertTrue("bundle should be Spring powered", config.isSpringPoweredBundle());
    assertFalse("bundle should have create-asynchronously = false", config.isCreateAsynchronously());
  }
View Full Code Here

  public void testCreateAsynchronouslyDefaultTrueIfAbsent() {
    // *;flavour
    Dictionary headers = new Hashtable();
    EntryLookupControllingMockBundle aBundle = new EntryLookupControllingMockBundle(headers);
    aBundle.setResultsToReturnOnNextCallToFindEntries(META_INF_SPRING_CONTENT);
    ApplicationContextConfiguration config = new ApplicationContextConfiguration(aBundle);
    assertTrue("bundle should have create-asynchronously = true", config.isCreateAsynchronously());
  }
View Full Code Here

TOP

Related Classes of org.springframework.osgi.extender.support.ApplicationContextConfiguration

Copyright © 2018 www.massapicom. 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.