BrynCooke/cdi-unit — Issue #1: Class not found
Author: uvula
Created: 2011-11-18 19:44:08+00:00
State: open

Hi, I found your cdi-unit until I googled "cdi junit java se" and want to try it.
I added the repository + artifact (0.9.7) into my pom.xml (using Maven 3.0.2)

Any idea?

Uwe / Germany

Here are output and test case:

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running ula.sandbox.model.HausFactoryTest
59 [main] INFO org.jboss.weld.Version - WELD-000900 1.0.1 (Final)
124 [main] ERROR org.jboss.weld.environment.se.discovery.Scanner - Error loading org/jglue/cdiunit/DummyHttpRequest.class
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
at java.lang.ClassLoader.defineClass1(Native Method)

My test class is use simple POJO object:

package ula.sandbox.model;

import static org.junit.Assert.*;

import javax.inject.Inject;

import org.jglue.cdiunit.CdiRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(CdiRunner.class)
public class HausFactoryTest {

// @Inject
// private HausFactory factory;

@Inject
private Haus haus;

@Test
public void test() {
System.out.println(haus);
}

}