Examples of GenericXmlApplicationContext


Examples of org.springframework.context.support.GenericXmlApplicationContext

 
  @Rule
  public ExpectedException expected = ExpectedException.none();
 
  public AuthorizationServerCustomGrantParserTests() {
    context = new GenericXmlApplicationContext(getClass(), RESOURCE_NAME);
  }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

    loadContext("type='password' username='admin' access-token-uri='http://somewhere.com'");
  }

  private void loadContext(String attributes) {
    String config = HEADER + String.format(TEMPLATE, attributes) + FOOTER;
    context = new GenericXmlApplicationContext(new ByteArrayResource(config .getBytes()));
  }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

    return Arrays.asList(new Object[] { "authorization-server-vanilla" },
        new Object[] { "authorization-server-extras" }, new Object[] { "authorization-server-types" });
  }

  public AuthorizationServerBeanDefinitionParserTests(String resource) {
    context = new GenericXmlApplicationContext(getClass(), resource + ".xml");
  }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

*/
public class ResourceServerBeanDefinitionParserTests {

  @Test
  public void testDefaults() {
    GenericXmlApplicationContext context = new GenericXmlApplicationContext(
        getClass(), "resource-server-context.xml");
    assertTrue(context.containsBeanDefinition("oauth2ProviderFilter"));
    assertTrue(context.containsBeanDefinition("anotherProviderFilter"));
    assertTrue(context.containsBeanDefinition("thirdProviderFilter"));
    context.close();
  }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

    context.close();
  }

  @Test
  public void testAuthenticationManager() {
    GenericXmlApplicationContext context = new GenericXmlApplicationContext(
        getClass(), "resource-server-authmanager-context.xml");
    // System.err.println(Arrays.asList(context.getBeanDefinitionNames()));
    assertTrue(context.containsBeanDefinition("oauth2ProviderFilter"));
    OAuth2AuthenticationProcessingFilter filter = context.getBean(OAuth2AuthenticationProcessingFilter.class);
    assertEquals(context.getBean(AuthenticationManager.class), ReflectionTestUtils.getField(filter, "authenticationManager"));
    assertNotNull(ReflectionTestUtils.getField(filter, "tokenExtractor"));
    context.close();
  }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

 
  @Test
  public void testCustomGrantRegistered() {
    expected.expect(BeanDefinitionParsingException.class);
    expected.expectMessage("ClientDetailsService");
    context = new GenericXmlApplicationContext(getClass(), RESOURCE_NAME);
    TokenGranter granter = context.getBean(CompositeTokenGranter.class);
    assertNotNull(granter);
  }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

    @Before
    public void prepareEmptyThesaurus() throws ConfigurationException {
        File file = new File(this.thesaurusFile.getParentFile(), ThesaurusTest.class.getSimpleName()+"_empyt.rdf");
        file.delete();
        GenericXmlApplicationContext appContext = new GenericXmlApplicationContext();
        appContext.getBeanFactory().registerSingleton("IsoLangMapper", isoLangMapper);

        this.writableThesaurus = new Thesaurus(appContext, file.getName(), null, null, Geonet.CodeList.LOCAL, file.getName(), file, null, true);
        super.setRepository(writableThesaurus);
    }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

            } finally {
              IOUtils.closeQuietly(from);
              IOUtils.closeQuietly(to);
            }
            FileUtils.copyFile(template, thesaurusFile);
            GenericXmlApplicationContext appContext = new GenericXmlApplicationContext();
            appContext.getBeanFactory().registerSingleton("IsoLangMapper", isoLangMapper);
            this.thesaurus = new Thesaurus(appContext, thesaurusFile.getName(), "test", "test", thesaurusFile, "http://concept");
        }
        setRepository(this.thesaurus);
    }
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

   
    private void generateTestThesaurus() throws Exception {
        File directory = new File(AbstractThesaurusBasedTest.class.getResource(AbstractThesaurusBasedTest.class.getSimpleName()+".class").getFile()).getParentFile();

        this.thesaurusFile = new File(directory, "testThesaurus.rdf");
        GenericXmlApplicationContext appContext = new GenericXmlApplicationContext();
        appContext.getBeanFactory().registerSingleton("IsoLangMapper", isoLangMapper);
        this.thesaurus = new Thesaurus(appContext, thesaurusFile.getName(), null, null, "test", "test", thesaurusFile, "http://concept", true);
        setRepository(this.thesaurus);
       
        if (thesaurusFile.exists() && thesaurusFile.length() > 0) {
            try {
View Full Code Here

Examples of org.springframework.context.support.GenericXmlApplicationContext

public class ReproTests {

  @Test
  public void repro() throws Exception {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load(getClass(), "ReproTests-context.xml");
    ctx.refresh();

    C c = ctx.getBean(C.class);
    MyInterceptor interceptor = ctx.getBean(MyInterceptor.class);

    assertThat("expected c to be a proxy", AopUtils.isAopProxy(c), is(true));
    Advisor[] advisors = ((Advised)c).getAdvisors();
    assertTrue("interceptor was not added to c's set of advisors",
        advisors.length == 1 && advisors[0].getAdvice() == interceptor);
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.