Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DAA7C17EE1 for ; Fri, 29 May 2015 19:10:24 +0000 (UTC) Received: (qmail 65887 invoked by uid 500); 29 May 2015 19:10:24 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 65834 invoked by uid 500); 29 May 2015 19:10:24 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 65792 invoked by uid 99); 29 May 2015 19:10:24 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2015 19:10:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 209D71A4021 for ; Fri, 29 May 2015 19:10:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id tGIml9tr6h6c for ; Fri, 29 May 2015 19:10:22 +0000 (UTC) Received: from amber.s12n.de (amber.s12n.de [109.239.48.183]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id BDCD420A93 for ; Fri, 29 May 2015 19:10:21 +0000 (UTC) Received: from [83.133.179.216] (p5385B3D8.club.muc.ccc.de [83.133.179.216]) by amber.s12n.de (Postfix) with ESMTPSA id D31AD36B for ; Fri, 29 May 2015 21:09:50 +0200 (CEST) Message-ID: <5568B968.1060404@stefan-seelmann.de> Date: Fri, 29 May 2015 21:09:28 +0200 From: Stefan Seelmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: dev@directory.apache.org Subject: Re: [Studio] Tests ? References: <55687D74.6040008@gmail.com> <55687F62.2040706@phantomjinx.co.uk> <5568905D.80809@gmail.com> In-Reply-To: <5568905D.80809@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.98.6 at amber X-Virus-Status: Clean On 05/29/2015 06:14 PM, Emmanuel Lécharny wrote: > Le 29/05/15 17:01, phantomjinx a écrit : >> On 29/05/15 15:53, Emmanuel Lécharny wrote: >>> Hi Stefan, >>> >>> I'd like to test some of the classes I'm writing in Studio, using junit >>> (they are not GUI classes). ATM, we don't define junit as a dependence >>> in any of the Studio projects. What would be the best way to do that ? >>> >>> Thanks ! >> Hey Emmanuel, >> >> Seeing as how you've helped me, I am sure I can return the favour. >> >> My project is Teiid Designer [1], which provides a number of plugins and a perspective as part of >> JbossTools. We have a large number of unit tests [2] (using junit) that would provide a framework >> for what you are hoping to do. An example of the kind of pom you would need to write would be >> something like this [3]. >> >> The test plugins (or fragments if you prefer) will depend on junit, which would need to be made >> available from your target-platform. >> >> Hope this helps. If not, apologies for the intrusion. > > Thanks ! > > I'm dumb, we already have everything needed, and I wasn't even aware of > it. I just have to run mvn test to get my tests executed. > > The thing is that in eclipse, we don't see the test source file. Right, junit test dependency and surefire is configured in plugins/pom.xml and tests are executed by maven build. However in Eclipse you have to add them manually to build path and add junit dependency. The cause is that putting main and test code in one bundle is not OSGi like. See also https://issues.apache.org/jira/browse/DIRSTUDIO-1021 for more details. Kind Regards, Stefan