Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class MyDecorator implements Greeting {

@Override
public String greet(String name) {
return greeting.greet(name + " <b>very much!</b>");
return greeting.greet(name + " very much!");
}

}

This file was deleted.

55 changes: 0 additions & 55 deletions cdi/decorators/src/main/webapp/index.jsp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.javaee7.cdi.decorators;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Test;
import org.junit.runner.RunWith;

import javax.inject.Inject;
import java.io.File;
import java.net.URISyntaxException;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
* @author Korneliusz Rabczak
*/
@RunWith(Arquillian.class)
public class DecoratorTest {

@Inject
Greeting greeting;

@Deployment
public static Archive<?> deploy() throws URISyntaxException {
return ShrinkWrap.create(JavaArchive.class)
.addAsManifestResource(new File("src/main/webapp/WEB-INF/beans.xml"), "beans.xml")
.addPackage(SimpleGreeting.class.getPackage());
}

@Test
public void test() {
assertThat(greeting.greet("Duke"), is("Hello Duke very much!"));
}
}