Author: cziegeler Date: Thu Jan 7 12:45:11 2010 New Revision: 896864 URL: http://svn.apache.org/viewvc?rev=896864&view=rev Log: SLING-1275 : Return value of ComponentContext#locateContext should be checked for null value - fix junit test.
Modified: sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImplTest.java Modified: sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImplTest.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImplTest.java?rev=896864&r1=896863&r2=896864&view=diff ============================================================================== --- sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImplTest.java (original) +++ sling/trunk/bundles/jcr/resource/src/test/java/org/apache/sling/jcr/resource/internal/JcrResourceResolverFactoryImplTest.java Thu Jan 7 12:45:11 2010 @@ -20,8 +20,13 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; + +import javax.jcr.Node; +import javax.jcr.RepositoryException; + import junit.framework.Assert; +import org.apache.sling.jcr.resource.JcrResourceTypeProvider; import org.jmock.Expectations; import org.jmock.Mockery; import org.jmock.integration.junit4.JMock; @@ -64,7 +69,13 @@ final ComponentContext componentContext = this.getMockery().mock(ComponentContext.class); this.getMockery().checking(new Expectations() {{ allowing(componentContext).locateService(with(any(String.class)), with(any(ServiceReference.class))); - will(returnValue(null)); + will(returnValue(new JcrResourceTypeProvider() { + + public String getResourceTypeForNode(Node n) throws RepositoryException { + // TODO Auto-generated method stub + return null; + } + })); }}); assertTrue(factory.jcrResourceTypeProviders.isEmpty()); factory.componentContext = componentContext;