-
Notifications
You must be signed in to change notification settings - Fork 7
/
ExportedServicesMissingTest.java
70 lines (60 loc) · 2.09 KB
/
ExportedServicesMissingTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* Copyright 2012 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package test.org.jboss.forge.furnace.deployment;
import javax.inject.Inject;
import org.jboss.arquillian.container.spi.client.container.DeploymentException;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.ShouldThrowException;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.forge.arquillian.AddonDependency;
import org.jboss.forge.arquillian.Dependencies;
import org.jboss.forge.arquillian.archive.ForgeArchive;
import org.jboss.forge.furnace.repositories.AddonDependencyEntry;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import test.org.jboss.forge.furnace.mocks.ServiceInterface;
/**
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
*/
// FIXME
@Ignore("For some reason this works only sporadically")
@RunWith(Arquillian.class)
public class ExportedServicesMissingTest
{
@Deployment(order = 2)
@ShouldThrowException(DeploymentException.class)
public static ForgeArchive getDeployment()
{
ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
.addClass(ServiceInterface.class)
.addAsAddonDependencies(
AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi")
)
.addBeansXML();
return archive;
}
@Deployment(name = "primer,1", order = 1)
@Dependencies({
@AddonDependency(name = "org.jboss.forge.furnace.container:cdi")
})
public static ForgeArchive getDeploymentPrimer()
{
ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class).addBeansXML();
return archive;
}
@Inject
@SuppressWarnings("unused")
private ServiceInterface remote;
@Test
public void testRemoteInjectionOfRemoteService()
{
Assert.fail("Should not have been called.");
}
}