You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by pl...@apache.org on 2015/05/15 19:55:50 UTC

incubator-tamaya git commit: Added a new constraint to ensure that a service configuration contains only existing classes.

Repository: incubator-tamaya
Updated Branches:
  refs/heads/master 9a77880c5 -> 96d70dcd4


Added a new constraint to ensure that a service configuration contains only existing classes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/96d70dcd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/96d70dcd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/96d70dcd

Branch: refs/heads/master
Commit: 96d70dcd4c4239dfebc15977fe674a5db269e6b6
Parents: 9a77880
Author: Oliver B. Fischer <pl...@apache.org>
Authored: Fri May 15 20:20:42 2015 +0200
Committer: Oliver B. Fischer <pl...@apache.org>
Committed: Fri May 15 19:52:47 2015 +0200

----------------------------------------------------------------------
 ....apache.tamaya.core.resources.ResourceLoader | 19 ----------------
 .../org.apache.tamaya.spi.PropertySource        |  3 +--
 ...tServiceContextTest$InvalidPriorityInterface |  3 +--
 ...efaultServiceContextTest$MultiImplsInterface |  2 +-
 ....apache.tamaya.core.resources.ResourceLoader | 19 ----------------
 .../org.apache.tamaya.spi.PropertySource        |  2 +-
 jqassistant/default.xml                         |  1 +
 jqassistant/serviceloader-rules.xml             | 24 ++++++++++++++++++++
 .../org.apache.tamaya.spi.PropertySource        |  2 +-
 ...org.apache.tamaya.spi.PropertySourceProvider | 19 ----------------
 10 files changed, 30 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/96d70dcd/java7/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resources.ResourceLoader
----------------------------------------------------------------------
diff --git a/java7/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resources.ResourceLoader b/java7/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resources.ResourceLoader
deleted file mode 100644
index a964d3c..0000000
--- a/java7/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resources.ResourceLoader
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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 current 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.tamaya.resource.internal.DefaultResourceLoader

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/96d70dcd/java7/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
----------------------------------------------------------------------
diff --git a/java7/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource b/java7/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
index 9f453f5..1b8f8c0 100644
--- a/java7/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
+++ b/java7/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
@@ -17,5 +17,4 @@
 # under the License.
 #
 org.apache.tamaya.core.propertysource.EnvironmentPropertySource
-org.apache.tamaya.core.propertysource.SystemPropertySource
-
+org.apache.tamaya.core.propertysource.SystemPropertySource
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/96d70dcd/java7/core/src/test/resources/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$InvalidPriorityInterface
----------------------------------------------------------------------
diff --git a/java7/core/src/test/resources/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$InvalidPriorityInterface b/java7/core/src/test/resources/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$InvalidPriorityInterface
index 9d96b65..f203fa6 100644
--- a/java7/core/src/test/resources/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$InvalidPriorityInterface
+++ b/java7/core/src/test/resources/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$InvalidPriorityInterface
@@ -14,6 +14,5 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
 org.apache.tamaya.core.internal.DefaultServiceContextTest$InvalidPriorityImpl1
-org.apache.tamaya.core.internal.DefaultServiceContextTest$InvalidPriorityImpl2
+org.apache.tamaya.core.internal.DefaultServiceContextTest$InvalidPriorityImpl2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/96d70dcd/java7/core/src/test/resources/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$MultiImplsInterface
----------------------------------------------------------------------
diff --git a/java7/core/src/test/resources/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$MultiImplsInterface b/java7/core/src/test/resources/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$MultiImplsInterface
index 2e24ed0..b144790 100644
--- a/java7/core/src/test/resources/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$MultiImplsInterface
+++ b/java7/core/src/test/resources/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$MultiImplsInterface
@@ -17,4 +17,4 @@
 
 org.apache.tamaya.core.internal.DefaultServiceContextTest$MultiImpl1
 org.apache.tamaya.core.internal.DefaultServiceContextTest$MultiImpl2
