JavaTestsResource.st
author vranyj1
Thu, 15 Nov 2012 22:10:02 +0000
branchdirectory_structure_refactoring
changeset 1818 2e5ed72e7dfd
parent 1634 src/JavaTestsResource.st@a2ae0d53b2e9
child 1824 0200794e93f5
permissions -rw-r--r--
Directory structure refactoring (part 2)

"
 COPYRIGHT (c) 1996-2011 by Claus Gittinger

 New code and modifications done at SWING Research Group [1]:

 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
                            SWING Research Group, Czech Technical University in Prague

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.

 [1] Code written at SWING Research Group contains a signature
     of one of the above copright owners. For exact set of such code,
     see the differences between this version and version stx:libjava
     as of 1.9.2010
"
"{ Package: 'stx:libjava' }"

JavaAntProjectResource subclass:#JavaTestsResource
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-Java-Tests'
!

!JavaTestsResource class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1996-2011 by Claus Gittinger

 New code and modifications done at SWING Research Group [1]:

 COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
                            SWING Research Group, Czech Technical University in Prague

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.

 [1] Code written at SWING Research Group contains a signature
     of one of the above copright owners. For exact set of such code,
     see the differences between this version and version stx:libjava
     as of 1.9.2010

"
! !

!JavaTestsResource class methodsFor:'accessing'!

classpath
    |cp|

    cp := OrderedCollection new.
    self antProjectDir 
        directoryContentsDo:[:dir | 
            (self shouldIncludeProject: dir) ifTrue:[
                cp := cp , (self classpathFor:dir)
            ]].
    ^ cp

    "
        JavaTestsResource classpath"

    "Created: / 07-05-2011 / 18:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 28-03-2012 / 12:28:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

classpathFor:testProject 
    |cp dir|

    cp := OrderedCollection new.
    dir := self antProjectDir / testProject.
    dir isDirectory 
        ifTrue:
            [ (dir / 'bin') exists ifTrue:[ cp add:(dir / 'bin') asString ].
            (dir / 'lib') exists 
                ifTrue:
                    [ cp addAll:((dir / 'lib') directoryContentsAsFilenames 
                                select:[:jar | jar suffix = 'jar' ]) ] ].
    ^ cp

    "
        JavaTestsResource testsClasspath"

    "Created: / 11-06-2011 / 15:58:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

classpathForLibjava
    ^ self classpathFor:'libjava'

    "
        JavaTestsResource classpathForLibjava
    "

    "Created: / 21-06-2011 / 17:34:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

classpathForMauve
    ^ self classpathFor:'libjava-mauve'

    "
        JavaTestsResource classpathForMauve
    "

    "Created: / 11-06-2011 / 15:59:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

properties

    ^{
        { 'dir.libs' . (JavaLibraries directory / 'libs') pathName }
    }

    "Created: / 02-09-2011 / 09:37:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

resources

    ^Array with: JavaLibrariesResource

    "Created: / 02-09-2011 / 09:13:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

shouldIncludeProject: testProject

    ^ (testProject ~= 'libjava-mauve')

    "Created: / 10-03-2012 / 11:03:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!JavaTestsResource class methodsFor:'accessing - ant project'!

antProjectDir

    ^ UserPreferences current javaTestsDirectory asFilename

    "Modified: / 07-05-2011 / 17:57:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Created: / 18-07-2011 / 18:15:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!JavaTestsResource class methodsFor:'documentation'!

version_SVN
    ^ '$Id$'
! !