How to load classes for a particular package

I have a package name say com.test
i need to get the names of all the classes starting with "Test" under this package. Also, i need to get the names of all the methods starting with "test" in each of these classes.
ideas/suggestions welcome :)
cheers
yogesh

Kaj,
thnx for ur time :)
i am developing a testing framework for our web applications. all our applications wd require to have com.test as the package which will contain all the JUnit test classes. the package name (com.test) will be provided by the tester thru a properties file. my framework will load all the classes (and also fetch the method names starting with "test" in those classes) and display them on a gui in a html form. the tester will just select the junit test cases he wants to run and my framework will expose this service thru a servlet. the servlet will then invoke all the methods selected by the tester via reflection.
if the way i want to do it is not possible cd u please suggest any alternatives ?
cheers
yogesh

Similar Messages

  • How to find classes in a particular package?

    Does anyone know how in Java to find out what classes belong to a particular package? Or to find out what classes inherit from a particular class?
    The reason why I'm asking this is that I want to create a BeanInfo property editor for a widget that will give me a list of any classes in a particular package. I know what that package can be and I know what the main class is that everyone should inherit from. I can easily create a beaninfo property editor with a string array of the classes, but I don't want to have to go back and maintain this code everytime I add another class to that package. I would love to use introspection but I haven't found the right commands to use yet.
    Anyone have any ideas?
    Thanks!

    Not too difficult, the following snippet is used to gather information about a class. beanClass can be parsed to extract package name. and you ask the class directly about its superClasses and implemented Interfaces.
        private Class beanClass = null;
        private Class beanSuperClass = null;
        private Constructor[] constructors = null;
        private Field[] fields = null;
        private Method[] methods = null;
        private Object beanInstance = null;
        public setBeanDetail(Object o) {
            beanInstance = o;
            beanClass = o.getClass();
            beanSuperClass = beanClass.getSuperclass();
            constructors = beanClass.getConstructors();
            fields = beanClass.getDeclaredFields();
            methods = beanClass.getMethods();
        }have loads of fun with it.
    tj...

  • How to provide hyperlink for a particular field in ALV

    Hi,
      How to provide hyperlink for a particular field in alv report.
    Regards,
    Ramu.

    Yes you can do that. using the fieldcatalog there is an option for that. give HOT_SPOT = 'X'. for the column you want.
    wa_field-hotspot = 'X'.
    REPORT  ztest_alv.
    TYPE-POOLS:slis.
    DATA:it_fieldcat  TYPE  slis_t_fieldcat_alv,
         wa_field LIKE LINE OF it_fieldcat.
    DATA: BEGIN OF it_likp OCCURS 0,
           vbeln TYPE likp-vbeln,
          END OF it_likp.
    DATA: layout TYPE slis_layout_alv.
    wa_field-fieldname = 'VBELN'.
    wa_field-tabname = 'IT_LIKP'.
    wa_field-hotspot = 'X'.
    wa_field-outputlen = 10.
    wa_field-no_zero = 'X'.
    wa_field-seltext_l = 'Sales'.
    APPEND wa_field TO it_fieldcat.
    SELECT vbeln FROM likp
    UP TO 10 ROWS
    INTO TABLE it_likp.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program      = sy-repid
        is_layout               = layout
        i_callback_user_command = 'USER_COMMAND'
        it_fieldcat             = it_fieldcat
      TABLES
        t_outtab                = it_likp
      EXCEPTIONS
        program_error           = 1.
    *&      Form  user_Command
    *       text
    *      -->UCOMM      text
    *      -->SELFIELD   text
    FORM user_command USING ucomm TYPE sy-ucomm
                        selfield TYPE slis_selfield.
      CASE ucomm.
        WHEN '&IC1'.
          SET PARAMETER ID 'VL'  FIELD selfield-value.
          CALL TRANSACTION 'VL02N' AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM.                    "user_Command

  • How to load data in a particular order ?

    Hi
    I am trying to load data from an oracle view to a oracle table. Its working fine.
    However the problem is, the load is not in a particular order. I mean the order
    in which the data is loaded in target table is not fixed. It means sometimes
    a particular data value (say row1 ) comes before another data value(say row2)
    and again executing the interface second time may not follow the same order.
    I have a requirement to load it in a specific order.
    Please reply.
    Regards
    Manoj

    Hi Surya
    Thanks for the quick reply and its working as well.
    But I am still unable to solve the problem I made the above changes for.
    Actually, I am loading members for a particular dimension from an oracle
    view(say view1) to an oracle table(say table1). I have created a view(say view2)
    from this table1.The reason to create the view2 is to use the logic
    ORDER BY ,CONNECT BY PRIOR to sort the stored/shared members.
    Now I am using this view2 to load members for a dimension in planning.
    On first execution, it executes without any error. But on executing it again, it throws
    many errors, most of which say Cannot load dimension member, error message is:
    com.hyperion.planning.HspRuntimeException: Move would result in base member being
    a sibling of a corresponding shared member
    This error occured previously as well.I mean before using an ORDER BY in my first interface,
    ie loading from view1 to table1.
    Kindly help me to resolve the problem.
    Regards
    Manoj.
    Edited by: 908458 on Mar 1, 2012 7:30 AM

  • How to give comments for a particular table

    hi..
    how to give comments for a particular table ..
    select * from user_tab_comments;
    tx in advance..

    Try this.
    SQL> COMMENT ON TABLE EMP IS 'THIS IS SAMPLE EMPLOYEE TABLE' ;
    Comment created.
    SQL> select * from user_tab_comments where table_name = 'EMP'
      2  /
    TABLE_NAME                     TABLE_TYPE
    COMMENTS
    EMP                            TABLE
    THIS IS SAMPLE EMPLOYEE TABLE

  • How to disable cache for a particular Report in obiee 10g?

    HI
    My name is Rani .Learning obiee10g ifaced 1 interview in that they asked me like how u disable cache for a particular report?

    In the advanced tab of the report, under prefix you need to mention:
    SET VARIABLE DISABLE_CACHE_HIT=1;
    Refer below link
    http://tipsonobiee.blogspot.com/2009/06/step-by-step-to-bypass-all-caches.html
    Thanks

  • How do I search for a particular song on iTunes ?

    How do I search for a particular song on itunes - it used to be easy to go to search but that function seems to have disappeared

    The search function is still very much there, upper right corner of the iTunes Window.

  • How to load classes other than stub classes required for the stub classes

    Can any one pls tell me how to load supporting classes and interfaces for the stubs thru RMI? I am copying necessary stubs and policy file in the client class.
    one of the method of the class returns another supporting class. whenever i invoke this method ot says Class NotFoundException. I dont want to copy these supporitng classes into my client. They are deployment issues involved with this.
    HOW CAN I LOAD THE CLEINT CLASSES THRU RMI

    You should look at the documentation concerning CODEBASE. -Djava.rmi.server.codebase=
    It is too involved to explain it all here.

  • How to identify the maximum data loads done for a particular day?

    Hi all,
    There is huge volume of data been loaded on a last monday, and then data was deleted from the cubes on the same day. And hence i needs to see which are all the cubes which was loaded wtih lot of records for a particular day,
    i happened to look at rsmo, i am unable to see the ods nor the cube data loads,
    were do i seet it?
    Thanks

    See if the table RSSELDONE helps. This will give you the recent data load details. Based on those loads , you can search the targets.
    And also check table TBTCO  which will give the latest job details. You will have to analyze the same jobs to know what loads were done . Give a selection for date.

  • How to Find BADI for a particular FM

    Dear Abapers,
    How do I find a BADI for a Particular Function Module.
    I did google and found three methods but none helped.
    1) going to Transaction se37 to find your function module.  Locate the function SXV_GET_CLIF_BY_NAME.
    this doesnt help me because i dont want to find badi for a transaction.
    2) got se24 and put a break point in the method of class cl_exithandler. I tried this didnt help.
    3) taking the pacake name and going to se80 and enter it there, you see enhancements. I did this , found the package name of that FM which is WZRE. but there are lots of enhancements and badis. i cant find the related one with discription.
    my FM is IDOC_INPUT_SINGLSETTRQS_CREATE. I really need help to find the correct badi for this.
    any help is appreciated.
    thanks.

    Hi,
         To find a BADI for any enhancement follow these steps,
    1) Put a brak point in method CL_EXITHANDLER=>GET_INSTANCE. This will give you the EXIT_NAME and the implementing class name of the BADI.
    2) Remove IF_EX from the implementing class this provides you the BADI name.
    Regards
    Ram

  • How to load classes at ejb module deployment

    Hi,
    Can someone tell me how to loaded a class when I deploy an ear module (the class is in the ear) ?
    Thanks in advance.
    Fred.

    Hi Fred,
    Can you explain your question a bit more? Are you asking how to do
    dynamic class loading for your application or just how to package
    classes appropriately?
    --ken                                                                                                                                                                                                                                                                                                                                                               

  • Finding loaded Class file from particular Jar

    Hi,
    I have multiple jars containing same class file.
    How can I find out that the loaded Class file belongs to particular jar?
    Thanks
    madan

    In most cases it's possible with ProtectionDomain and CodeSource:ProtectionDomain pd = YourClass.class.getProtectionDomain();
    CodeSource cs = pd.getCodeSource();
    if (cs != null) {
        System.out.println("It came from " + cd.getLocation());
    } else {
        System.out.println("Location unknown.");
    }For further information see
    [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html#getProtectionDomain()]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html#getProtectionDomain()
    http://java.sun.com/j2se/1.4.2/docs/api/java/security/ProtectionDomain.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/security/CodeSource.html

  • How to include class files in no package?

    hi,
    I have a class file in a package called
    pack.Test
    and a class file not in a package called
    Library
    When I try to use Library from within pack.Test, it says theres no such class. I have my classpath setup correctly, and the files in the correct directories.
    ie. on windows if %DIR% is the base directory then
    %DIR%\Library.java
    %DIR%\pack\Test.java
    is how they are layed out.
    Is there a way to get Library imported to pack.Test?
    thanks,
    asjf

    What?!! It isn't considered legal to access a
    root-level class from a higher level package?Well it's not now because your code won't compile, but
    prior to 1.4 you could. I think the JLS has been
    updated to say you can't import from the unnamed
    namespace.Hmm! I must have missed that bit (not that I read it in any great detail, anyway!). I suppose it forces you to use packages, which is a good thing, IMHO.
    What I was wondering about was, is the directory structure of classes strictly necessary, given that a class contains information on its package anyway? I know some IDEs don't require the source files to be in the right directory - they will check on the package statement, and locate the class file accordingly - but is it absolutely necessary for class files to be located according to their directory structure? I know the JLS says they have to be, but could the JLS be relaxed on this point, without breaking anything?
    RObin

  • How to Load Classes in run time - Urgent

    Hi All,
    How to Load a class file from a .jar file in JDK1.1 with out using URLClassLoader. I have tried to extract the .jar file by file input stream and zipEntry classes and defineClass using the bytes i got from the stream , but the class loader fails to take the classes that are already loaded in the system.
    The customClassLoader that i created was not able to assign an object to the another reference variable that already in the JVM.Please i want to know how to assign or communicate between the objects of CustomclassLoader and SystemClassLoader?
    Please help me in this regard.
    Thanks in advance,

    Hi,
    The above code works in the straight way if the class is available in the classpath.
    I need to load a class by using custom class loader that i extends from classloader base class .
    I have to read a class file from a .jar file (in server) and load it in run time.Here i am able to read the bytes from the .jar file of the specified class file, but the class that i read extends some other class that is already loaded when i tried to create newInstance of the class i get Exceptions. Here the custom classLoader cannot find the loaded existing class in the JVM.can i get a solution for this situation

  • Loading classes for basic information on them.

    Hey guys,
    I'm creating a custom deployment application. Basically the developer will select all of the .class files he wants to roll out to production. They are put into a JList and then I go through them and place them in their appropriate packages to be rolled out at a future date.
    The problem arises when there is a .class file that is not in the right directory structure as the package it's supposed to be in.
    Translation:
    Example:
    the package the class is in com.test.MyPackage
    But the class siting on root of C:\
    What I'm hoping to accomplish is to load the class briefly enough into the JVM to get the package name of it and place it in the correct deployment directory. Remember i'm only dealing with .class files.
    I have thought of decompiling and searching for the package name in a regex but then I saw URLClassLoader and ClassLoader but have had a crazy time trying to get the class loaded at all.
    In Short: I won't know the package name of the file. I don't care where it's eing loaded from and I don't know where it's going to. I'm hoping I can load the class into the JVM, get the package name, and move the class to the correct package.
    Thanks for your help!
    Any thoughts on what I can do, even if it's totally different (programs that will do it for me, the RIGHT way I should be doing it, ETC), would be greatly appreciated.
    -Ryan

    If you are completely sure you can trust the classes not to do anything on load (and many do), you can load the class file into a byte array and pass that to a classloader to load the class, without knowing the package. But it is far safer to use a bytecode library, eg BCELimport org.apache.bcel.*;
    import org.apache.bcel.classfile.*;
    public class WhichPackage {
      public static void main (String[] args) {
        try {
          System.out.println(new ClassParser(args[0]).parse().getPackageName());
        } catch (Exception ex) {
          ex.printStackTrace(System.out);
    }Pete

Maybe you are looking for

  • How to reschedule a Back ground job in Normal ABAP from Web Dyn Pro abap application??

    Hi Experts, How to reschedule a Back ground job in Normal ABAP from Web Dyn Pro abap application??

  • Delivery the product from other plant directly

    hi we have 2 companies A, B. Company A receive order and give Company B to production, then Company B directly ship to customer. We are using deliviery plant for this scenario. However, sometimes the production will via Company A, then Company A deli

  • English characters are encode incorrectly

    export a english page to pdf in indesign cs3 chinese version, why a few english characters are encode incorrectly?

  • Kernel panic on Qemu

    I run 2008.6 iso/img on Qemu machine. It checks the virtual machine's disk and trun to panic. It says"Try to kill init process", and then the machine suspended. the usb img works fine in physical machine, but also cause kernel panic when i boot it un

  • X300 SSD question

    How do I find out what the brand and exact specs of my x300's solid state drive are. The only thing I know is that it's 64 GB. I'd like to replace the SSD with a bigger size SSD. For that I'd like to know its size and power restrictions and so on. Is