/**
  * Tests if a AfterReturning advice gets woven at its correct position
  *
  * @return void
  *
  * @throws \Exception
  *
  * @expectedException \Exception
  */
 public function testPointcutAfterReturningSelection()
 {
     $this->testClass->iHaveAnAfterReturningAdviceAndReturnSomething();
     $methodInvocation = PointcutReferencingTestClass::$staticStorage;
     $this->assertInstanceOf('\\AppserverIo\\Psr\\MetaobjectProtocol\\Aop\\MethodInvocationInterface', $methodInvocation);
     $this->assertEquals('iHaveAnAfterReturningAdviceAndReturnSomething', $methodInvocation->getResult());
     $this->assertNull($methodInvocation->getThrownException());
     // reset the static storage and test if we will get something again
     try {
         PointcutReferencingTestClass::$staticStorage = null;
         $this->testClass->iHaveAnAfterReturningAdviceAndThrowSomething();
     } catch (\Exception $e) {
         $this->assertNull(PointcutReferencingTestClass::$staticStorage);
         throw $e;
     }
 }