-
Notifications
You must be signed in to change notification settings - Fork 858
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make sure to use only the RegExpProxy interface instead of some hardc…
…oded instanceof
- Loading branch information
Showing
4 changed files
with
73 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
tests/src/test/java/org/mozilla/archunit/ArchitectureTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
package org.mozilla.archunit; | ||
|
||
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses; | ||
|
||
import com.tngtech.archunit.core.importer.ImportOption; | ||
import com.tngtech.archunit.junit.AnalyzeClasses; | ||
import com.tngtech.archunit.junit.ArchTest; | ||
import com.tngtech.archunit.junit.ArchUnitRunner; | ||
import com.tngtech.archunit.lang.ArchRule; | ||
import org.junit.runner.RunWith; | ||
|
||
/** | ||
* Architecture tests. | ||
* | ||
* @author Ronald Brill | ||
*/ | ||
@RunWith(ArchUnitRunner.class) | ||
@AnalyzeClasses( | ||
packages = "org.mozilla.javascript", | ||
importOptions = ImportOption.DoNotIncludeTests.class) | ||
public class ArchitectureTest { | ||
|
||
/** Use only the RegExpProxy. */ | ||
@ArchTest | ||
public static final ArchRule regExpProxyRule = | ||
noClasses() | ||
.that() | ||
.resideOutsideOfPackage("org.mozilla.javascript.regexp..") | ||
.and() | ||
.doNotHaveFullyQualifiedName("org.mozilla.javascript.RegExpProxy") | ||
.should() | ||
.dependOnClassesThat() | ||
.resideInAnyPackage("org.mozilla.javascript.regexp.."); | ||
} |