-org.apache.tamaya.core.internal.DefaultServiceContextTest$MultiImpl3
+org.apache.tamaya.core.internal.DefaultServiceContextTest$MultiImpl3
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/96d70dcd/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resources.ResourceLoader
----------------------------------------------------------------------
diff --git a/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resources.ResourceLoader b/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resources.ResourceLoader
deleted file mode 100644
index a964d3c..0000000
--- a/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.core.resources.ResourceLoader
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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 current 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.tamaya.resource.internal.DefaultResourceLoader

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/96d70dcd/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
----------------------------------------------------------------------
diff --git a/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource b/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
index 5306d6c..1b8f8c0 100644
--- a/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
+++ b/java8/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
@@ -17,4 +17,4 @@
 # under the License.
 #
 org.apache.tamaya.core.propertysource.EnvironmentPropertySource
-org.apache.tamaya.core.propertysource.SystemPropertySource
+org.apache.tamaya.core.propertysource.SystemPropertySource
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/96d70dcd/jqassistant/default.xml
----------------------------------------------------------------------
diff --git a/jqassistant/default.xml b/jqassistant/default.xml
index e2e0afa..c35ec68 100644
--- a/jqassistant/default.xml
+++ b/jqassistant/default.xml
@@ -58,5 +58,6 @@ under the License.
         <includeConstraint refId="serviceLoader:correctServiceLoaderNaming"/>
         <includeConstraint refId="serviceLoader:ServiceImplementationsMustBeListedInServiceConfigurations"/>
         <includeConstraint refId="serviceLoader:serviceConfigurationsMustNotBeEmpty"/>
+        <includeConstraint refId="serviceLoader:serviceConfigurationsMustNotContainNonExistingClasses"/>
     </group>
 </jqa:jqassistant-rules>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/96d70dcd/jqassistant/serviceloader-rules.xml
----------------------------------------------------------------------
diff --git a/jqassistant/serviceloader-rules.xml b/jqassistant/serviceloader-rules.xml
index cb8ee42..5589252 100644
--- a/jqassistant/serviceloader-rules.xml
+++ b/jqassistant/serviceloader-rules.xml
@@ -98,4 +98,28 @@ under the License.
                 sc.fileName AS emptyServiceConfiguration
         ]]></cypher>
     </constraint>
+
+    <constraint id="serviceLoader:serviceConfigurationsMustNotContainNonExistingClasses">
+        <requiresConcept refId="serviceLoader:SPI"/>
+        <description>Service configurations must contain only existing classes.</description>
+        <cypher><![CDATA[
+        MATCH
+            (sl:ServiceLoader)-[:CONTAINS]->(entry)
+
+        WHERE
+            NOT entry:Class
+
+            // Have to exclude these files as jQAssistant cannot handle inner classes in
+            // service configurations in version 1.0.0.
+            // I reported this problem already to the project
+            // Oliver B. Fischer, 15.5.5
+            AND NOT sl.fileName IN ['/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$MultiImplsInterface',
+                                    '/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$InvalidPriorityInterface',
+                                    '/META-INF/services/org.apache.tamaya.core.internal.DefaultServiceContextTest$InvalidPriorityInterface']
+
+        RETURN
+            sl.fileName AS serviceConfiguration, entry.name AS class
+        ]]></cypher>
+    </constraint>
+
 </jqa:jqassistant-rules>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/96d70dcd/modules/builder/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
----------------------------------------------------------------------
diff --git a/modules/builder/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertySource b/modules/builder/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
index 64d1b0d..8b07205 100644
--- a/modules/builder/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
+++ b/modules/builder/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertySource
@@ -16,4 +16,4 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-org.apache.tamaya.builder.TestPropertySource
+org.apache.tamaya.builder.TestPropertySource
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/96d70dcd/modules/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
----------------------------------------------------------------------
diff --git a/modules/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider b/modules/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
deleted file mode 100644
index b3a2634..0000000
--- a/modules/metamodels/simple/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# 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 current 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.tamaya.metamodel.simple.SimpleConfigProvider
\ No newline at end of file