Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EA9E3200C5D for ; Thu, 23 Mar 2017 14:02:52 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E963C160B84; Thu, 23 Mar 2017 13:02:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0E99B160B75 for ; Thu, 23 Mar 2017 14:02:51 +0100 (CET) Received: (qmail 36687 invoked by uid 500); 23 Mar 2017 13:02:51 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 36670 invoked by uid 99); 23 Mar 2017 13:02:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Mar 2017 13:02:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 53434C0578 for ; Thu, 23 Mar 2017 13:02:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -98.549 X-Spam-Level: X-Spam-Status: No, score=-98.549 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id PWuRHpImD1XJ for ; Thu, 23 Mar 2017 13:02:44 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id EEC8F5FC5A for ; Thu, 23 Mar 2017 13:02:43 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 04A96E0D19 for ; Thu, 23 Mar 2017 13:02:43 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1561321DB8 for ; Thu, 23 Mar 2017 13:02:42 +0000 (UTC) Date: Thu, 23 Mar 2017 13:02:42 +0000 (UTC) From: "Anton Vinogradov (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (IGNITE-4211) Update Spring dependency to latest stable version MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 23 Mar 2017 13:02:53 -0000 [ https://issues.apache.org/jira/browse/IGNITE-4211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15938171#comment-15938171 ] Anton Vinogradov edited comment on IGNITE-4211 at 3/23/17 1:02 PM: ------------------------------------------------------------------- [~daradurvs] > If you don't agree with my approach, and if the test of @Cachenable(sync=true) is enough for you: > Just write it, I will change the test and then it's done. > Such simple task was delayed for a long time. We have the highest standards across the industry and everything should be fixed/implemented in proper way. Also each contribution shoud follow https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules and https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines > it is very strange test Next rule is: each contributor should figure it out how current solution work before proposing replacement. > I think we have to cover the all new code with unit tests Correct, but we should not have 2 or more test approach it case one is ehough. > And I think we have to tests the following cases: > valueLoader parameter was called only once per same key; [1] > if a cache contains nothing for a key, a result of valueLoader parameter will added to the cache correctly; [2] > if valueLoader parameter throws some exceptions, the new get-method rethrows the excepted type of exception; [3] Sure, we have to. All these cases can_be/already covered by GridSpringCacheManagerSelfTest 1) this checks by a double call {noformat} assertEquals("value" + i, dynamicSvc.cacheable(i)); assertEquals("value" + i, dynamicSvc.cacheable(i)); {noformat} and follow-up counter check {noformat} assertEquals(1, dynamicSvc.called()); {noformat} 2) this checks by a call {noformat} assertEquals("value" + i, dynamicSvc.cacheable(i)); {noformat} and follow-up cache check {noformat} assertEquals(1, c.size()); assertEquals("value" + 1, c.get(1)); {noformat} 3) value loader is an aop'ed @Cacheable method and it can throw only runtime exception. And it's will be covered in proper way. {noformat} java.lang.RuntimeException at org.apache.ignite.cache.spring.GridSpringDynamicCacheTestService.cacheable(GridSpringDynamicCacheTestService.java:43) at org.apache.ignite.cache.spring.GridSpringDynamicCacheTestService$$FastClassBySpringCGLIB$$63a1306.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52) at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:299) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:332) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:281) at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653) at org.apache.ignite.cache.spring.GridSpringDynamicCacheTestService$$EnhancerBySpringCGLIB$$7bd6b246.cacheable() at org.apache.ignite.cache.spring.GridSpringCacheManagerSelfTest.testDynamicCache(GridSpringCacheManagerSelfTest.java:350) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at junit.framework.TestCase.runTest(TestCase.java:176) {noformat} > Just make that the any get-methods returned "null". > What happens? - Nothing. Green light in the GridSpringCacheManagerSelfTest. Please write an example showing this. > I found the bug IGNITE-4823, when SpringCache was covered with unit-tests Thanks for finding this! Unfortunatelly @CachePut annotation not cover this, so we have to check this method directly. BTW, any ideas why it's not covered by @CachePut? was (Author: avinogradov): > If you don't agree with my approach, and if the test of @Cachenable(sync=true) is enough for you: > Just write it, I will change the test and then it's done. > Such simple task was delayed for a long time. We have the highest standards across the industry and everything should be fixed/implemented in proper way. Also each contribution shoud follow https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules and https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines > it is very strange test Next rule is: each contributor should figure it out how current solution work before proposing replacement. > I think we have to cover the all new code with unit tests Correct, but we should not have 2 or more test approach it case one is ehough. > And I think we have to tests the following cases: > valueLoader parameter was called only once per same key; [1] > if a cache contains nothing for a key, a result of valueLoader parameter will added to the cache correctly; [2] > if valueLoader parameter throws some exceptions, the new get-method rethrows the excepted type of exception; [3] Sure, we have to. All these cases can_be/already covered by GridSpringCacheManagerSelfTest 1) this checks by a double call {noformat} assertEquals("value" + i, dynamicSvc.cacheable(i)); assertEquals("value" + i, dynamicSvc.cacheable(i)); {noformat} and follow-up counter check {noformat} assertEquals(1, dynamicSvc.called()); {noformat} 2) this checks by a call {noformat} assertEquals("value" + i, dynamicSvc.cacheable(i)); {noformat} and follow-up cache check {noformat} assertEquals(1, c.size()); assertEquals("value" + 1, c.get(1)); {noformat} 3) value loader is an aop'ed @Cacheable method and it can throw only runtime exception. And it's will be covered in proper way. {noformat} java.lang.RuntimeException at org.apache.ignite.cache.spring.GridSpringDynamicCacheTestService.cacheable(GridSpringDynamicCacheTestService.java:43) at org.apache.ignite.cache.spring.GridSpringDynamicCacheTestService$$FastClassBySpringCGLIB$$63a1306.invoke() at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.cache.interceptor.CacheInterceptor$1.invoke(CacheInterceptor.java:52) at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:299) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:332) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:281) at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653) at org.apache.ignite.cache.spring.GridSpringDynamicCacheTestService$$EnhancerBySpringCGLIB$$7bd6b246.cacheable() at org.apache.ignite.cache.spring.GridSpringCacheManagerSelfTest.testDynamicCache(GridSpringCacheManagerSelfTest.java:350) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at junit.framework.TestCase.runTest(TestCase.java:176) {noformat} > Just make that the any get-methods returned "null". > What happens? - Nothing. Green light in the GridSpringCacheManagerSelfTest. Please write an example showing this. > I found the bug IGNITE-4823, when SpringCache was covered with unit-tests Thanks for finding this! Unfortunatelly @CachePut annotation not cover this, so we have to check this method directly. BTW, any ideas why it's not covered by @CachePut? > Update Spring dependency to latest stable version > ------------------------------------------------- > > Key: IGNITE-4211 > URL: https://issues.apache.org/jira/browse/IGNITE-4211 > Project: Ignite > Issue Type: Improvement > Components: build > Affects Versions: 1.7 > Reporter: Sergey Kozlov > Assignee: Vyacheslav Daradur > Fix For: 2.0 > > > It seems the Spring dependency looks outdated for now. Apache Ignite still uses 4.1.0 released two years ago. Could we to update to latest stable version (4.3.4 at the moment)? -- This message was sent by Atlassian JIRA (v6.3.15#6346)