test/compiler/compilercontrol/share/method/MethodGenerator.java

Print this page
rev 9056 : [mq]: existing-directives


 107         md.aMethod.setSeparator(Separator.DOT);
 108         md.aSignature.setSeparator(Separator.NONE);
 109         return md;
 110     }
 111 
 112     /**
 113      * Compile command signature that looks like java.lang.String::indexOf
 114      *
 115      * @param executable executable used to generate descriptor
 116      * @return MethodDescriptor instance
 117      */
 118     public static MethodDescriptor logDescriptor(Executable executable) {
 119         MethodDescriptor md = new MethodDescriptor(executable);
 120         md.aClass.setSeparator(Separator.DOT);
 121         md.aMethod.setSeparator(Separator.DOUBLECOLON);
 122         md.aSignature.setSeparator(Separator.NONE);
 123         return md;
 124     }
 125 
 126     /**

















 127      * Generates a list of method patterns from the pool of methods
 128      *
 129      * @return a list of test cases
 130      */
 131     public List<MethodDescriptor> getTests() {
 132         List<MethodDescriptor> list = new ArrayList<>();
 133         METHODS.forEach(pair -> list.addAll(getTests(pair.first)));
 134         return list;
 135     }
 136 
 137     /**
 138      * Generates all combinations of method descriptors for a given executable
 139      *
 140      * @param executable executable for which the different combination is built
 141      * @return list of method descriptors
 142      */
 143     public List<MethodDescriptor> getTests(Executable executable) {
 144         List<MethodDescriptor> list = new ArrayList<>();
 145         for (Combination<PatternType> patterns : PATTERNS_LIST) {
 146             for (Combination<Separator> separators : SEPARATORS_LIST) {




 107         md.aMethod.setSeparator(Separator.DOT);
 108         md.aSignature.setSeparator(Separator.NONE);
 109         return md;
 110     }
 111 
 112     /**
 113      * Compile command signature that looks like java.lang.String::indexOf
 114      *
 115      * @param executable executable used to generate descriptor
 116      * @return MethodDescriptor instance
 117      */
 118     public static MethodDescriptor logDescriptor(Executable executable) {
 119         MethodDescriptor md = new MethodDescriptor(executable);
 120         md.aClass.setSeparator(Separator.DOT);
 121         md.aMethod.setSeparator(Separator.DOUBLECOLON);
 122         md.aSignature.setSeparator(Separator.NONE);
 123         return md;
 124     }
 125 
 126     /**
 127      * Method descriptor that matches any method. Its full signature is *.*
 128      *
 129      * @param executable executable used to generate descriptor
 130      * @return MethodDescriptor instance
 131      */
 132     public static MethodDescriptor anyMatchDescriptor(Executable executable) {
 133         MethodDescriptor md = new MethodDescriptor(executable);
 134         Combination<PatternType> patterns = new Combination<>(PatternType.ANY,
 135                 PatternType.ANY, PatternType.ANY);
 136         md.aClass.setSeparator(Separator.SLASH);
 137         md.aMethod.setSeparator(Separator.DOT);
 138         md.aSignature.setSeparator(Separator.NONE);
 139         md.setPatterns(patterns);
 140         return md;
 141     }
 142 
 143     /**
 144      * Generates a list of method patterns from the pool of methods
 145      *
 146      * @return a list of test cases
 147      */
 148     public List<MethodDescriptor> getTests() {
 149         List<MethodDescriptor> list = new ArrayList<>();
 150         METHODS.forEach(pair -> list.addAll(getTests(pair.first)));
 151         return list;
 152     }
 153 
 154     /**
 155      * Generates all combinations of method descriptors for a given executable
 156      *
 157      * @param executable executable for which the different combination is built
 158      * @return list of method descriptors
 159      */
 160     public List<MethodDescriptor> getTests(Executable executable) {
 161         List<MethodDescriptor> list = new ArrayList<>();
 162         for (Combination<PatternType> patterns : PATTERNS_LIST) {
 163             for (Combination<Separator> separators : SEPARATORS_LIST) {