Skip to content

Commit

Permalink
Merge pull request #572 from radcortez/tck
Browse files Browse the repository at this point in the history
Fix TCK tests for Profile
  • Loading branch information
Emily-Jiang authored Jun 11, 2020
2 parents c4d0e3c + 00275e1 commit c0d3203
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.eclipse.microprofile.config.tck.profile;


import static org.hamcrest.MatcherAssert.assertThat;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;


import javax.enterprise.context.Dependent;
import javax.enterprise.inject.spi.CDI;
import javax.inject.Inject;
Expand All @@ -44,11 +40,10 @@

/**
* Test cases for Config profile
*
*
* @author Emily Jiang
*/
public class DevConfigProfileTest extends Arquillian {

@Deployment
public static Archive deployment() {
JavaArchive testJar = ShrinkWrap
Expand All @@ -63,13 +58,13 @@ public static Archive deployment() {
"vehicle.name=car"),
"microprofile-config.properties")
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
.as(JavaArchive.class);
.as(JavaArchive.class);

WebArchive war = ShrinkWrap
.create(WebArchive.class, "DevConfigProfileTest.war")
.addAsLibrary(testJar);
return war;

}

@Test
Expand All @@ -87,5 +82,5 @@ public static class ProfilePropertyBean {
public String getConfigProperty() {
return vehicleName;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.eclipse.microprofile.config.tck.profile;


import static org.hamcrest.MatcherAssert.assertThat;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;


import javax.enterprise.context.Dependent;
import javax.enterprise.inject.spi.CDI;
import javax.inject.Inject;

import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.config.tck.base.AbstractTest;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.testng.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
Expand All @@ -45,11 +40,10 @@

/**
* Test cases for Config profile
*
*
* @author Emily Jiang
*/
public class InvalidConfigProfileTest extends Arquillian {

@Deployment
public static Archive deployment() {
JavaArchive testJar = ShrinkWrap
Expand All @@ -66,8 +60,6 @@ public static Archive deployment() {
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
.as(JavaArchive.class);

AbstractTest.addFile(testJar, "META-INF/microprofile-config.properties");

WebArchive war = ShrinkWrap
.create(WebArchive.class, "InvalidConfigProfileTest.war")
.addAsLibrary(testJar);
Expand All @@ -89,5 +81,5 @@ public static class ProfilePropertyBean {
public String getConfigProperty() {
return vehicleName;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.eclipse.microprofile.config.tck.profile;


import static org.hamcrest.MatcherAssert.assertThat;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;


import javax.enterprise.context.Dependent;
import javax.enterprise.inject.spi.CDI;
import javax.inject.Inject;

import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.config.tck.base.AbstractTest;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.testng.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
Expand All @@ -45,11 +40,10 @@

/**
* Test cases for Config profile
*
*
* @author Emily Jiang
*/
public class ProdProfileTest extends Arquillian {

@Deployment
public static Archive deployment() {
JavaArchive testJar = ShrinkWrap
Expand All @@ -66,8 +60,6 @@ public static Archive deployment() {
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
.as(JavaArchive.class);

AbstractTest.addFile(testJar, "META-INF/microprofile-config.properties");

WebArchive war = ShrinkWrap
.create(WebArchive.class, "ProdProfileTest.war")
.addAsLibrary(testJar);
Expand All @@ -89,5 +81,5 @@ public static class ProfilePropertyBean {
public String getConfigProperty() {
return vehicleName;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.eclipse.microprofile.config.tck.profile;


import static org.hamcrest.MatcherAssert.assertThat;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;


import javax.enterprise.context.Dependent;
import javax.enterprise.inject.spi.CDI;
import javax.inject.Inject;

import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.config.tck.base.AbstractTest;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.testng.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
Expand All @@ -45,11 +40,10 @@

/**
* Test cases for Config profile
*
*
* @author Emily Jiang
*/
public class TestConfigProfileTest extends Arquillian {

@Deployment
public static Archive deployment() {
JavaArchive testJar = ShrinkWrap
Expand All @@ -66,13 +60,10 @@ public static Archive deployment() {
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
.as(JavaArchive.class);

AbstractTest.addFile(testJar, "META-INF/microprofile-config.properties");

WebArchive war = ShrinkWrap
.create(WebArchive.class, "TestConfigProfileTest.war")
.addAsLibrary(testJar);
return war;

}

@Test
Expand All @@ -90,5 +81,5 @@ public static class ProfilePropertyBean {
public String getConfigProperty() {
return vehicleName;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.eclipse.microprofile.config.tck.profile;


import static org.hamcrest.MatcherAssert.assertThat;

import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;


import javax.enterprise.context.Dependent;
import javax.enterprise.inject.spi.CDI;
import javax.inject.Inject;

import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.config.spi.ConfigSource;
import org.eclipse.microprofile.config.tck.base.AbstractTest;
import org.eclipse.microprofile.config.tck.configsources.CustomConfigProfileConfigSource;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.testng.Arquillian;
Expand All @@ -47,11 +42,10 @@

/**
* Test cases for Config profile
*
*
* @author Emily Jiang
*/
public class TestCustomConfigProfile extends Arquillian {

@Deployment
public static Archive deployment() {
JavaArchive testJar = ShrinkWrap
Expand All @@ -69,13 +63,10 @@ public static Archive deployment() {
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
.as(JavaArchive.class);

AbstractTest.addFile(testJar, "META-INF/microprofile-config.properties");

WebArchive war = ShrinkWrap
.create(WebArchive.class, "TestConfigProfileTest.war")
.addAsLibrary(testJar);
return war;

}

@Test
Expand All @@ -93,5 +84,5 @@ public static class ProfilePropertyBean {
public String getConfigProperty() {
return vehicleName;
}
}
}
}

0 comments on commit c0d3203

Please sign in to comment.