Java 类org.springframework.boot.autoconfigure.jndi.TestableInitialContextFactory 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JndiDataSourceAutoConfigurationTests.java   
@After
public void close() {
    TestableInitialContextFactory.clearAll();
    if (this.initialContextFactory != null) {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                this.initialContextFactory);
    }
    else {
        System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
    }
    if (this.context != null) {
        this.context.close();
    }
    Thread.currentThread().setContextClassLoader(this.threadContextClassLoader);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MailSenderAutoConfigurationTests.java   
@After
public void close() {
    TestableInitialContextFactory.clearAll();
    if (this.initialContextFactory != null) {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                this.initialContextFactory);
    }
    else {
        System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
    }
    if (this.context != null) {
        this.context.close();
    }
    Thread.currentThread().setContextClassLoader(this.threadContextClassLoader);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MailSenderAutoConfigurationTests.java   
private Session configureJndiSession(String name)
        throws IllegalStateException, NamingException {
    Properties properties = new Properties();
    Session session = Session.getDefaultInstance(properties);
    TestableInitialContextFactory.bind(name, session);
    return session;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ConditionalOnJndiTests.java   
@After
public void close() {
    TestableInitialContextFactory.clearAll();
    if (this.initialContextFactory != null) {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                this.initialContextFactory);
    }
    else {
        System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
    }
    if (this.context != null) {
        this.context.close();
    }
    Thread.currentThread().setContextClassLoader(this.threadContextClassLoader);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ConditionalOnJndiTests.java   
@Test
public void jndiLocationBound() {
    setupJndi();
    TestableInitialContextFactory.bind("java:/FooManager", new Object());
    load(JndiConditionConfiguration.class);
    assertPresent(true);
}
项目:spring-boot-concourse    文件:JndiDataSourceAutoConfigurationTests.java   
@After
public void close() {
    TestableInitialContextFactory.clearAll();
    if (this.initialContextFactory != null) {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                this.initialContextFactory);
    }
    else {
        System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
    }
    if (this.context != null) {
        this.context.close();
    }
    Thread.currentThread().setContextClassLoader(this.threadContextClassLoader);
}
项目:spring-boot-concourse    文件:MailSenderAutoConfigurationTests.java   
@After
public void close() {
    TestableInitialContextFactory.clearAll();
    if (this.initialContextFactory != null) {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                this.initialContextFactory);
    }
    else {
        System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
    }
    if (this.context != null) {
        this.context.close();
    }
    Thread.currentThread().setContextClassLoader(this.threadContextClassLoader);
}
项目:spring-boot-concourse    文件:MailSenderAutoConfigurationTests.java   
private Session configureJndiSession(String name)
        throws IllegalStateException, NamingException {
    Properties properties = new Properties();
    Session session = Session.getDefaultInstance(properties);
    TestableInitialContextFactory.bind(name, session);
    return session;
}
项目:spring-boot-concourse    文件:ConditionalOnJndiTests.java   
@After
public void close() {
    TestableInitialContextFactory.clearAll();
    if (this.initialContextFactory != null) {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                this.initialContextFactory);
    }
    else {
        System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
    }
    if (this.context != null) {
        this.context.close();
    }
    Thread.currentThread().setContextClassLoader(this.threadContextClassLoader);
}
项目:spring-boot-concourse    文件:ConditionalOnJndiTests.java   
@Test
public void jndiLocationBound() {
    setupJndi();
    TestableInitialContextFactory.bind("java:/FooManager", new Object());
    load(JndiConditionConfiguration.class);
    assertPresent(true);
}
项目:contestparser    文件:JndiDataSourceAutoConfigurationTests.java   
@After
public void close() {
    TestableInitialContextFactory.clearAll();
    if (this.initialContextFactory != null) {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                this.initialContextFactory);
    }
    else {
        System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
    }
    if (this.context != null) {
        this.context.close();
    }
    Thread.currentThread().setContextClassLoader(this.threadContextClassLoader);
}
项目:contestparser    文件:MailSenderAutoConfigurationTests.java   
@After
public void close() {
    TestableInitialContextFactory.clearAll();
    if (this.initialContextFactory != null) {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                this.initialContextFactory);
    }
    else {
        System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
    }
    if (this.context != null) {
        this.context.close();
    }
    Thread.currentThread().setContextClassLoader(this.threadContextClassLoader);
}
项目:contestparser    文件:MailSenderAutoConfigurationTests.java   
private Session configureJndiSession(String name)
        throws IllegalStateException, NamingException {
    Properties properties = new Properties();
    Session session = Session.getDefaultInstance(properties);
    TestableInitialContextFactory.bind(name, session);
    return session;
}
项目:contestparser    文件:ConditionalOnJndiTests.java   
@After
public void close() {
    TestableInitialContextFactory.clearAll();
    if (this.initialContextFactory != null) {
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                this.initialContextFactory);
    }
    else {
        System.clearProperty(Context.INITIAL_CONTEXT_FACTORY);
    }
    if (this.context != null) {
        this.context.close();
    }
    Thread.currentThread().setContextClassLoader(this.threadContextClassLoader);
}
项目:contestparser    文件:ConditionalOnJndiTests.java   
@Test
public void jndiLocationBound() {
    setupJndi();
    TestableInitialContextFactory.bind("java:/FooManager", new Object());
    load(JndiConditionConfiguration.class);
    assertPresent(true);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JndiDataSourceAutoConfigurationTests.java   
@Before
public void setupJndi() {
    this.initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
            TestableInitialContextFactory.class.getName());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JndiDataSourceAutoConfigurationTests.java   
private void configureJndi(String name, DataSource dataSource)
        throws IllegalStateException, NamingException {
    TestableInitialContextFactory.bind(name, dataSource);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MailSenderAutoConfigurationTests.java   
@Before
public void setupJndi() {
    this.initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
            TestableInitialContextFactory.class.getName());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ConditionalOnJndiTests.java   
private void setupJndi() {
    this.initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
            TestableInitialContextFactory.class.getName());
}
项目:spring-boot-concourse    文件:JndiDataSourceAutoConfigurationTests.java   
@Before
public void setupJndi() {
    this.initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
            TestableInitialContextFactory.class.getName());
}
项目:spring-boot-concourse    文件:JndiDataSourceAutoConfigurationTests.java   
private void configureJndi(String name, DataSource dataSource)
        throws IllegalStateException, NamingException {
    TestableInitialContextFactory.bind(name, dataSource);
}
项目:spring-boot-concourse    文件:MailSenderAutoConfigurationTests.java   
@Before
public void setupJndi() {
    this.initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
            TestableInitialContextFactory.class.getName());
}
项目:spring-boot-concourse    文件:ConditionalOnJndiTests.java   
private void setupJndi() {
    this.initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
            TestableInitialContextFactory.class.getName());
}
项目:contestparser    文件:JndiDataSourceAutoConfigurationTests.java   
@Before
public void setupJndi() {
    this.initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
            TestableInitialContextFactory.class.getName());
}
项目:contestparser    文件:JndiDataSourceAutoConfigurationTests.java   
private void configureJndi(String name, DataSource dataSource)
        throws IllegalStateException, NamingException {
    TestableInitialContextFactory.bind(name, dataSource);
}
项目:contestparser    文件:MailSenderAutoConfigurationTests.java   
@Before
public void setupJndi() {
    this.initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
            TestableInitialContextFactory.class.getName());
}
项目:contestparser    文件:ConditionalOnJndiTests.java   
private void setupJndi() {
    this.initialContextFactory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
    System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
            TestableInitialContextFactory.class.getName());
}