@Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(SubclassImplementationTarget.class)
       .refine(
           new ObjectPropertyAssertion.Refinement<MethodLookupEngine.Finding>() {
             @Override
             public void apply(MethodLookupEngine.Finding mock) {
               when(mock.getInvokableMethods()).thenReturn(new MethodList.Empty());
               when(mock.getInvokableDefaultMethods())
                   .thenReturn(Collections.<TypeDescription, Set<MethodDescription>>emptyMap());
               TypeDescription typeDescription = mock(TypeDescription.class);
               when(mock.getTypeDescription()).thenReturn(typeDescription);
               when(typeDescription.getSupertype()).thenReturn(typeDescription);
               when(typeDescription.getDeclaredMethods()).thenReturn(new MethodList.Empty());
             }
           })
       .refine(
           new ObjectPropertyAssertion.Refinement<BridgeMethodResolver.Factory>() {
             @Override
             public void apply(BridgeMethodResolver.Factory mock) {
               when(mock.make(any(MethodList.class))).thenReturn(mock(BridgeMethodResolver.class));
             }
           })
       .apply();
   ObjectPropertyAssertion.of(SubclassImplementationTarget.OriginTypeIdentifier.class).apply();
 }
Esempio n. 2
0
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(Super.Binder.class).apply();
   ObjectPropertyAssertion.of(Super.Instantiation.class).apply();
   ObjectPropertyAssertion.of(Super.Binder.TypeLocator.ForInstrumentedType.class).apply();
   ObjectPropertyAssertion.of(Super.Binder.TypeLocator.ForParameterType.class).apply();
   ObjectPropertyAssertion.of(Super.Binder.TypeLocator.ForType.class).apply();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(MultipleParentClassLoader.class).applyBasic();
   ObjectPropertyAssertion.of(MultipleParentClassLoader.CompoundEnumeration.class).applyBasic();
   ObjectPropertyAssertion.of(MultipleParentClassLoader.Builder.class).apply();
   ObjectPropertyAssertion.of(MultipleParentClassLoader.Builder.ClassLoaderCreationAction.class)
       .apply();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(AgentBuilder.RedefinitionStrategy.class).apply();
   ObjectPropertyAssertion.of(
           AgentBuilder.RedefinitionStrategy.Collector.ForRedefinition.Cumulative.class)
       .applyBasic();
   ObjectPropertyAssertion.of(
           AgentBuilder.RedefinitionStrategy.Collector.ForRedefinition.Chunked.class)
       .applyBasic();
   final Iterator<Class<?>> iterator =
       Arrays.<Class<?>>asList(Object.class, String.class).iterator();
   ObjectPropertyAssertion.of(
           AgentBuilder.RedefinitionStrategy.Collector.ForRedefinition.Entry.class)
       .create(
           new ObjectPropertyAssertion.Creator<Class<?>>() {
             @Override
             public Class<?> create() {
               return iterator.next();
             }
           })
       .apply();
   ObjectPropertyAssertion.of(
           AgentBuilder.RedefinitionStrategy.Collector.ForRetransformation.Cumulative.class)
       .applyBasic();
   ObjectPropertyAssertion.of(
           AgentBuilder.RedefinitionStrategy.Collector.ForRetransformation.Chunked.class)
       .applyBasic();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(MethodRebaseResolver.Resolution.ForRebasedMethod.class)
       .refine(
           new ObjectPropertyAssertion.Refinement<MethodDescription>() {
             @Override
             public void apply(MethodDescription mock) {
               when(mock.getParameters()).thenReturn(new ParameterList.Empty());
               when(mock.getExceptionTypes()).thenReturn(new TypeList.Empty());
               when(mock.getDeclaringType()).thenReturn(mock(TypeDescription.class));
               when(mock.getReturnType()).thenReturn(mock(TypeDescription.class));
             }
           })
       .refine(
           new ObjectPropertyAssertion.Refinement<MethodRebaseResolver.MethodNameTransformer>() {
             @Override
             public void apply(MethodRebaseResolver.MethodNameTransformer mock) {
               when(mock.transform(any(MethodDescription.class)))
                   .thenReturn(FOO + System.identityHashCode(mock));
             }
           })
       .apply();
 }
Esempio n. 6
0
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(JavaType.class).apply();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(AgentBuilder.TypeStrategy.Default.class).apply();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(
           InlineDynamicTypeBuilder.TargetHandler.ForRebaseInstrumentation.class)
       .apply();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(ReferenceTypeAwareAssigner.class).apply();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(PackageDefinitionStrategy.Definition.Undefined.class).apply();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(TypeConstantAdjustment.class).apply();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(ClassFileLocator.PackageDiscriminating.class).apply();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(LatentMatcher.ForFieldToken.class).apply();
   ObjectPropertyAssertion.of(LatentMatcher.ForFieldToken.ResolvedMatcher.class).apply();
 }
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(AllArguments.Assignment.class).apply();
   ObjectPropertyAssertion.of(AllArguments.Binder.class).apply();
 }
Esempio n. 15
0
 @Test
 public void testObjectProperties() throws Exception {
   ObjectPropertyAssertion.of(TypeWriter.Default.class).apply();
 }