org.springframework.tests.sample.beans.subpkg.DeepBean Java Examples
The following examples show how to use
org.springframework.tests.sample.beans.subpkg.DeepBean.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AspectJExpressionPointcutTests.java From spring-analysis-note with MIT License | 6 votes |
private void testWithinPackage(boolean matchSubpackages) throws SecurityException, NoSuchMethodException { String withinBeansPackage = "within(org.springframework.tests.sample.beans."; // Subpackages are matched by ** if (matchSubpackages) { withinBeansPackage += "."; } withinBeansPackage = withinBeansPackage + "*)"; AspectJExpressionPointcut withinBeansPc = new AspectJExpressionPointcut(); withinBeansPc.setExpression(withinBeansPackage); assertTrue(withinBeansPc.matches(TestBean.class)); assertTrue(withinBeansPc.matches(getAge, TestBean.class)); assertEquals(matchSubpackages, withinBeansPc.matches(DeepBean.class)); assertEquals(matchSubpackages, withinBeansPc.matches( DeepBean.class.getMethod("aMethod", String.class), DeepBean.class)); assertFalse(withinBeansPc.matches(String.class)); assertFalse(withinBeansPc.matches(OtherIOther.class.getMethod("absquatulate"), OtherIOther.class)); }
Example #2
Source File: AspectJExpressionPointcutTests.java From java-technology-stack with MIT License | 6 votes |
private void testWithinPackage(boolean matchSubpackages) throws SecurityException, NoSuchMethodException { String withinBeansPackage = "within(org.springframework.tests.sample.beans."; // Subpackages are matched by ** if (matchSubpackages) { withinBeansPackage += "."; } withinBeansPackage = withinBeansPackage + "*)"; AspectJExpressionPointcut withinBeansPc = new AspectJExpressionPointcut(); withinBeansPc.setExpression(withinBeansPackage); assertTrue(withinBeansPc.matches(TestBean.class)); assertTrue(withinBeansPc.matches(getAge, TestBean.class)); assertEquals(matchSubpackages, withinBeansPc.matches(DeepBean.class)); assertEquals(matchSubpackages, withinBeansPc.matches( DeepBean.class.getMethod("aMethod", String.class), DeepBean.class)); assertFalse(withinBeansPc.matches(String.class)); assertFalse(withinBeansPc.matches(OtherIOther.class.getMethod("absquatulate"), OtherIOther.class)); }
Example #3
Source File: AspectJExpressionPointcutTests.java From spring4-understanding with Apache License 2.0 | 6 votes |
private void testWithinPackage(boolean matchSubpackages) throws SecurityException, NoSuchMethodException { String withinBeansPackage = "within(org.springframework.tests.sample.beans."; // Subpackages are matched by ** if (matchSubpackages) { withinBeansPackage += "."; } withinBeansPackage = withinBeansPackage + "*)"; AspectJExpressionPointcut withinBeansPc = new AspectJExpressionPointcut(); withinBeansPc.setExpression(withinBeansPackage); assertTrue(withinBeansPc.matches(TestBean.class)); assertTrue(withinBeansPc.matches(getAge, TestBean.class)); assertEquals(matchSubpackages, withinBeansPc.matches(DeepBean.class)); assertEquals(matchSubpackages, withinBeansPc.matches( DeepBean.class.getMethod("aMethod", String.class), DeepBean.class)); assertFalse(withinBeansPc.matches(String.class)); assertFalse(withinBeansPc.matches(OtherIOther.class.getMethod("absquatulate", (Class<?>[])null), OtherIOther.class)); }
Example #4
Source File: TypePatternClassFilterTests.java From spring-analysis-note with MIT License | 5 votes |
@Test public void testValidPatternMatching() { TypePatternClassFilter tpcf = new TypePatternClassFilter("org.springframework.tests.sample.beans.*"); assertTrue("Must match: in package", tpcf.matches(TestBean.class)); assertTrue("Must match: in package", tpcf.matches(ITestBean.class)); assertTrue("Must match: in package", tpcf.matches(IOther.class)); assertFalse("Must be excluded: in wrong package", tpcf.matches(DeepBean.class)); assertFalse("Must be excluded: in wrong package", tpcf.matches(BeanFactory.class)); assertFalse("Must be excluded: in wrong package", tpcf.matches(DefaultListableBeanFactory.class)); }
Example #5
Source File: TypePatternClassFilterTests.java From java-technology-stack with MIT License | 5 votes |
@Test public void testValidPatternMatching() { TypePatternClassFilter tpcf = new TypePatternClassFilter("org.springframework.tests.sample.beans.*"); assertTrue("Must match: in package", tpcf.matches(TestBean.class)); assertTrue("Must match: in package", tpcf.matches(ITestBean.class)); assertTrue("Must match: in package", tpcf.matches(IOther.class)); assertFalse("Must be excluded: in wrong package", tpcf.matches(DeepBean.class)); assertFalse("Must be excluded: in wrong package", tpcf.matches(BeanFactory.class)); assertFalse("Must be excluded: in wrong package", tpcf.matches(DefaultListableBeanFactory.class)); }
Example #6
Source File: TypePatternClassFilterTests.java From spring4-understanding with Apache License 2.0 | 5 votes |
@Test public void testValidPatternMatching() { TypePatternClassFilter tpcf = new TypePatternClassFilter("org.springframework.tests.sample.beans.*"); assertTrue("Must match: in package", tpcf.matches(TestBean.class)); assertTrue("Must match: in package", tpcf.matches(ITestBean.class)); assertTrue("Must match: in package", tpcf.matches(IOther.class)); assertFalse("Must be excluded: in wrong package", tpcf.matches(DeepBean.class)); assertFalse("Must be excluded: in wrong package", tpcf.matches(BeanFactory.class)); assertFalse("Must be excluded: in wrong package", tpcf.matches(DefaultListableBeanFactory.class)); }