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<String, String> 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<String, String> 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<String, String> cache = cacheManager.getCache("default");
+ cacheManager.createCache( "default", null );
+ final Cache<String, String> cache = cacheManager.getCache( "default" );
final Set<String> event = new HashSet<String>();
- cache.registerCacheEntryListener(new
CacheEntryListenerConfiguration<String, String>()
+ cache.registerCacheEntryListener( new
CacheEntryListenerConfiguration<String, String>()
{
@Override
public Factory<CacheEntryListener<? super String, ? super String>>
getCacheEntryListenerFactory()
@@ -69,10 +84,11 @@ public class CacheTest
return new CacheEntryCreatedListener<String, String>()
{
@Override
- public void onCreated(Iterable<CacheEntryEvent<?
extends String, ? extends String>> cacheEntryEvents)
- throws CacheEntryListenerException
+ public void onCreated(
+ Iterable<CacheEntryEvent<? extends String, ?
extends String>> 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<String, String>()
+ } );
+ cache.registerCacheEntryListener( new
CacheEntryListenerConfiguration<String, String>()
{
@Override
public Factory<CacheEntryListener<? super String, ? super String>>
getCacheEntryListenerFactory()
@@ -110,10 +126,11 @@ public class CacheTest
return new CacheEntryUpdatedListener<String, String>()
{
@Override
- public void onUpdated(Iterable<CacheEntryEvent<?
extends String, ? extends String>> cacheEntryEvents)
- throws CacheEntryListenerException
+ public void onUpdated(
+ Iterable<CacheEntryEvent<? extends String, ?
extends String>> 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<String, String>()
+ } );
+ cache.registerCacheEntryListener( new
CacheEntryListenerConfiguration<String, String>()
{
@Override
public Factory<CacheEntryListener<? super String, ? super String>>
getCacheEntryListenerFactory()
@@ -151,10 +168,11 @@ public class CacheTest
return new CacheEntryRemovedListener<String, String>()
{
@Override
- public void onRemoved(Iterable<CacheEntryEvent<?
extends String, ? extends String>> cacheEntryEvents)
- throws CacheEntryListenerException
+ public void onRemoved(
+ Iterable<CacheEntryEvent<? extends String, ?
extends String>> 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<Object,
Object>()
+ cacheManager.createCache( "default", new CompleteConfiguration<Object,
Object>()
{
@Override
public boolean isReadThrough()
@@ -243,13 +261,15 @@ public class CacheTest
return new CacheLoader<Object, Object>()
{
@Override
- public Object load(Object key) throws
CacheLoaderException
+ public Object load( Object key )
+ throws CacheLoaderException
{
return "super";
}
@Override
- public Map<Object, Object> loadAll(Iterable<?>
keys) throws CacheLoaderException
+ public Map<Object, Object> loadAll( Iterable<?>
keys )
+ throws CacheLoaderException
{
return null;
}
@@ -287,9 +307,9 @@ public class CacheTest
{
return false;
}
- });
- final Cache<String, String> cache = cacheManager.getCache("default");
- assertEquals("super", cache.get("lazilyLoaded"));
+ } );
+ final Cache<String, String> 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> T getBeanByType(final Class<T> tClass) {
- if (tClass == null) {
- throw new IllegalArgumentException("no bean class specified");
+ public <T> T getBeanByType( final Class<T> tClass )
+ {
+ if ( tClass == null )
+ {
+ throw new IllegalArgumentException( "no bean class specified" );
}
- final Set<Bean<?>> beans = bm.getBeans(tClass);
- if (beans.isEmpty()) {
- throw new IllegalStateException("no bean of type " +
tClass.getName());
+ final Set<Bean<?>> 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