Problem creating test for a new addon I'm developing
jyothiprasadb Mar 1, 2015 11:54 AMI'm creating a forge addon and following the below folder structure of having seperate addon, impl, tests and api folders. I wrote my Facet implementation in Impl. I'm able to successfully execute the addon. However, I want to create some unit tests to test my addon. I haven't even come to stage of writing tests to my addon. I have followed http://forge.jboss.org/document/test-your-addonhttp://forge.jboss.org/document/test-your-addon and created a sample test. This is what is there in my test
@RunWith(Arquillian.class)
public class FirstTest {
@Deployment
@Dependencies({
@AddonDependency(name = "org.codehaus.griffon.forge:griffon-forge-addon", version = "1.0.0-SNAPSHOT") })
public static ForgeArchive getDeployment() {
ForgeArchive archive = ShrinkWrap.create(ForgeArchive.class)
.addBeansXML()
.addAsAddonDependencies(AddonDependencyEntry.create("org.codehaus.griffon.forge:griffon-forge-addon", "1.0.0-SNAPSHOT") );
return archive;
}
@Test
public void testSomething() throws Exception {
Assert.fail("Not implemented");
}
}
When I'm trying to run this test I'm getting the following error.
testSomething(org.codehaus.griffon.forge.FirstTest): Test runner could not locate test class [org.codehaus.griffon.forge.FirstTest] in any deployed Addon.
Can anyone tell me what is the process to be followed when writing tests for our addons if we follow the structure addon, api, impl and tests? Do we have to install the addon to test it? Isn't there any way to test the addon without first installing? Is it possible to test a Facet directly without running through Forge?
Also in log when I try to run the test I see following Warning
WARNING: Addon [_DEFAULT_,e165a928-b624-4d65-bbc5-e44b290bd744 +MISSING HC: 453307127] has [1] missing dependencies: [Missing: name=org.codehaus.griffon.forge:griffon-forge-addon, version=1.0.0-SNAPSHOT, exported=false, optional=false] and will be not be loaded until all required dependencies are available.
Why does my addon, which is in the same project not available for my test? am I missing something? I would appreciate if someone can point me to a place where I can find out how to write tests. This greatly reduces my development time.