2012-02-22 5 views
0

私は、Spring Securityをweblogic 10.3.5コンテナでユニットテストしようとしています。 EclipseとWeblogicの環境が提供されていますが、どちらもあまり慣れていません。起動時にWeblogicコンテナを使用した春のセキュリティのユニットテスト

、私は例外を取得:結果

java.lang.NoClassDefFoundError: javax/servlet/Filter 
    at java.lang.ClassLoader.defineClass1(Native Method) 
    blahblahblah 

を、このユニットテストが失敗した:だから

@Test 
    public void testGetByIdViaAccessRoles() { 
     Person result; 

     // Test the results with a ROLE_ADMIN user. This SHOULD work. 
    SecurityContextHolder.getContext().setAuthentication(admin); 
    result = personRepository.getById(1L); 
    assertNotNull(result); 

    // test the results with a ROLE_USER. Should also be good... 
    SecurityContextHolder.getContext().setAuthentication(user); 
    result = personRepository.getById(1L); 
    assertNotNull(result); 

    // test the results with a nonexistent user. Should go kablooie. 
    SecurityContextHolder.getContext().setAuthentication(nonuser); 
    try { 
     result = personRepository.getById(1L); 
     fail("Should be impossible to get this with a nonexistent user."); 
    } catch (AccessDeniedException ex) { 

    } 
} 

、私は、サーブレットを拾っていないよ推測しています。 weblogicからのjarしかし、私は比較的新しいEclipseユーザー(長い間IntelliJ)であるため、私はweblogicが正しくセットアップされているかどうかはわかりません。

私のプロジェクトファセットでは、Oracle WebLogic Web App Extensionsをチェックしましたが、他のWebLogicロジックはコンフィグレーションされていません。動的Webモジュールもチェックされます。

誰かがnewbに援助を提供できますか?

ジェイソン

答えて

0

無視してください。ターゲットランタイムの別のオプションが見つかりました。私がそれを設定したら、それは働いた。

関連する問題