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
17 changes: 5 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,14 @@ limitations under the License.
</dependency>

<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.inject</artifactId>
<version>0.9.0.M4</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-testing</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -92,12 +91,6 @@ limitations under the License.
<version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>6.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,35 @@
* limitations under the License.
*/

import javax.inject.Inject;

import java.io.StringWriter;

import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.eclipse.sisu.launch.InjectedTest;
import org.codehaus.plexus.testing.PlexusTest;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

public class DefaultVelocityComponentTest extends InjectedTest {
@Test
public void testBasic() {
VelocityComponent velocity;

VelocityContext context;
@PlexusTest
public class DefaultVelocityComponentTest {

String value;
@Inject
private VelocityComponent velocity;

velocity = lookup(VelocityComponent.class);
@Test
public void testBasic() {

// test the properties
value = (String) velocity.getEngine().getProperty("hello");
String value = (String) velocity.getEngine().getProperty("hello");

assertNotNull(value);

assertEquals("world", value);

// test the rendering
context = new VelocityContext();
VelocityContext context = new VelocityContext();

context.put("variable", "Value from context");

Expand Down