diff --git a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/AnalyzerGuru.java b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/AnalyzerGuru.java index cbd1509aeb1..7394e7e291b 100644 --- a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/AnalyzerGuru.java +++ b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/AnalyzerGuru.java @@ -63,6 +63,7 @@ import org.opengrok.indexer.analysis.archive.GZIPAnalyzerFactory; import org.opengrok.indexer.analysis.archive.TarAnalyzerFactory; import org.opengrok.indexer.analysis.archive.ZipAnalyzerFactory; +import org.opengrok.indexer.analysis.asm.AsmAnalyzerFactory; import org.opengrok.indexer.analysis.c.CAnalyzerFactory; import org.opengrok.indexer.analysis.c.CxxAnalyzerFactory; import org.opengrok.indexer.analysis.clojure.ClojureAnalyzerFactory; @@ -241,6 +242,7 @@ public class AnalyzerGuru { private static final Map ANALYZER_VERSIONS = new HashMap<>(); private static final LangTreeMap langMap = new LangTreeMap(); + private static final LangTreeMap defaultLangMap = new LangTreeMap(); /* * If you write your own analyzer please register it here. The order is @@ -297,7 +299,8 @@ public class AnalyzerGuru { new RubyAnalyzerFactory(), new EiffelAnalyzerFactory(), new VerilogAnalyzerFactory(), - new TypeScriptAnalyzerFactory() + new TypeScriptAnalyzerFactory(), + new AsmAnalyzerFactory() }; for (AnalyzerFactory analyzer : analyzers) { @@ -331,7 +334,7 @@ public class AnalyzerGuru { * {@link FileAnalyzerFactory} subclasses are revised to target more or * different files. * @return a value whose lower 32-bits are a static value - * 20191006_00 + * 20191120_00 * for the current implementation and whose higher-32 bits are non-zero if * {@link #addExtension(java.lang.String, AnalyzerFactory)} * or @@ -339,7 +342,7 @@ public class AnalyzerGuru { * has been called. */ public static long getVersionNo() { - final int ver32 = 20191006_00; // Edit comment above too! + final int ver32 = 20191120_00; // Edit comment above too! long ver = ver32; if (customizationHashCode != 0) { ver |= (long) customizationHashCode << 32; @@ -418,6 +421,25 @@ private static void registerAnalyzer(AnalyzerFactory factory) { String fileTypeName = fa.getFileTypeName(); FILETYPE_FACTORIES.put(fileTypeName, factory); ANALYZER_VERSIONS.put(fileTypeName, fa.getVersionNo()); + + // Possibly configure default LANG mappings for the factory. + String ctagsLang = factory.getAnalyzer().getCtagsLang(); + if (ctagsLang != null) { + List prefixes = factory.getPrefixes(); + if (prefixes != null) { + for (String prefix : prefixes) { + defaultLangMap.add(prefix, ctagsLang); + } + } + + List suffixes = factory.getSuffixes(); + if (suffixes != null) { + for (String suffix : suffixes) { + // LangMap needs a "." to signify a file extension. + defaultLangMap.add("." + suffix, ctagsLang); + } + } + } } /** @@ -479,10 +501,11 @@ public static void addExtension(String extension, AnalyzerFactory factory) { /** * Gets an unmodifiable view of the language mappings resulting from * {@link #addExtension(String, AnalyzerFactory)} and - * {@link #addPrefix(String, AnalyzerFactory)}. + * {@link #addPrefix(String, AnalyzerFactory)} merged with default language + * mappings of OpenGrok's analyzers. */ public static LangMap getLangMap() { - return langMap.unmodifiable(); + return langMap.mergeSecondary(defaultLangMap).unmodifiable(); } /** diff --git a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Ctags.java b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Ctags.java index 6dcee3ef00e..c3fc2991b51 100644 --- a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Ctags.java +++ b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/Ctags.java @@ -61,7 +61,6 @@ public class Ctags implements Resettable { private final RuntimeEnvironment env; private volatile boolean closing; - private final LangTreeMap defaultLangMap = new LangTreeMap(); private LangMap langMap; private List command; private Process ctags; @@ -74,8 +73,13 @@ public class Ctags implements Resettable { private boolean junit_testing = false; + /** + * Initializes an instance with the current + * {@link AnalyzerGuru#getLangMap()}. + */ public Ctags() { env = RuntimeEnvironment.getInstance(); + langMap = AnalyzerGuru.getLangMap(); } /** @@ -144,6 +148,11 @@ public List getArgv() { } private void initialize() { + /* + * Call the following principally to properly initialize when running + * JUnit tests. opengrok-indexer and opengrok-web call it too but + * validating its return code and logging (and possibly aborting). + */ env.validateUniversalCtags(); command = new ArrayList<>(); @@ -166,15 +175,6 @@ private void initialize() { command.add("--fields=-anf+iKnS"); command.add("--excmd=pattern"); - defaultLangMap.clear(); - defaultLangMap.add(".KSHLIB", "sh"); // RFE #17849. Upper-case file spec - defaultLangMap.add(".PLB", "sql"); // RFE #19208. Upper-case file spec - defaultLangMap.add(".PLS", "sql"); // RFE #19208. Upper-case file spec - defaultLangMap.add(".PLD", "sql"); // RFE #19208. Upper-case file spec - defaultLangMap.add(".PKS", "sql"); // RFE #19208 ? Upper-case file spec - defaultLangMap.add(".PKB", "sql"); // # 1763. Upper-case file spec - defaultLangMap.add(".PCK", "sql"); // # 1763. Upper-case file spec - //Ideally all below should be in ctags, or in outside config file, //we might run out of command line SOON //Also note, that below ctags definitions HAVE to be in POSIX @@ -200,10 +200,10 @@ private void initialize() { //PLEASE add new languages ONLY with POSIX syntax (see above wiki link) - if (langMap != null) { - command.addAll(langMap.mergeSecondary(defaultLangMap).getCtagsArgs()); + if (langMap == null) { + LOGGER.warning("langMap property is null"); } else { - command.addAll(defaultLangMap.getCtagsArgs()); + command.addAll(langMap.getCtagsArgs()); } /* Add extra command line options for ctags. */ @@ -254,7 +254,6 @@ private void addRustSupport(List command) { if (!env.getCtagsLanguages().contains("Rust")) { // Built-in would be capitalized. command.add("--langdef=rust"); // Lower-case if user-defined. } - defaultLangMap.add(".RS", "rust"); // Upper-case file spec // The following are not supported yet in Universal Ctags b13cb551 command.add("--regex-rust=/^[[:space:]]*(pub[[:space:]]+)?(static|const)[[:space:]]+(mut[[:space:]]+)?" + @@ -270,8 +269,6 @@ private void addPowerShellSupport(List command) { if (!env.getCtagsLanguages().contains("PowerShell")) { // Built-in would be capitalized. command.add("--langdef=powershell"); // Lower-case if user-defined. } - defaultLangMap.add(".PS1", "powershell"); // Upper-case file spec - defaultLangMap.add(".PSM1", "powershell"); // Upper-case file spec command.add("--regex-powershell=/\\$(\\{[^}]+\\})/\\1/v,variable/"); command.add("--regex-powershell=/\\$([[:alnum:]_]+([:.][[:alnum:]_]+)*)/\\1/v,variable/"); @@ -292,7 +289,6 @@ private void addPascalSupport(List command) { if (!env.getCtagsLanguages().contains("Pascal")) { // Built-in would be capitalized. command.add("--langdef=pascal"); // Lower-case if user-defined. } - defaultLangMap.add(".PAS", "pascal"); // Upper-case file spec command.add("--regex-pascal=/([[:alnum:]_]+)[[:space:]]*=[[:space:]]*\\([[:space:]]*[[:alnum:]_][[:space:]]*\\)/\\1/t,Type/"); command.add("--regex-pascal=/([[:alnum:]_]+)[[:space:]]*=[[:space:]]*class[[:space:]]*[^;]*$/\\1/c,Class/"); @@ -310,7 +306,7 @@ private void addSwiftSupport(List command) { if (!env.getCtagsLanguages().contains("Swift")) { // Built-in would be capitalized. command.add("--langdef=swift"); // Lower-case if user-defined. } - defaultLangMap.add(".SWIFT", "swift"); // Upper-case file spec + command.add("--regex-swift=/enum[[:space:]]+([^\\{\\}]+).*$/\\1/n,enum,enums/"); command.add("--regex-swift=/typealias[[:space:]]+([^:=]+).*$/\\1/t,typealias,typealiases/"); command.add("--regex-swift=/protocol[[:space:]]+([^:\\{]+).*$/\\1/p,protocol,protocols/"); @@ -325,8 +321,6 @@ private void addKotlinSupport(List command) { if (!env.getCtagsLanguages().contains("Kotlin")) { // Built-in would be capitalized. command.add("--langdef=kotlin"); // Lower-case if user-defined. } - defaultLangMap.add(".KT", "kotlin"); // Upper-case file spec - defaultLangMap.add(".KTS", "kotlin"); // Upper-case file spec command.add("--regex-kotlin=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*" + "(private[^ ]*|protected)?[[:space:]]*class[[:space:]]+([[:alnum:]_:]+)/\\4/c,classes/"); @@ -355,9 +349,6 @@ private void addClojureSupport(List command) { if (!env.getCtagsLanguages().contains("Clojure")) { // Built-in would be capitalized. command.add("--langdef=clojure"); // Lower-case if user-defined. } - defaultLangMap.add(".CLJ", "clojure"); // Upper-case file spec - defaultLangMap.add(".CLJS", "clojure"); // Upper-case file spec - defaultLangMap.add(".CLJX", "clojure"); // Upper-case file spec command.add("--regex-clojure=/\\([[:space:]]*create-ns[[:space:]]+([-[:alnum:]*+!_:\\/.?]+)/\\1/n,namespace/"); command.add("--regex-clojure=/\\([[:space:]]*def[[:space:]]+([-[:alnum:]*+!_:\\/.?]+)/\\1/d,definition/"); @@ -375,8 +366,6 @@ private void addHaskellSupport(List command) { if (!env.getCtagsLanguages().contains("Haskell")) { // Built-in would be capitalized. command.add("--langdef=haskell"); // below added with #912. Lowercase if user-defined. } - defaultLangMap.add(".HS", "haskell"); // Upper-case file spec - defaultLangMap.add(".HSC", "haskell"); // Upper-case file spec command.add("--regex-haskell=/^[[:space:]]*class[[:space:]]+([a-zA-Z0-9_]+)/\\1/c,classes/"); command.add("--regex-haskell=/^[[:space:]]*data[[:space:]]+([a-zA-Z0-9_]+)/\\1/t,types/"); @@ -392,7 +381,6 @@ private void addScalaSupport(List command) { if (!env.getCtagsLanguages().contains("Scala")) { // Built-in would be capitalized. command.add("--langdef=scala"); // below is bug 61 to get full scala support. Lower-case } - defaultLangMap.add(".SCALA", "scala"); // Upper-case file spec command.add("--regex-scala=/^[[:space:]]*((abstract|final|sealed|implicit|lazy)[[:space:]]*)*" + "(private|protected)?[[:space:]]*class[[:space:]]+([a-zA-Z0-9_]+)/\\4/c,classes/"); diff --git a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/AsmAnalyzer.java b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/AsmAnalyzer.java new file mode 100644 index 00000000000..b828f41858e --- /dev/null +++ b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/AsmAnalyzer.java @@ -0,0 +1,74 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * See LICENSE.txt included in this distribution for the specific + * language governing permissions and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at LICENSE.txt. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2017-2019, Chris Fraire . + */ + +package org.opengrok.indexer.analysis.asm; + +import org.opengrok.indexer.analysis.AbstractAnalyzer; +import org.opengrok.indexer.analysis.AnalyzerFactory; +import org.opengrok.indexer.analysis.JFlexTokenizer; +import org.opengrok.indexer.analysis.JFlexXref; +import org.opengrok.indexer.analysis.plain.AbstractSourceCodeAnalyzer; + +import java.io.Reader; + +/** + * Represents an analyzer for assembly language. + */ +public class AsmAnalyzer extends AbstractSourceCodeAnalyzer { + + /** + * Creates a new instance of {@link AsmAnalyzer}. + * @param factory instance + */ + protected AsmAnalyzer(AnalyzerFactory factory) { + super(factory, new JFlexTokenizer(new AsmSymbolTokenizer(AbstractAnalyzer.DUMMY_READER))); + } + + /** + * @return {@code "Asm"} + */ + @Override + public String getCtagsLang() { + return "Asm"; + } + + /** + * Gets a version number to be used to tag processed documents so that + * re-analysis can be re-done later if a stored version number is different + * from the current implementation. + * @return 20191120_00 + */ + @Override + protected int getSpecializedVersionNo() { + return 20191120_00; // Edit comment above too! + } + + /** + * Creates a wrapped {@link AsmXref} instance. + * @return a defined instance + */ + @Override + protected JFlexXref newXref(Reader reader) { + return new JFlexXref(new AsmXref(reader)); + } +} diff --git a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/AsmAnalyzerFactory.java b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/AsmAnalyzerFactory.java new file mode 100644 index 00000000000..85eaaeea784 --- /dev/null +++ b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/AsmAnalyzerFactory.java @@ -0,0 +1,54 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * See LICENSE.txt included in this distribution for the specific + * language governing permissions and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at LICENSE.txt. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2017, 2019, Chris Fraire . + */ + +package org.opengrok.indexer.analysis.asm; + +import org.opengrok.indexer.analysis.AbstractAnalyzer; +import org.opengrok.indexer.analysis.FileAnalyzerFactory; + +/** + * Represents a factory to create {@link AsmAnalyzer} instances. + */ +public class AsmAnalyzerFactory extends FileAnalyzerFactory { + + private static final String NAME = "Asm"; + + private static final String[] SUFFIXES = {"ASM", "S"}; + + /** + * Initializes a factory instance to associate file extensions ".asm" and + * ".s" with {@link AsmAnalyzer}. + */ + public AsmAnalyzerFactory() { + super(null, null, SUFFIXES, null, null, "text/plain", AbstractAnalyzer.Genre.PLAIN, NAME); + } + + /** + * Creates a new {@link AsmAnalyzer} instance. + * @return a defined instance + */ + @Override + protected AbstractAnalyzer newAnalyzer() { + return new AsmAnalyzer(this); + } +} diff --git a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/Consts.java b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/Consts.java new file mode 100644 index 00000000000..c5d7ae2fb97 --- /dev/null +++ b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/asm/Consts.java @@ -0,0 +1,95 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * See LICENSE.txt included in this distribution for the specific + * language governing permissions and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at LICENSE.txt. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2005, 2018 Oracle and/or its affiliates. All rights reserved. + */ +package org.opengrok.indexer.analysis.asm; + +import java.util.HashSet; +import java.util.Set; + +/** + * Holds static hash set containing the C keywords (copying for use by Asm for + * now). + */ +public class Consts { + + public static final Set kwd = new HashSet<>(); + + static { + // CPP + kwd.add("ident"); + kwd.add("ifndef"); + kwd.add("defined"); + kwd.add("endif"); + kwd.add("include"); + kwd.add("define"); + kwd.add("ifdef"); + kwd.add("pragma"); + + // C keywords + kwd.add("asm"); + kwd.add("auto"); + kwd.add("break"); + kwd.add("case"); + kwd.add("char"); + kwd.add("const"); + kwd.add("continue"); + kwd.add("default"); + kwd.add("do"); + kwd.add("double"); + kwd.add("else"); + kwd.add("enum"); + kwd.add("extern"); + kwd.add("float"); + kwd.add("for"); + kwd.add("goto"); + kwd.add("if"); + kwd.add("inline"); + kwd.add("int"); + kwd.add("long"); + kwd.add("register"); + kwd.add("restrict"); + kwd.add("return"); + kwd.add("short"); + kwd.add("signed"); + kwd.add("sizeof"); + kwd.add("static"); + kwd.add("struct"); + kwd.add("switch"); + kwd.add("typedef"); + kwd.add("union"); + kwd.add("unsigned"); + kwd.add("void"); + kwd.add("volatile"); + kwd.add("while"); + kwd.add("_Bool"); + kwd.add("_Complex"); + kwd.add("_Imaginary"); + // other keywords + kwd.add("bool"); + kwd.add("true"); + kwd.add("false"); + kwd.add("redeclared"); + } + + private Consts() { + } +} diff --git a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/c/CAnalyzerFactory.java b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/c/CAnalyzerFactory.java index be02371106a..6bcdba4a33e 100644 --- a/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/c/CAnalyzerFactory.java +++ b/opengrok-indexer/src/main/java/org/opengrok/indexer/analysis/c/CAnalyzerFactory.java @@ -19,6 +19,7 @@ /* * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2019, Chris Fraire . */ package org.opengrok.indexer.analysis.c; @@ -39,7 +40,6 @@ public class CAnalyzerFactory extends FileAnalyzerFactory { "LEX", "YACC", "D", - "S", "XS", // Mainly found in perl directories "X", // rpcgen input files }; diff --git a/opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java b/opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java index 12f7099c0a5..aefe8223b5c 100644 --- a/opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java +++ b/opengrok-indexer/src/main/java/org/opengrok/indexer/index/Indexer.java @@ -1130,11 +1130,7 @@ private static String getCtagsCommand() { result.append("\t"); } String arg = argv.get(i); - if (arg == null) { - result.append("UNDEFINED"); - } else { - result.append(maybeEscapeForSh(arg)); - } + result.append(maybeEscapeForSh(arg)); if (i + 1 < argv.size()) { result.append(" \\"); } diff --git a/opengrok-indexer/src/main/resources/analysis/asm/AsmSymbolTokenizer.lex b/opengrok-indexer/src/main/resources/analysis/asm/AsmSymbolTokenizer.lex new file mode 100644 index 00000000000..48515afd21a --- /dev/null +++ b/opengrok-indexer/src/main/resources/analysis/asm/AsmSymbolTokenizer.lex @@ -0,0 +1,90 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * See LICENSE.txt included in this distribution for the specific + * language governing permissions and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at LICENSE.txt. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2017, Chris Fraire . + */ + +/* + * Gets C symbols - ignores comments, strings, keywords (copying for use by Asm + * for now). + */ + +package org.opengrok.indexer.analysis.asm; + +import org.opengrok.indexer.analysis.JFlexSymbolMatcher; +%% +%public +%class AsmSymbolTokenizer +%extends JFlexSymbolMatcher +%unicode +%init{ + yyline = 1; +%init} +%int +%include CommonLexer.lexh +%char + +%state STRING COMMENT SCOMMENT QSTRING + +%include Common.lexh +%include C.lexh +%% + + { +{Identifier} {String id = yytext(); + if(!Consts.kwd.contains(id)) { + onSymbolMatched(id, yychar); + return yystate(); } + } + +"#" {WhspChar}* "include" {WhspChar}* ("<"[^>\n\r]+">" | \"[^\"\n\r]+\") {} + +{Number} {} + + \\\" | \\\' {} + \" { yybegin(STRING); } + \' { yybegin(QSTRING); } + "/*" { yybegin(COMMENT); } + "//" { yybegin(SCOMMENT); } +} + + { + \\[\"\\] {} + \" { yybegin(YYINITIAL); } +} + + { + \\[\'\\] {} + \' { yybegin(YYINITIAL); } +} + + { +"*/" { yybegin(YYINITIAL);} +} + + { +{EOL} { yybegin(YYINITIAL); } +} + + { +{WhspChar}+ {} +[^] {} +} diff --git a/opengrok-indexer/src/main/resources/analysis/asm/AsmXref.lex b/opengrok-indexer/src/main/resources/analysis/asm/AsmXref.lex new file mode 100644 index 00000000000..de6a327b9b2 --- /dev/null +++ b/opengrok-indexer/src/main/resources/analysis/asm/AsmXref.lex @@ -0,0 +1,220 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * See LICENSE.txt included in this distribution for the specific + * language governing permissions and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at LICENSE.txt. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2017, Chris Fraire . + */ + +/* + * Cross reference a C file (copying for use by Asm for now). + */ + +package org.opengrok.indexer.analysis.asm; + +import java.io.IOException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.opengrok.indexer.analysis.JFlexSymbolMatcher; +import org.opengrok.indexer.analysis.ScopeAction; +import org.opengrok.indexer.util.StringUtils; +import org.opengrok.indexer.web.HtmlConsts; +%% +%public +%class AsmXref +%extends JFlexSymbolMatcher +%unicode +%int +%char +%init{ + yyline = 1; +%init} +%include CommonLexer.lexh +%include CommonXref.lexh +%{ + private static final Pattern MATCH_INCLUDE = Pattern.compile( + "^(#.*)(include)(.*)([<\"])(.*)([>\"])$"); + private static final int INCL_HASH_G = 1; + private static final int INCLUDE_G = 2; + private static final int INCL_POST_G = 3; + private static final int INCL_PUNC0_G = 4; + private static final int INCL_PATH_G = 5; + private static final int INCL_PUNCZ_G = 6; + + @Override + public void yypop() throws IOException { + onDisjointSpanChanged(null, yychar); + super.yypop(); + } + + protected void chkLOC() { + switch (yystate()) { + case COMMENT: + case SCOMMENT: + break; + default: + phLOC(); + break; + } + } +%} + +File = [a-zA-Z]{FNameChar}* "." ([cChHsStT] | [Cc][Oo][Nn][Ff] | + [Jj][Aa][Vv][Aa] | [CcHh][Pp][Pp] | [Cc][Cc] | [Tt][Xx][Tt] | + [Hh][Tt][Mm][Ll]? | [Pp][Ll] | [Xx][Mm][Ll] | [CcHh][\+][\+] | [Hh][Hh] | + [CcHh][Xx][Xx] | [Dd][Ii][Ff][Ff] | [Pp][Aa][Tt][Cc][Hh]) + +%state STRING COMMENT SCOMMENT QSTRING + +%include Common.lexh +%include CommonURI.lexh +%include CommonPath.lexh +%include C.lexh +%% +{ + \{ { chkLOC(); onScopeChanged(ScopeAction.INC, yytext(), yychar); } + \} { chkLOC(); onScopeChanged(ScopeAction.DEC, yytext(), yychar); } + \; { chkLOC(); onScopeChanged(ScopeAction.END, yytext(), yychar); } + +{Identifier} { + chkLOC(); + String id = yytext(); + onFilteredSymbolMatched(id, yychar, Consts.kwd); +} + +"#" {WhspChar}* "include" {WhspChar}* ("<"[^>\n\r]+">" | \"[^\"\n\r]+\") { + chkLOC(); + String capture = yytext(); + Matcher match = MATCH_INCLUDE.matcher(capture); + if (match.matches()) { + onNonSymbolMatched(match.group(INCL_HASH_G), yychar); + onFilteredSymbolMatched(match.group(INCLUDE_G), yychar, Consts.kwd); + onNonSymbolMatched(match.group(INCL_POST_G), yychar); + onNonSymbolMatched(match.group(INCL_PUNC0_G), yychar); + String path = match.group(INCL_PATH_G); + onPathlikeMatched(path, '/', false, yychar); + onNonSymbolMatched(match.group(INCL_PUNCZ_G), yychar); + } else { + onNonSymbolMatched(capture, yychar); + } +} + +/*{Hier} + { onPathlikeMatched(yytext(), '.', false, yychar); } +*/ +{Number} { + chkLOC(); + onDisjointSpanChanged(HtmlConsts.NUMBER_CLASS, yychar); + onNonSymbolMatched(yytext(), yychar); + onDisjointSpanChanged(null, yychar); + } + + \\[\"\'] { chkLOC(); onNonSymbolMatched(yytext(), yychar); } + \" { + chkLOC(); + yypush(STRING); + onDisjointSpanChanged(HtmlConsts.STRING_CLASS, yychar); + onNonSymbolMatched(yytext(), yychar); + } + \' { + chkLOC(); + yypush(QSTRING); + onDisjointSpanChanged(HtmlConsts.STRING_CLASS, yychar); + onNonSymbolMatched(yytext(), yychar); + } + "/*" { + yypush(COMMENT); + onDisjointSpanChanged(HtmlConsts.COMMENT_CLASS, yychar); + onNonSymbolMatched(yytext(), yychar); + } + "//" { + yypush(SCOMMENT); + onDisjointSpanChanged(HtmlConsts.COMMENT_CLASS, yychar); + onNonSymbolMatched(yytext(), yychar); + } +} + + { + \\[\"\\] | + \" {WhspChar}+ \" { chkLOC(); onNonSymbolMatched(yytext(), yychar); } + \" { chkLOC(); onNonSymbolMatched(yytext(), yychar); yypop(); } +} + + { + \\[\'\\] | + \' {WhspChar}+ \' { chkLOC(); onNonSymbolMatched(yytext(), yychar); } + \' { chkLOC(); onNonSymbolMatched(yytext(), yychar); yypop(); } +} + + { +"*/" { onNonSymbolMatched(yytext(), yychar); yypop(); } +} + + { +{WhspChar}*{EOL} { + yypop(); + onEndOfLineMatched(yytext(), yychar);} +} + + + { +{WhspChar}*{EOL} { onEndOfLineMatched(yytext(), yychar); } + [[\s]--[\n]] { onNonSymbolMatched(yytext(), yychar); } + [^\n] { chkLOC(); onNonSymbolMatched(yytext(), yychar); } +} + + { + {FPath} { + chkLOC(); + onPathlikeMatched(yytext(), '/', false, yychar); + } + +{File} + { + chkLOC(); + String path = yytext(); + onFilelikeMatched(path, yychar); + } + +{FNameChar}+ "@" {FNameChar}+ "." {FNameChar}+ + { + chkLOC(); + onEmailAddressMatched(yytext(), yychar); + } +} + + { + {BrowseableURI} { + chkLOC(); + onUriMatched(yytext(), yychar); + } +} + + { + {BrowseableURI} { + onUriMatched(yytext(), yychar, StringUtils.END_C_COMMENT); + } +} + + { + {BrowseableURI} { + chkLOC(); + onUriMatched(yytext(), yychar, StringUtils.APOS_NO_BSESC); + } +} diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/CtagsTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/CtagsTest.java index 3658879e4d7..f302fc67918 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/CtagsTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/CtagsTest.java @@ -29,26 +29,18 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.util.TestRepository; /** * * @author Lubos Kosco */ -@ConditionalRun(CtagsInstalled.class) public class CtagsTest { private static Ctags ctags; private static TestRepository repository; - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - @BeforeClass public static void setUpClass() throws Exception { ctags = new Ctags(); diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/JFlexXrefTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/JFlexXrefTest.java index aed4761b69e..5f891ff89fd 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/JFlexXrefTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/JFlexXrefTest.java @@ -39,7 +39,6 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; import org.opengrok.indexer.analysis.c.CXref; import org.opengrok.indexer.analysis.c.CxxXref; @@ -58,9 +57,7 @@ import org.opengrok.indexer.analysis.sql.SQLXref; import org.opengrok.indexer.analysis.tcl.TclXref; import org.opengrok.indexer.analysis.uue.UuencodeXref; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; + import static org.opengrok.indexer.util.CustomAssertions.assertLinesEqual; import org.opengrok.indexer.util.TestRepository; import org.xml.sax.InputSource; @@ -73,9 +70,6 @@ public class JFlexXrefTest { private static Ctags ctags; private static TestRepository repository; - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - /** * This is what we expect to find at the beginning of the first line * returned by an xref. @@ -165,7 +159,6 @@ private void bug15890LineCount(JFlexNonXref xref) throws Exception { * used to cause trouble. */ @Test - @ConditionalRun(CtagsInstalled.class) public void testBug15890Anchor() throws Exception { bug15890Anchor(CXref.class, "c/bug15890.c"); bug15890Anchor(CxxXref.class, "c/bug15890.c"); @@ -383,7 +376,6 @@ public void testEmptyJavaComment() throws IOException { } @Test - @ConditionalRun(CtagsInstalled.class) public void bug18586() throws IOException, InterruptedException { String filename = repository.getSourceRoot() + "/sql/bug18586.sql"; Reader in = new InputStreamReader(new FileInputStream(filename), "UTF-8"); @@ -398,7 +390,6 @@ public void bug18586() throws IOException, InterruptedException { * This originally became a problem after upgrade to JFlex 1.5.0. */ @Test - @ConditionalRun(CtagsInstalled.class) public void unterminatedHeredoc() throws IOException { JFlexXref xref = new JFlexXref(new ShXref(new StringReader( "cat << EOF\nunterminated heredoc"))); diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/c/CAnalyzerFactoryTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/c/CAnalyzerFactoryTest.java index bcb58364374..32d1ea44067 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/c/CAnalyzerFactoryTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/c/CAnalyzerFactoryTest.java @@ -40,16 +40,12 @@ import org.apache.lucene.index.IndexableField; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; import org.opengrok.indexer.analysis.AbstractAnalyzer; import org.opengrok.indexer.analysis.Ctags; import org.opengrok.indexer.analysis.Scopes; import org.opengrok.indexer.analysis.Scopes.Scope; import org.opengrok.indexer.analysis.StreamSource; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.search.QueryBuilder; import org.opengrok.indexer.util.TestRepository; @@ -58,16 +54,12 @@ * * @author Tomas Kotal */ -@ConditionalRun(CtagsInstalled.class) public class CAnalyzerFactoryTest { private static Ctags ctags; private static TestRepository repository; private static AbstractAnalyzer analyzer; - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - private static StreamSource getStreamSource(final String fname) { return new StreamSource() { @Override diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/c/CxxAnalyzerFactoryTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/c/CxxAnalyzerFactoryTest.java index 1bc0d064fda..365209353bb 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/c/CxxAnalyzerFactoryTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/c/CxxAnalyzerFactoryTest.java @@ -40,16 +40,12 @@ import org.apache.lucene.index.IndexableField; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; import org.opengrok.indexer.analysis.AbstractAnalyzer; import org.opengrok.indexer.analysis.Ctags; import org.opengrok.indexer.analysis.Scopes; import org.opengrok.indexer.analysis.Scopes.Scope; import org.opengrok.indexer.analysis.StreamSource; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.search.QueryBuilder; import org.opengrok.indexer.util.TestRepository; @@ -58,16 +54,12 @@ * * @author Tomas Kotal */ -@ConditionalRun(CtagsInstalled.class) public class CxxAnalyzerFactoryTest { private static Ctags ctags; private static TestRepository repository; private static AbstractAnalyzer analyzer; - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - private static StreamSource getStreamSource(final String fname) { return new StreamSource() { @Override diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/clojure/ClojureAnalyzerFactoryTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/clojure/ClojureAnalyzerFactoryTest.java index 1cef069e834..8852f0dca37 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/clojure/ClojureAnalyzerFactoryTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/clojure/ClojureAnalyzerFactoryTest.java @@ -27,15 +27,11 @@ import org.apache.lucene.document.Field; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; import org.opengrok.indexer.analysis.AbstractAnalyzer; import org.opengrok.indexer.analysis.Ctags; import org.opengrok.indexer.analysis.Definitions; import org.opengrok.indexer.analysis.StreamSource; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.search.QueryBuilder; import org.opengrok.indexer.util.TestRepository; @@ -55,16 +51,12 @@ /** * @author Farid Zakaria */ -@ConditionalRun(CtagsInstalled.class) public class ClojureAnalyzerFactoryTest { private static Ctags ctags; private static TestRepository repository; private static AbstractAnalyzer analyzer; - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - private static StreamSource getStreamSource(final String fname) { return new StreamSource() { @Override diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/csharp/CSharpAnalyzerFactoryTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/csharp/CSharpAnalyzerFactoryTest.java index 52a692d1604..8b2a6b0ecd5 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/csharp/CSharpAnalyzerFactoryTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/csharp/CSharpAnalyzerFactoryTest.java @@ -33,7 +33,6 @@ import org.apache.lucene.document.Field; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; import static org.junit.Assert.*; import static org.opengrok.indexer.analysis.AnalyzerGuru.string_ft_nstored_nanalyzed_norms; @@ -43,9 +42,6 @@ import org.opengrok.indexer.analysis.Scopes; import org.opengrok.indexer.analysis.Scopes.Scope; import org.opengrok.indexer.analysis.StreamSource; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.search.QueryBuilder; import org.opengrok.indexer.util.TestRepository; @@ -54,16 +50,12 @@ * * @author Tomas Kotal */ -@ConditionalRun(CtagsInstalled.class) public class CSharpAnalyzerFactoryTest { private static Ctags ctags; private static TestRepository repository; private static AbstractAnalyzer analyzer; - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - private static StreamSource getStreamSource(final String fname) { return new StreamSource() { @Override diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/executables/JarAnalyzerTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/executables/JarAnalyzerTest.java index ef1a05db9ab..06798997b05 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/executables/JarAnalyzerTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/executables/JarAnalyzerTest.java @@ -19,24 +19,19 @@ /* * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2018, Chris Fraire . + * Portions Copyright (c) 2018-2019, Chris Fraire . */ package org.opengrok.indexer.analysis.executables; import java.io.File; -import java.util.ArrayList; import java.util.Collections; import java.util.TreeSet; import org.junit.AfterClass; import static org.junit.Assert.assertTrue; import org.junit.BeforeClass; -import org.junit.ClassRule; import org.junit.Test; import org.opengrok.indexer.authorization.AuthorizationFrameworkReloadTest; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.index.Indexer; import org.opengrok.indexer.util.TestRepository; @@ -51,7 +46,6 @@ *

* Derived from Trond Norbye's {@code SearchEngineTest} */ -@ConditionalRun(CtagsInstalled.class) public class JarAnalyzerTest { private static final String TESTPLUGINS_JAR = "testplugins.jar"; @@ -61,9 +55,6 @@ public class JarAnalyzerTest { private static File configFile; private static boolean originalProjectsEnabled; - @ClassRule - public static ConditionalRunRule rule = new ConditionalRunRule(); - @BeforeClass public static void setUpClass() throws Exception { env = RuntimeEnvironment.getInstance(); diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/java/JavaAnalyzerFactoryTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/java/JavaAnalyzerFactoryTest.java index a89d677a6e6..be100a8739e 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/java/JavaAnalyzerFactoryTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/java/JavaAnalyzerFactoryTest.java @@ -40,16 +40,12 @@ import org.apache.lucene.index.IndexableField; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; import org.opengrok.indexer.analysis.AbstractAnalyzer; import org.opengrok.indexer.analysis.Ctags; import org.opengrok.indexer.analysis.Scopes; import org.opengrok.indexer.analysis.Scopes.Scope; import org.opengrok.indexer.analysis.StreamSource; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.search.QueryBuilder; import org.opengrok.indexer.util.TestRepository; @@ -58,16 +54,12 @@ * * @author Tomas Kotal */ -@ConditionalRun(CtagsInstalled.class) public class JavaAnalyzerFactoryTest { private static Ctags ctags; private static TestRepository repository; private static AbstractAnalyzer analyzer; - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - private static StreamSource getStreamSource(final String fname) { return new StreamSource() { @Override diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/pascal/PascalAnalyzerFactoryTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/pascal/PascalAnalyzerFactoryTest.java index a041e084a3b..6021442d69c 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/pascal/PascalAnalyzerFactoryTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/analysis/pascal/PascalAnalyzerFactoryTest.java @@ -37,7 +37,6 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; import static org.opengrok.indexer.analysis.AnalyzerGuru.string_ft_nstored_nanalyzed_norms; @@ -45,9 +44,6 @@ import org.opengrok.indexer.analysis.Ctags; import org.opengrok.indexer.analysis.Definitions; import org.opengrok.indexer.analysis.StreamSource; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.search.QueryBuilder; import org.opengrok.indexer.util.TestRepository; @@ -56,16 +52,12 @@ * * @author alexanthony */ -@ConditionalRun(CtagsInstalled.class) public class PascalAnalyzerFactoryTest { private static Ctags ctags; private static TestRepository repository; private static AbstractAnalyzer analyzer; - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - private static StreamSource getStreamSource(final String fname) { return new StreamSource() { @Override diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/condition/CtagsInstalled.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/condition/CtagsInstalled.java deleted file mode 100644 index cb90a71f185..00000000000 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/condition/CtagsInstalled.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * See LICENSE.txt included in this distribution for the specific - * language governing permissions and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at LICENSE.txt. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. - */ -package org.opengrok.indexer.condition; - -import org.opengrok.indexer.configuration.RuntimeEnvironment; - -public class CtagsInstalled implements RunCondition { - - @Override - public boolean isSatisfied() { - return RuntimeEnvironment.getInstance().validateUniversalCtags(); - } - -} diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseSymlinksTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseSymlinksTest.java index f40899d5f9a..00db437c5c7 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseSymlinksTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseSymlinksTest.java @@ -38,7 +38,6 @@ import org.junit.runner.Description; import org.opengrok.indexer.condition.ConditionalRun; import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.condition.RepositoryInstalled; import org.opengrok.indexer.condition.UnixPresent; import org.opengrok.indexer.configuration.RuntimeEnvironment; @@ -59,7 +58,6 @@ * Represents a container for additional tests of {@link IndexDatabase} for symlinks. */ @ConditionalRun(UnixPresent.class) -@ConditionalRun(CtagsInstalled.class) @ConditionalRun(RepositoryInstalled.GitInstalled.class) @ConditionalRun(RepositoryInstalled.MercurialInstalled.class) public class IndexDatabaseSymlinksTest { diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java index 19189f1c735..263cdc303fc 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java @@ -19,13 +19,12 @@ /* * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2018, Chris Fraire . + * Portions Copyright (c) 2018-2019, Chris Fraire . */ package org.opengrok.indexer.index; import java.io.File; import java.io.IOException; -import java.util.ArrayList; import java.util.Arrays; import java.util.TreeSet; @@ -34,16 +33,12 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; -import org.junit.ClassRule; import org.junit.Test; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import org.opengrok.indexer.analysis.Definitions; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.Project; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.history.HistoryGuru; @@ -56,14 +51,10 @@ /** * Unit tests for the {@code IndexDatabase} class. */ -@ConditionalRun(CtagsInstalled.class) public class IndexDatabaseTest { private static TestRepository repository; - @ClassRule - public static ConditionalRunRule rule = new ConditionalRunRule(); - @BeforeClass public static void setUpClass() throws Exception { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexVersionTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexVersionTest.java index 9da60e95827..311df92c785 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexVersionTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexVersionTest.java @@ -19,6 +19,7 @@ /* * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2019, Chris Fraire . */ package org.opengrok.indexer.index; @@ -35,12 +36,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; -import org.opengrok.indexer.configuration.Configuration; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.history.RepositoryFactory; import org.opengrok.indexer.util.FileUtilities; @@ -54,9 +50,6 @@ */ public class IndexVersionTest { - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - private TestRepository repository; private RuntimeEnvironment env = RuntimeEnvironment.getInstance(); private Path oldIndexDataDir; @@ -85,7 +78,6 @@ public void tearDown() throws IOException { /** * Generate index(es) and check version. - * @throws Exception */ private void testIndexVersion(boolean projectsEnabled, List subFiles) throws Exception { env.setHistoryEnabled(false); @@ -103,19 +95,16 @@ public void testIndexVersionNoIndex() throws Exception { } @Test - @ConditionalRun(CtagsInstalled.class) public void testIndexVersionProjects() throws Exception { testIndexVersion(true, new ArrayList<>()); } @Test - @ConditionalRun(CtagsInstalled.class) public void testIndexVersionSelectedProjects() throws Exception { testIndexVersion(true, Arrays.asList(new String[]{ "mercurial", "git" })); } @Test - @ConditionalRun(CtagsInstalled.class) public void testIndexVersionNoProjects() throws Exception { testIndexVersion(false, new ArrayList<>()); } diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerRepoTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerRepoTest.java index 876bc19858c..d2a704ef06a 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerRepoTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerRepoTest.java @@ -19,7 +19,7 @@ /* * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2017-2018, Chris Fraire . + * Portions Copyright (c) 2017-2019, Chris Fraire . */ package org.opengrok.indexer.index; @@ -30,7 +30,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -46,7 +45,6 @@ import org.junit.Test; import org.opengrok.indexer.condition.ConditionalRun; import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.condition.RepositoryInstalled; import org.opengrok.indexer.configuration.Project; import org.opengrok.indexer.configuration.RuntimeEnvironment; @@ -62,7 +60,6 @@ * * @author Vladimir Kotal */ -@ConditionalRun(CtagsInstalled.class) public class IndexerRepoTest { @Rule diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerTest.java index 60142563bac..b717f174cd2 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerTest.java @@ -19,7 +19,7 @@ /* * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2017-2018, Chris Fraire . + * Portions Copyright (c) 2017-2019, Chris Fraire . */ package org.opengrok.indexer.index; @@ -54,7 +54,6 @@ import org.opengrok.indexer.analysis.AnalyzerGuru; import org.opengrok.indexer.condition.ConditionalRun; import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.condition.RepositoryInstalled; import org.opengrok.indexer.configuration.Project; import org.opengrok.indexer.configuration.RuntimeEnvironment; @@ -71,7 +70,6 @@ * * @author Trond Norbye */ -@ConditionalRun(CtagsInstalled.class) public class IndexerTest { TestRepository repository; diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/search/SearchEngineTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/search/SearchEngineTest.java index 7087a3d41ee..e8b78dd5660 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/search/SearchEngineTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/search/SearchEngineTest.java @@ -19,25 +19,19 @@ /* * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2018, Chris Fraire . + * Portions Copyright (c) 2018-2019, Chris Fraire . */ package org.opengrok.indexer.search; import java.io.File; -import java.util.ArrayList; import java.util.Collections; -import java.util.List; import java.util.TreeSet; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.ClassRule; import org.junit.Test; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.history.HistoryGuru; import org.opengrok.indexer.index.Indexer; @@ -51,15 +45,11 @@ * * @author Trond Norbye */ -@ConditionalRun(CtagsInstalled.class) public class SearchEngineTest { static TestRepository repository; static File configFile; - @ClassRule - public static ConditionalRunRule rule = new ConditionalRunRule(); - @BeforeClass public static void setUpClass() throws Exception { repository = new TestRepository(); diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/search/context/SearchAndContextFormatterTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/search/context/SearchAndContextFormatterTest.java index c01989c1a83..b91f5dc4ee7 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/search/context/SearchAndContextFormatterTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/search/context/SearchAndContextFormatterTest.java @@ -19,14 +19,13 @@ /* * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2018, Chris Fraire . + * Portions Copyright (c) 2018-2019, Chris Fraire . */ package org.opengrok.indexer.search.context; import java.io.File; import java.io.IOException; -import java.util.ArrayList; import java.util.Collections; import java.util.Map; import java.util.TreeSet; @@ -39,13 +38,9 @@ import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.ClassRule; import org.junit.Test; import org.opengrok.indexer.analysis.AbstractAnalyzer; import org.opengrok.indexer.analysis.plain.PlainAnalyzerFactory; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.history.HistoryGuru; import org.opengrok.indexer.index.Indexer; @@ -61,16 +56,12 @@ *

* Derived from Trond Norbye's {@code SearchEngineTest} */ -@ConditionalRun(CtagsInstalled.class) public class SearchAndContextFormatterTest { private static RuntimeEnvironment env; private static TestRepository repository; private static File configFile; - @ClassRule - public static ConditionalRunRule rule = new ConditionalRunRule(); - @BeforeClass public static void setUpClass() throws Exception { repository = new TestRepository(); diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/search/context/SearchAndContextFormatterTest2.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/search/context/SearchAndContextFormatterTest2.java index c16855d7eb6..d82009c1e67 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/search/context/SearchAndContextFormatterTest2.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/search/context/SearchAndContextFormatterTest2.java @@ -19,7 +19,7 @@ /* * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2018, Chris Fraire . + * Portions Copyright (c) 2018-2019, Chris Fraire . */ package org.opengrok.indexer.search.context; @@ -41,13 +41,9 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import org.junit.BeforeClass; -import org.junit.Rule; import org.junit.Test; import org.opengrok.indexer.analysis.AbstractAnalyzer; import org.opengrok.indexer.analysis.plain.PlainAnalyzerFactory; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.Project; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.history.HistoryGuru; @@ -65,7 +61,6 @@ *

* Derived from Trond Norbye's {@code SearchEngineTest} */ -@ConditionalRun(CtagsInstalled.class) public class SearchAndContextFormatterTest2 { private static final int TABSIZE = 8; @@ -77,9 +72,6 @@ public class SearchAndContextFormatterTest2 { private static File configFile; private static boolean originalProjectsEnabled; - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - @BeforeClass public static void setUpClass() throws Exception { env = RuntimeEnvironment.getInstance(); diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/util/CtagsUtilTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/util/CtagsUtilTest.java index 29c76124a01..8c9e13f3d32 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/util/CtagsUtilTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/util/CtagsUtilTest.java @@ -27,8 +27,6 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import java.util.List; @@ -36,7 +34,6 @@ /** * Represents a container for tests of {@link CtagsUtil}. */ -@ConditionalRun(CtagsInstalled.class) public class CtagsUtilTest { @Test diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/web/SearchHelperTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/web/SearchHelperTest.java index 19764909d9e..6f72565909e 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/web/SearchHelperTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/web/SearchHelperTest.java @@ -19,24 +19,19 @@ /* * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2018, Chris Fraire . + * Portions Copyright (c) 2018-2019, Chris Fraire . */ package org.opengrok.indexer.web; import java.io.IOException; -import java.util.ArrayList; import java.util.Collections; import java.util.SortedSet; import java.util.TreeSet; import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.Project; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.index.Indexer; @@ -49,9 +44,6 @@ */ public class SearchHelperTest { - @Rule - public ConditionalRunRule rule = new ConditionalRunRule(); - TestRepository repository; RuntimeEnvironment env; @@ -117,7 +109,6 @@ private SearchHelper getSearchHelperPath(String searchTerm) { } @Test - @ConditionalRun(CtagsInstalled.class) public void testSearchAfterReindex() { SortedSet projectNames = new TreeSet<>(); diff --git a/opengrok-web/src/main/java/org/opengrok/web/WebappListener.java b/opengrok-web/src/main/java/org/opengrok/web/WebappListener.java index 7b7d6c62826..618ed5041fb 100644 --- a/opengrok-web/src/main/java/org/opengrok/web/WebappListener.java +++ b/opengrok-web/src/main/java/org/opengrok/web/WebappListener.java @@ -19,7 +19,7 @@ /* * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. - * Portions Copyright (c) 2018, Chris Fraire . + * Portions Copyright (c) 2018-2019, Chris Fraire . */ package org.opengrok.web; @@ -77,7 +77,7 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) { } } - /** + /* * Create a new instance of authorization framework. If the code above * (reading the configuration) failed then the plugin directory is * possibly {@code null} causing the framework to allow every request. @@ -85,6 +85,10 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) { env.setAuthorizationFramework(new AuthorizationFramework(env.getPluginDirectory(), env.getPluginStack())); env.getAuthorizationFramework().reload(); + if (env.isWebappCtags() && !env.validateUniversalCtags()) { + LOGGER.warning("Didn't find Universal Ctags for --webappCtags"); + } + try { loadStatistics(); } catch (IOException ex) { @@ -93,7 +97,7 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) { String pluginDirectory = env.getPluginDirectory(); if (pluginDirectory != null && env.isAuthorizationWatchdog()) { - RuntimeEnvironment.getInstance().watchDog.start(new File(pluginDirectory)); + env.watchDog.start(new File(pluginDirectory)); } env.startExpirationTimer(); diff --git a/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/ProjectsControllerTest.java b/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/ProjectsControllerTest.java index 416cfc2d3c9..e6346efb36b 100644 --- a/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/ProjectsControllerTest.java +++ b/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/ProjectsControllerTest.java @@ -19,6 +19,7 @@ /* * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2019, Chris Fraire . */ package org.opengrok.web.api.v1.controller; @@ -33,7 +34,6 @@ import org.mockito.MockitoAnnotations; import org.opengrok.indexer.condition.ConditionalRun; import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.condition.RepositoryInstalled; import org.opengrok.indexer.configuration.Group; import org.opengrok.indexer.configuration.Project; @@ -257,7 +257,6 @@ public void testRepositoryRefresh() throws Exception { * the delete handling performs removal of the index data. */ @Test - @ConditionalRun(CtagsInstalled.class) public void testDelete() throws Exception { String projectsToDelete[] = { "git", "svn" }; diff --git a/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/RepositoriesControllerTest.java b/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/RepositoriesControllerTest.java index 98a7ffb97ae..2251849883f 100644 --- a/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/RepositoriesControllerTest.java +++ b/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/RepositoriesControllerTest.java @@ -19,6 +19,7 @@ /* * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2019, Chris Fraire . */ package org.opengrok.web.api.v1.controller; @@ -30,7 +31,6 @@ import org.junit.Test; import org.opengrok.indexer.condition.ConditionalRun; import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.condition.RepositoryInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.history.HistoryGuru; @@ -49,7 +49,6 @@ @ConditionalRun(RepositoryInstalled.MercurialInstalled.class) @ConditionalRun(RepositoryInstalled.GitInstalled.class) -@ConditionalRun(CtagsInstalled.class) public class RepositoriesControllerTest extends JerseyTest { private RuntimeEnvironment env = RuntimeEnvironment.getInstance(); diff --git a/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/SuggesterControllerProjectsDisabledTest.java b/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/SuggesterControllerProjectsDisabledTest.java index d376af0b5a3..af75dc2fe1d 100644 --- a/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/SuggesterControllerProjectsDisabledTest.java +++ b/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/SuggesterControllerProjectsDisabledTest.java @@ -19,6 +19,7 @@ /* * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2019, Chris Fraire . */ package org.opengrok.web.api.v1.controller; @@ -26,12 +27,8 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; -import org.junit.ClassRule; import org.junit.Test; import org.opengrok.suggest.Suggester; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.configuration.SuggesterConfig; import org.opengrok.indexer.index.Indexer; @@ -43,7 +40,6 @@ import javax.ws.rs.core.Application; import java.io.File; import java.lang.reflect.Field; -import java.util.ArrayList; import java.util.Collections; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -53,12 +49,8 @@ import static org.hamcrest.Matchers.containsInAnyOrder; import static org.junit.Assert.assertThat; -@ConditionalRun(CtagsInstalled.class) public class SuggesterControllerProjectsDisabledTest extends JerseyTest { - @ClassRule - public static ConditionalRunRule rule = new ConditionalRunRule(); - private static final RuntimeEnvironment env = RuntimeEnvironment.getInstance(); private static TestRepository repository; diff --git a/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/SuggesterControllerTest.java b/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/SuggesterControllerTest.java index 4d96c4a2e59..37df447b178 100644 --- a/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/SuggesterControllerTest.java +++ b/opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/SuggesterControllerTest.java @@ -19,6 +19,7 @@ /* * Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2019, Chris Fraire . */ package org.opengrok.web.api.v1.controller; @@ -27,9 +28,6 @@ import org.junit.*; import org.junit.runners.MethodSorters; import org.opengrok.suggest.Suggester; -import org.opengrok.indexer.condition.ConditionalRun; -import org.opengrok.indexer.condition.ConditionalRunRule; -import org.opengrok.indexer.condition.CtagsInstalled; import org.opengrok.indexer.configuration.RuntimeEnvironment; import org.opengrok.indexer.configuration.SuggesterConfig; import org.opengrok.indexer.index.Indexer; @@ -62,7 +60,6 @@ import static org.opengrok.web.api.v1.filter.CorsFilter.ALLOW_CORS_HEADER; import static org.opengrok.web.api.v1.filter.CorsFilter.CORS_REQUEST_HEADER; -@ConditionalRun(CtagsInstalled.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class SuggesterControllerTest extends JerseyTest { @@ -87,9 +84,6 @@ private static class TermIncrementData { public int increment; } - @ClassRule - public static ConditionalRunRule rule = new ConditionalRunRule(); - private static final RuntimeEnvironment env = RuntimeEnvironment.getInstance(); private static final GenericType>> popularityDataType =