Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ACE7210BBC for ; Wed, 30 Apr 2014 01:45:22 +0000 (UTC) Received: (qmail 15108 invoked by uid 500); 30 Apr 2014 01:45:19 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 14966 invoked by uid 500); 30 Apr 2014 01:45:19 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 14957 invoked by uid 99); 30 Apr 2014 01:45:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Apr 2014 01:45:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Apr 2014 01:45:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5BA7B2388A3B; Wed, 30 Apr 2014 01:44:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1591172 - in /commons/proper/jcs/trunk: commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/ commons-jcs-jcache/src/main/resources/META-INF/services/ commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/ commons-jcs-tc... Date: Wed, 30 Apr 2014 01:44:55 -0000 To: commits@commons.apache.org From: olamy@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140430014456.5BA7B2388A3B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olamy Date: Wed Apr 30 01:44:55 2014 New Revision: 1591172 URL: http://svn.apache.org/r1591172 Log: rat check pass now Modified: commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/Asserts.java commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/Times.java commons/proper/jcs/trunk/commons-jcs-jcache/src/main/resources/META-INF/services/javax.cache.spi.CachingProvider commons/proper/jcs/trunk/commons-jcs-jcache/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension commons/proper/jcs/trunk/commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/CacheTest.java commons/proper/jcs/trunk/commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/CachingProviderTest.java commons/proper/jcs/trunk/commons-jcs-tck-tests/src/test/java/org/apache/commons/jcs/jcache/OWBBeanProvider.java commons/proper/jcs/trunk/commons-jcs-tck-tests/src/test/resources/META-INF/services/javax.cache.annotation.BeanProvider Modified: commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/Asserts.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/Asserts.java?rev=1591172&r1=1591171&r2=1591172&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/Asserts.java (original) +++ commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/Asserts.java Wed Apr 30 01:44:55 2014 @@ -1,5 +1,24 @@ package org.apache.commons.jcs.jcache; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + public class Asserts { public static void assertNotNull(final Object value, final String name) Modified: commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/Times.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/Times.java?rev=1591172&r1=1591171&r2=1591172&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/Times.java (original) +++ commons/proper/jcs/trunk/commons-jcs-jcache/src/main/java/org/apache/commons/jcs/jcache/Times.java Wed Apr 30 01:44:55 2014 @@ -1,5 +1,24 @@ package org.apache.commons.jcs.jcache; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + public class Times { public static long now() Modified: commons/proper/jcs/trunk/commons-jcs-jcache/src/main/resources/META-INF/services/javax.cache.spi.CachingProvider URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-jcache/src/main/resources/META-INF/services/javax.cache.spi.CachingProvider?rev=1591172&r1=1591171&r2=1591172&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-jcache/src/main/resources/META-INF/services/javax.cache.spi.CachingProvider (original) +++ commons/proper/jcs/trunk/commons-jcs-jcache/src/main/resources/META-INF/services/javax.cache.spi.CachingProvider Wed Apr 30 01:44:55 2014 @@ -1 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + org.apache.commons.jcs.jcache.JCSCachingProvider Modified: commons/proper/jcs/trunk/commons-jcs-jcache/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-jcache/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension?rev=1591172&r1=1591171&r2=1591172&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-jcache/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension (original) +++ commons/proper/jcs/trunk/commons-jcs-jcache/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension Wed Apr 30 01:44:55 2014 @@ -1 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + org.apache.commons.jcs.jcache.cdi.MakeJCacheCDIIntercetporFriendly Modified: commons/proper/jcs/trunk/commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/CacheTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/CacheTest.java?rev=1591172&r1=1591171&r2=1591172&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/CacheTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/CacheTest.java Wed Apr 30 01:44:55 2014 @@ -1,12 +1,25 @@ package org.apache.commons.jcs.jcache; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ -import java.util.HashSet; -import java.util.Map; -import java.util.Set; +import org.junit.Test; import javax.cache.Cache; import javax.cache.CacheManager; @@ -14,7 +27,6 @@ import javax.cache.Caching; import javax.cache.configuration.CacheEntryListenerConfiguration; import javax.cache.configuration.CompleteConfiguration; import javax.cache.configuration.Factory; -import javax.cache.configuration.MutableConfiguration; import javax.cache.event.CacheEntryCreatedListener; import javax.cache.event.CacheEntryEvent; import javax.cache.event.CacheEntryEventFilter; @@ -27,8 +39,11 @@ import javax.cache.integration.CacheLoad import javax.cache.integration.CacheLoaderException; import javax.cache.integration.CacheWriter; import javax.cache.spi.CachingProvider; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; -import org.junit.Test; +import static org.junit.Assert.*; public class CacheTest { @@ -37,14 +52,14 @@ public class CacheTest { final CachingProvider cachingProvider = Caching.getCachingProvider(); final CacheManager cacheManager = cachingProvider.getCacheManager(); - cacheManager.createCache("default", null); - final Cache cache = cacheManager.getCache("default"); - assertFalse(cache.containsKey("foo")); - cache.put("foo", "bar"); - assertTrue(cache.containsKey("foo")); - assertEquals("bar", cache.get("foo")); - cache.remove("foo"); - assertFalse(cache.containsKey("foo")); + cacheManager.createCache( "default", null ); + final Cache cache = cacheManager.getCache( "default" ); + assertFalse( cache.containsKey( "foo" ) ); + cache.put( "foo", "bar" ); + assertTrue( cache.containsKey( "foo" ) ); + assertEquals( "bar", cache.get( "foo" ) ); + cache.remove( "foo" ); + assertFalse( cache.containsKey( "foo" ) ); cachingProvider.close(); } @@ -53,10 +68,10 @@ public class CacheTest { final CachingProvider cachingProvider = Caching.getCachingProvider(); final CacheManager cacheManager = cachingProvider.getCacheManager(); - cacheManager.createCache("default", null); - final Cache cache = cacheManager.getCache("default"); + cacheManager.createCache( "default", null ); + final Cache cache = cacheManager.getCache( "default" ); final Set event = new HashSet(); - cache.registerCacheEntryListener(new CacheEntryListenerConfiguration() + cache.registerCacheEntryListener( new CacheEntryListenerConfiguration() { @Override public Factory> getCacheEntryListenerFactory() @@ -69,10 +84,11 @@ public class CacheTest return new CacheEntryCreatedListener() { @Override - public void onCreated(Iterable> cacheEntryEvents) - throws CacheEntryListenerException + public void onCreated( + Iterable> cacheEntryEvents ) + throws CacheEntryListenerException { - event.add(cacheEntryEvents.iterator().next().getKey()); + event.add( cacheEntryEvents.iterator().next().getKey() ); } }; } @@ -96,8 +112,8 @@ public class CacheTest { return false; } - }); - cache.registerCacheEntryListener(new CacheEntryListenerConfiguration() + } ); + cache.registerCacheEntryListener( new CacheEntryListenerConfiguration() { @Override public Factory> getCacheEntryListenerFactory() @@ -110,10 +126,11 @@ public class CacheTest return new CacheEntryUpdatedListener() { @Override - public void onUpdated(Iterable> cacheEntryEvents) - throws CacheEntryListenerException + public void onUpdated( + Iterable> cacheEntryEvents ) + throws CacheEntryListenerException { - event.add(cacheEntryEvents.iterator().next().getKey()); + event.add( cacheEntryEvents.iterator().next().getKey() ); } }; } @@ -137,8 +154,8 @@ public class CacheTest { return false; } - }); - cache.registerCacheEntryListener(new CacheEntryListenerConfiguration() + } ); + cache.registerCacheEntryListener( new CacheEntryListenerConfiguration() { @Override public Factory> getCacheEntryListenerFactory() @@ -151,10 +168,11 @@ public class CacheTest return new CacheEntryRemovedListener() { @Override - public void onRemoved(Iterable> cacheEntryEvents) - throws CacheEntryListenerException + public void onRemoved( + Iterable> cacheEntryEvents ) + throws CacheEntryListenerException { - event.add(cacheEntryEvents.iterator().next().getKey()); + event.add( cacheEntryEvents.iterator().next().getKey() ); } }; } @@ -178,19 +196,19 @@ public class CacheTest { return false; } - }); + } ); - cache.put("foo", "bar"); - assertEquals(1, event.size()); - assertEquals("foo", event.iterator().next()); + cache.put( "foo", "bar" ); + assertEquals( 1, event.size() ); + assertEquals( "foo", event.iterator().next() ); event.clear(); - cache.put("foo", "new"); - assertEquals(1, event.size()); - assertEquals("foo", event.iterator().next()); + cache.put( "foo", "new" ); + assertEquals( 1, event.size() ); + assertEquals( "foo", event.iterator().next() ); event.clear(); - cache.remove("foo"); - assertEquals(1, event.size()); - assertEquals("foo", event.iterator().next()); + cache.remove( "foo" ); + assertEquals( 1, event.size() ); + assertEquals( "foo", event.iterator().next() ); cachingProvider.close(); } @@ -200,7 +218,7 @@ public class CacheTest { final CachingProvider cachingProvider = Caching.getCachingProvider(); final CacheManager cacheManager = cachingProvider.getCacheManager(); - cacheManager.createCache("default", new CompleteConfiguration() + cacheManager.createCache( "default", new CompleteConfiguration() { @Override public boolean isReadThrough() @@ -243,13 +261,15 @@ public class CacheTest return new CacheLoader() { @Override - public Object load(Object key) throws CacheLoaderException + public Object load( Object key ) + throws CacheLoaderException { return "super"; } @Override - public Map loadAll(Iterable keys) throws CacheLoaderException + public Map loadAll( Iterable keys ) + throws CacheLoaderException { return null; } @@ -287,9 +307,9 @@ public class CacheTest { return false; } - }); - final Cache cache = cacheManager.getCache("default"); - assertEquals("super", cache.get("lazilyLoaded")); + } ); + final Cache cache = cacheManager.getCache( "default" ); + assertEquals( "super", cache.get( "lazilyLoaded" ) ); cachingProvider.close(); } } Modified: commons/proper/jcs/trunk/commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/CachingProviderTest.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/CachingProviderTest.java?rev=1591172&r1=1591171&r2=1591172&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/CachingProviderTest.java (original) +++ commons/proper/jcs/trunk/commons-jcs-jcache/src/test/java/org/apache/commons/jcs/jcache/CachingProviderTest.java Wed Apr 30 01:44:55 2014 @@ -1,25 +1,44 @@ package org.apache.commons.jcs.jcache; -import static org.junit.Assert.assertNotNull; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.junit.Test; import javax.cache.Caching; import javax.cache.spi.CachingProvider; -import org.junit.Test; +import static org.junit.Assert.assertNotNull; public class CachingProviderTest { @Test public void findProvider() { - assertNotNull(Caching.getCachingProvider()); + assertNotNull( Caching.getCachingProvider() ); } @Test public void createCacheMgr() { final CachingProvider cachingProvider = Caching.getCachingProvider(); - assertNotNull(cachingProvider.getCacheManager()); + assertNotNull( cachingProvider.getCacheManager() ); cachingProvider.close(); } } Modified: commons/proper/jcs/trunk/commons-jcs-tck-tests/src/test/java/org/apache/commons/jcs/jcache/OWBBeanProvider.java URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-tck-tests/src/test/java/org/apache/commons/jcs/jcache/OWBBeanProvider.java?rev=1591172&r1=1591171&r2=1591172&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-tck-tests/src/test/java/org/apache/commons/jcs/jcache/OWBBeanProvider.java (original) +++ commons/proper/jcs/trunk/commons-jcs-tck-tests/src/test/java/org/apache/commons/jcs/jcache/OWBBeanProvider.java Wed Apr 30 01:44:55 2014 @@ -26,33 +26,41 @@ import javax.cache.annotation.BeanProvid import javax.enterprise.inject.spi.Bean; import java.util.Set; -public class OWBBeanProvider implements BeanProvider { +public class OWBBeanProvider + implements BeanProvider +{ private final BeanManagerImpl bm; - public OWBBeanProvider() { + public OWBBeanProvider() + { final WebBeansContext webBeansContext = WebBeansContext.currentInstance(); - final ContainerLifecycle lifecycle = webBeansContext.getService(ContainerLifecycle.class); - lifecycle.startApplication(null); - Runtime.getRuntime().addShutdownHook(new Thread() { + final ContainerLifecycle lifecycle = webBeansContext.getService( ContainerLifecycle.class ); + lifecycle.startApplication( null ); + Runtime.getRuntime().addShutdownHook( new Thread() + { @Override - public void run() { - lifecycle.stopApplication(null); + public void run() + { + lifecycle.stopApplication( null ); } - }); + } ); bm = webBeansContext.getBeanManagerImpl(); } @Override - public T getBeanByType(final Class tClass) { - if (tClass == null) { - throw new IllegalArgumentException("no bean class specified"); + public T getBeanByType( final Class tClass ) + { + if ( tClass == null ) + { + throw new IllegalArgumentException( "no bean class specified" ); } - final Set> beans = bm.getBeans(tClass); - if (beans.isEmpty()) { - throw new IllegalStateException("no bean of type " + tClass.getName()); + final Set> beans = bm.getBeans( tClass ); + if ( beans.isEmpty() ) + { + throw new IllegalStateException( "no bean of type " + tClass.getName() ); } - final Bean bean = bm.resolve(beans); - return (T) bm.getReference(bean, bean.getBeanClass(), bm.createCreationalContext(bean)); + final Bean bean = bm.resolve( beans ); + return (T) bm.getReference( bean, bean.getBeanClass(), bm.createCreationalContext( bean ) ); } } Modified: commons/proper/jcs/trunk/commons-jcs-tck-tests/src/test/resources/META-INF/services/javax.cache.annotation.BeanProvider URL: http://svn.apache.org/viewvc/commons/proper/jcs/trunk/commons-jcs-tck-tests/src/test/resources/META-INF/services/javax.cache.annotation.BeanProvider?rev=1591172&r1=1591171&r2=1591172&view=diff ============================================================================== --- commons/proper/jcs/trunk/commons-jcs-tck-tests/src/test/resources/META-INF/services/javax.cache.annotation.BeanProvider (original) +++ commons/proper/jcs/trunk/commons-jcs-tck-tests/src/test/resources/META-INF/services/javax.cache.annotation.BeanProvider Wed Apr 30 01:44:55 2014 @@ -1 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + org.apache.commons.jcs.jcache.OWBBeanProvider