Skip to content

Instantly share code, notes, and snippets.

@cbeams
Created February 4, 2012 15:18
Show Gist options
  • Save cbeams/1738442 to your computer and use it in GitHub Desktop.
Save cbeams/1738442 to your computer and use it in GitHub Desktop.
SPR-8955
/*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package spr8955;
import org.springframework.stereotype.Component;
public class NonComponent {
@Component("nestedComponent")
public static class NestedComponent { }
}
/*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package spr8955;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class Spr8955Tests {
@Test
public void repro() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.scan("spr8955");
ctx.refresh();
assertThat(ctx.containsBean("nestedComponent"), is(true));
}
}
@cbeams
Copy link
Author

cbeams commented Feb 4, 2012

Failed attempt to reproduce https://jira.springsource.org/browse/SPR-8955

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment