You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by gp...@apache.org on 2012/01/14 07:05:07 UTC

git commit: DELTASPIKE-35 cleanup

Updated Branches:
  refs/heads/master 06b5c444e -> 87989f765


DELTASPIKE-35 cleanup


Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/87989f76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/87989f76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/87989f76

Branch: refs/heads/master
Commit: 87989f765e1242c7517a58668027f405dee4c92c
Parents: 06b5c44
Author: gpetracek <gp...@apache.org>
Authored: Sat Jan 14 07:01:55 2012 +0100
Committer: gpetracek <gp...@apache.org>
Committed: Sat Jan 14 07:01:55 2012 +0100

----------------------------------------------------------------------
 .../core/impl/config/BaseConfigSource.java         |    5 +-
 .../core/api/exclude/ExcludeIntegrationTest.java   |    5 +-
 .../IntegrationTestProjectStageProducer.java       |    2 +-
 .../core/api/provider/BeanManagerProviderTest.java |   72 -------------
 .../core/impl/activation/ActivatedClass.java       |   26 -----
 .../core/impl/activation/DeactivatedClass.java     |   26 -----
 .../impl/activation/TestClassDeactivation.java     |   83 ---------------
 .../core/impl/activation/TestClassDeactivator.java |   37 -------
 8 files changed, 8 insertions(+), 248 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/87989f76/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/BaseConfigSource.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/BaseConfigSource.java b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/BaseConfigSource.java
index 01a97fe..229254e 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/BaseConfigSource.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/config/BaseConfigSource.java
@@ -32,6 +32,9 @@ public abstract class BaseConfigSource implements ConfigSource
 
     private int ordinal = 1000; // default
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     public int getOrdinal()
     {
@@ -49,6 +52,7 @@ public abstract class BaseConfigSource implements ConfigSource
         this.ordinal = defaultOrdinal;
 
         String configuredOrdinalString = getPropertyValue(ConfigSource.DELTASPIKE_ORDINAL);
+
         try
         {
             if(configuredOrdinalString != null)
@@ -62,5 +66,4 @@ public abstract class BaseConfigSource implements ConfigSource
                     "The configured config-ordinal isn't a valid integer. Invalid value: " + configuredOrdinalString);
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/87989f76/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/exclude/ExcludeIntegrationTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/exclude/ExcludeIntegrationTest.java b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/exclude/ExcludeIntegrationTest.java
index ebf1fbe..4fbce76 100644
--- a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/exclude/ExcludeIntegrationTest.java
+++ b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/exclude/ExcludeIntegrationTest.java
@@ -57,7 +57,7 @@ public class ExcludeIntegrationTest
     @Deployment
     public static WebArchive deploy()
     {
-        URL fileUrl = ExcludeIntegrationTest.class.getClassLoader()
+        URL deltaSpikeConfig = ExcludeIntegrationTest.class.getClassLoader()
                 .getResource("META-INF/apache-deltaspike.properties");
 
         URL testExtensionsFileUrl = ExcludeIntegrationTest.class.getClassLoader()
@@ -71,7 +71,8 @@ public class ExcludeIntegrationTest
                                 "org.apache.deltaspike.test.core.api.exclude"},
                         null))
                 .addClass(IntegrationTestProjectStageProducer.class)
-                .addAsResource(FileUtils.getFileForURL(fileUrl.toString()))
+                .addAsResource(FileUtils.getFileForURL(deltaSpikeConfig.toString()),
+                        "META-INF/apache-deltaspike.properties")
                 .addAsResource(FileUtils.getFileForURL(testExtensionsFileUrl.toString()),
                         "META-INF/services/javax.enterprise.inject.spi.Extension")
                 .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/87989f76/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/projectstage/IntegrationTestProjectStageProducer.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/projectstage/IntegrationTestProjectStageProducer.java b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/projectstage/IntegrationTestProjectStageProducer.java
index 18ba399..9ff1518 100644
--- a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/projectstage/IntegrationTestProjectStageProducer.java
+++ b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/projectstage/IntegrationTestProjectStageProducer.java
@@ -25,7 +25,7 @@ import javax.enterprise.inject.Typed;
 
 /**
  * Custom {@link ProjectStageProducer} which sets the project-stage to integration-test as soon as it gets used.
- * It's configured in apache-deltaspike.properties
+ * It's configured in apache-deltaspike.properties and e.g. used by ExcludeIntegrationTest
  */
 @Typed()
 public class IntegrationTestProjectStageProducer extends ProjectStageProducer

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/87989f76/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/BeanManagerProviderTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/BeanManagerProviderTest.java b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/BeanManagerProviderTest.java
deleted file mode 100644
index f727803..0000000
--- a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/api/provider/BeanManagerProviderTest.java
+++ /dev/null
@@ -1,72 +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 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.
- */
-
-package org.apache.deltaspike.integration.core.api.provider;
-
-
-import org.apache.deltaspike.core.api.provider.BeanManagerProvider;
-import  org.apache.deltaspike.test.core.api.temptestutil.ShrinkWrapArchiveUtil;
-import org.apache.deltaspike.integration.category.SeCategory;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-
-
-import javax.enterprise.inject.spi.BeanManager;
-
-/**
- * X TODO will be merged with the original test as soon as we have the final approach
- */
-@RunWith(Arquillian.class)
-@Category(SeCategory.class)
-public class BeanManagerProviderTest
-{
-    /**
-     * X TODO creating a WebArchive is only a workaround because JavaArchive cannot contain other archives.
-     */
-    @Deployment
-    public static WebArchive deploy()
-    {
-        return ShrinkWrap.create(WebArchive.class)
-                         .addAsLibraries(ShrinkWrapArchiveUtil.getArchives(null,
-                                 "META-INF/beans.xml",
-                                 new String[]{"org.apache.deltaspike.core",
-                                         "org.apache.deltaspike.integration.category",
-                                         "org.apache.deltaspike.integration.util",
-                                         "org.apache.deltaspike.integration.core.api.provider"},
-                                 null))
-                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
-    }
-
-    @Test
-    public void testBeanManagerProvider() throws Exception
-    {
-        BeanManagerProvider bmp = BeanManagerProvider.getInstance();
-        Assert.assertNotNull(bmp);
-
-        BeanManager bm = bmp.getBeanManager();
-        Assert.assertNotNull(bm);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/87989f76/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/ActivatedClass.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/ActivatedClass.java b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/ActivatedClass.java
deleted file mode 100644
index 8745463..0000000
--- a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/ActivatedClass.java
+++ /dev/null
@@ -1,26 +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 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.
- */
-package org.apache.deltaspike.integration.core.impl.activation;
-
-/**
- * Class which isn't deactivated
- */
-public class ActivatedClass
-{
-}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/87989f76/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/DeactivatedClass.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/DeactivatedClass.java b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/DeactivatedClass.java
deleted file mode 100644
index 9868863..0000000
--- a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/DeactivatedClass.java
+++ /dev/null
@@ -1,26 +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 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.
- */
-package org.apache.deltaspike.integration.core.impl.activation;
-
-/**
- * Class which is deactivated
- */
-public class DeactivatedClass
-{
-}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/87989f76/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/TestClassDeactivation.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/TestClassDeactivation.java b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/TestClassDeactivation.java
deleted file mode 100644
index 3e32ba0..0000000
--- a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/TestClassDeactivation.java
+++ /dev/null
@@ -1,83 +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 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.
- */
-package org.apache.deltaspike.integration.core.impl.activation;
-
-import org.apache.deltaspike.core.impl.util.ClassDeactivation;
-import org.apache.deltaspike.integration.category.SeCategory;
-import  org.apache.deltaspike.test.core.api.temptestutil.ShrinkWrapArchiveUtil;
-import org.apache.deltaspike.test.util.FileUtils;
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.asset.EmptyAsset;
-import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-import org.junit.runner.RunWith;
-
-import java.net.URL;
-
-/**
- * X TODO will be merged with the original test as soon as we have the final approach
- * Test for {@link org.apache.deltaspike.core.api.activation.ClassDeactivator}
- */
-@RunWith(Arquillian.class)
-@Category(SeCategory.class)
-public class TestClassDeactivation
-{
-    /**
-     *X TODO creating a WebArchive is only a workaround because JavaArchive cannot contain other archives.
-     */
-    @Deployment
-    public static WebArchive deploy()
-    {
-        URL fileUrl = TestClassDeactivation.class.getClassLoader()
-                .getResource("META-INF/apache-deltaspike.properties");
-
-        return ShrinkWrap.create(WebArchive.class)
-                .addAsLibraries(ShrinkWrapArchiveUtil.getArchives(null,
-                        "META-INF/beans.xml",
-                        new String[]{"org.apache.deltaspike.core",
-                                "org.apache.deltaspike.integration.category",
-                                "org.apache.deltaspike.integration.util",
-                                "org.apache.deltaspike.integration.core.impl.activation"},
-                        null))
-                .addAsResource(FileUtils.getFileForURL(fileUrl.toString()))
-                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
-    }
-
-    /**
-     * Tests if a class of the added package is active
-     */
-    @Test
-    public void testActivatedClass()
-    {
-        Assert.assertTrue(ClassDeactivation.isClassActivated(ActivatedClass.class));
-    }
-
-    /**
-     * Tests if the class deactivated by {@link TestClassDeactivator} is recognized as such
-     */
-    @Test
-    public void testDeactivatedClass()
-    {
-        Assert.assertFalse(ClassDeactivation.isClassActivated(DeactivatedClass.class));
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/87989f76/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/TestClassDeactivator.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/TestClassDeactivator.java b/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/TestClassDeactivator.java
deleted file mode 100644
index 09db7ff..0000000
--- a/deltaspike/core/integration-test/src/test/java/org/apache/deltaspike/integration/core/impl/activation/TestClassDeactivator.java
+++ /dev/null
@@ -1,37 +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 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.
- */
-package org.apache.deltaspike.integration.core.impl.activation;
-
-import org.apache.deltaspike.core.api.activation.AbstractClassDeactivator;
-
-/**
- * Test {@link org.apache.deltaspike.core.api.activation.ClassDeactivator}
- * which is needed to test {@link org.apache.deltaspike.core.impl.util.ClassDeactivation}
- */
-public class TestClassDeactivator extends AbstractClassDeactivator
-{
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    protected void deactivateClasses()
-    {
-        addDeactivatedClass(DeactivatedClass.class);
-    }
-}