target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void shouldClassNotBeConsideredWithOnePlaceholderInsideAndSpecificEnd() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "java/*/*Impl" ); Set<String> exclusionSet = new Hash... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassBeConsideredWithOnePlaceholderInsideAndSpecificEnd() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "test/*/*Impl" ); Set<String> exclusionSet = new HashSet... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassBeConsideredWithTwoPlaceholderInsidePlusHashAndUnspecificEnd3() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "test/*/*Impl/*" ); Set<String> exclusionSet ... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassNotBeConsideredWithTwoPlaceholderInsidePlusHashAndUnspecificEnd2() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "java/*/*Impl/*" ); Set<String> exclusionS... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassBeConsideredWithTwoPlaceholderInsidePlusHashAndUnspecificEnd() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "test/*/*Impl/*" ); Set<String> exclusionSet =... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassNotBeConsideredWithTwoPlaceholderInsidePlusHashAndUnspecificEnd() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "java/*/*Impl/*" ); Set<String> exclusionSe... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassNotBeConsideredWithOnePlaceholderInsideAndUnspecificEnd() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "java/*/*Impl*" ); Set<String> exclusionSet = new H... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void isFieldAccessChange() { assertTrue(Tools.isFieldAccessChange(0, Opcodes.ACC_FINAL)); assertTrue(Tools.isFieldAccessChange(0, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL)); assertFalse(Tools.isFieldAccessChange(Opcodes.ACC_FINAL, 0)); assertFalse(Tools.isFieldAccessChange(Opcodes.ACC_FINAL + Opcodes.ACC_PUB... | public static boolean isFieldAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; } if ( not(oldAccess, Opcodes.ACC_FINAL) && has(newAccess, Opcodes.ACC_FINAL) ) { return true; } else { final int compatibleChanges = Opcodes.ACC_FINAL | Opcodes.ACC_TRANS... | Tools { public static boolean isFieldAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; } if ( not(oldAccess, Opcodes.ACC_FINAL) && has(newAccess, Opcodes.ACC_FINAL) ) { return true; } else { final int compatibleChanges = Opcodes.ACC_FINAL | Opcodes.A... | Tools { public static boolean isFieldAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; } if ( not(oldAccess, Opcodes.ACC_FINAL) && has(newAccess, Opcodes.ACC_FINAL) ) { return true; } else { final int compatibleChanges = Opcodes.ACC_FINAL | Opcodes.A... | Tools { public static boolean isFieldAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; } if ( not(oldAccess, Opcodes.ACC_FINAL) && has(newAccess, Opcodes.ACC_FINAL) ) { return true; } else { final int compatibleChanges = Opcodes.ACC_FINAL | Opcodes.A... | Tools { public static boolean isFieldAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; } if ( not(oldAccess, Opcodes.ACC_FINAL) && has(newAccess, Opcodes.ACC_FINAL) ) { return true; } else { final int compatibleChanges = Opcodes.ACC_FINAL | Opcodes.A... |
@Test public void shouldClassNotBeConsideredWithTwoPlaceholderInsideAndUnspecificEnd() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "javaImpl*" ); Set<String> exclusionSet = new HashS... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassNotBeConsideredWithTwoPlaceholderInsideAndUnspecificEndWithNoUseOfPlaceholders() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "regexImpl*" ); Set<String> ... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassBeConsideredWithTwoPlaceholderInsideAndUnspecificEndWithNoUseOfPlaceholders() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "regexImpl*" ); Set<String> exc... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassNotBeConsideredWithTwoPlaceholderInsideAndUnspecificEndWith() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "testImpl*" ); Set<String> exclusionSet = new H... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassNotBeConsideredWhenNotMatchingAnyDefinedInclude() { List<String> inclusions = new ArrayList<String>(); inclusions.add( "test/java/regex/code/*" ); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); Set<String> exclusionSet = new ... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassBeConsideredWhenMatchingDefinedInclude() { List<String> inclusions = new ArrayList<String>(); inclusions.add( "test/java/regex/code/*" ); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); Set<String> exclusionSet = new HashSet<S... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void inferVersion() { final int major = 1; final int minor = 2; final int patch = 3; final Version version = new Version(major, minor, patch); assertEquals(version.next(MAJOR), inferNextVersion(version, NON_BACKWARD_COMPATIBLE)); assertEquals(version.next(MINOR), inferNextVersion(version, BACKWARD_COMPATIB... | @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } switch (comp... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... |
@Test(expected=IllegalArgumentException.class) public void shouldInferWithNullVersionFail() { inferNextVersion(null, BACKWARD_COMPATIBLE_IMPLEMENTER); } | @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } switch (comp... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... |
@Test(expected=IllegalArgumentException.class) public void shouldInferWithNullCompatibilityTypeFail() { inferNextVersion(new Version(1, 0, 0), null); } | @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } switch (comp... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... | Delta { @Nonnull public static Version inferNextVersion(@Nonnull final Version version, @Nonnull final CompatibilityType compatibilityType) { if (version == null) { throw new IllegalArgumentException("null version"); } if (compatibilityType == null) { throw new IllegalArgumentException("null compatibilityType"); } swit... |
@Test(expected=IllegalArgumentException.class) public void shouldNullVersionNotBeInferable() { new Delta(EMPTY_DIFFERENCES).infer(null); } | @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatibilityTyp... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... |
@Test public void isMethodAccessChange() { assertTrue(Tools.isMethodAccessChange(0, Opcodes.ACC_FINAL)); assertTrue(Tools.isMethodAccessChange(0, Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL)); assertFalse(Tools.isMethodAccessChange(Opcodes.ACC_FINAL, 0)); assertFalse(Tools.isMethodAccessChange(Opcodes.ACC_FINAL + Opcodes.AC... | public static boolean isMethodAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; } if ( not(oldAccess, Opcodes.ACC_ABSTRACT) && has(newAccess, Opcodes.ACC_ABSTRACT) ) { return true; } else if ( not(oldAccess, Opcodes.ACC_FINAL) && not(oldAccess, Opcod... | Tools { public static boolean isMethodAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; } if ( not(oldAccess, Opcodes.ACC_ABSTRACT) && has(newAccess, Opcodes.ACC_ABSTRACT) ) { return true; } else if ( not(oldAccess, Opcodes.ACC_FINAL) && not(oldAcces... | Tools { public static boolean isMethodAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; } if ( not(oldAccess, Opcodes.ACC_ABSTRACT) && has(newAccess, Opcodes.ACC_ABSTRACT) ) { return true; } else if ( not(oldAccess, Opcodes.ACC_FINAL) && not(oldAcces... | Tools { public static boolean isMethodAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; } if ( not(oldAccess, Opcodes.ACC_ABSTRACT) && has(newAccess, Opcodes.ACC_ABSTRACT) ) { return true; } else if ( not(oldAccess, Opcodes.ACC_FINAL) && not(oldAcces... | Tools { public static boolean isMethodAccessChange(final int oldAccess, final int newAccess) { if (isAccessIncompatible(oldAccess, newAccess)) { return true; } if ( not(oldAccess, Opcodes.ACC_ABSTRACT) && has(newAccess, Opcodes.ACC_ABSTRACT) ) { return true; } else if ( not(oldAccess, Opcodes.ACC_FINAL) && not(oldAcces... |
@Test(expected=IllegalArgumentException.class) public void shouldDevelopmentVersionNotBeInferable() { new Delta(EMPTY_DIFFERENCES).infer(new Version(0, 0, 0)); } | @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatibilityTyp... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... |
@Test public void shouldEmptyDeltaBeImplementerBackwardCompatible() { final int major = 1; final int minor = 2; final int patch = 3; final Version version = new Version(major, minor, patch); final Version inferedVersion = new Delta(EMPTY_DIFFERENCES).infer(version); assertEquals(new Version(major, minor, patch+1), infe... | @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatibilityTyp... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... |
@Test public void shouldDeltaWithAddsBeUserBackwardCompatible() { final int major = 1; final int minor = 2; final int patch = 3; final Version version = new Version(major, minor, patch); final Version inferedVersion = new Delta(Collections.singleton(new Delta.Add("class", new FieldInfo(0, "", "", "", null)))).infer(ver... | @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatibilityTyp... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... |
@Test public void shouldDeltaWithChangesBeNonBackwardCompatible() { final int major = 1; final int minor = 2; final int patch = 3; final Version version = new Version(major, minor, patch); final Version inferedVersion = new Delta(Collections.singleton(new Delta.Change("class", new FieldInfo(0, "", "", "", null), new Fi... | @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatibilityTyp... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... |
@Test public void shouldDeltaWithRemovesBeNonBackwardCompatible() { final int major = 1; final int minor = 2; final int patch = 3; final Version version = new Version(major, minor, patch); final Version inferedVersion = new Delta(Collections.singleton(new Delta.Remove("class", new FieldInfo(0, "", "", "", null)))).infe... | @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatibilityTyp... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... | Delta { @Nonnull public final Version infer(@Nonnull final Version previous) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (previous.isInDevelopment()) { throw new IllegalArgumentException("Cannot infer for in development version <"+previous+">"); } final CompatibilityType compatib... |
@Test(expected=IllegalArgumentException.class) public void shouldValidateWithNullPreviousVersionFail() { new Delta(EMPTY_DIFFERENCES).validate(null, new Version(1, 0, 0)); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test(expected=IllegalArgumentException.class) public void shouldValidateWithNullCurrentVersionFail() { new Delta(EMPTY_DIFFERENCES).validate(new Version(1, 0, 0), null); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test public void shouldValidateWithCurrentVersionInDevelopmentSucceed() { validate(EMPTY_DIFFERENCES, new Version(0, 0, 0), new Version(0, 0, 1), true); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test(expected=IllegalArgumentException.class) public void shouldValidateWithPreviousVersionNextCurrentVersionFail() { new Delta(EMPTY_DIFFERENCES).validate(new Version(1, 1, 0), new Version(1, 0, 0)); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test(expected=IllegalArgumentException.class) public void shouldValidateWithPreviousVersionEqualsCurrentVersionFail() { new Delta(EMPTY_DIFFERENCES).validate(new Version(1, 0, 0), new Version(1, 0, 0)); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test public void shouldClassBeNotConsideredWithTwoPlaceholdersBeforeAndBehind() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "**/java/**" ); Set<String> exclusionSet = new HashSet<St... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldValidateWithCorrectVersionsSucceed() { validate(EMPTY_DIFFERENCES, new Version(1, 1, 0), new Version(1, 1, 1), true); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test public void shouldValidateWithCorrectPreVersionsSucceed() { validate(EMPTY_DIFFERENCES, new Version(1, 1, 0, "-", "rc1"), new Version(1, 1, 0, "-", "rc2"), true); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test public void shouldValidateWithIncorrectVersionFail() { validate(Collections.singleton(new Delta.Remove("class", new FieldInfo(0, "", "", "", null))), new Version(1, 1, 0), new Version(1, 1, 1), false); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test public void upgradeMinorVersionOnClassDeprecated() { validate(singleton(new Delta.Deprecate("class", new ClassInfo(1, 0, "", "", "", null, null, null), new ClassInfo(1, 0, "", "", "", null, null, null))), new Version(1, 1, 0), new Version(1, 2, 0), true); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test public void upgradeMinorVersionOnFieldDeprecated() { validate(singleton(new Delta.Deprecate("class", new FieldInfo(0, "", "", "", null), new FieldInfo(0, "", "", "", null))), new Version(1, 1, 0), new Version(1, 2, 0), true); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test public void upgradeMinorVersionOnMethodDeprecated() { validate(singleton(new Delta.Deprecate("class", new MethodInfo(0, "", "", "", null), new MethodInfo(0, "", "", "", null))), new Version(1, 1, 0), new Version(1, 2, 0), true); } | public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalArgumentEx... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... | Delta { public final boolean validate(@Nonnull final Version previous, @Nonnull final Version current) { if (previous == null) { throw new IllegalArgumentException("null previous"); } if (current == null) { throw new IllegalArgumentException("null current"); } if (current.compareTo(previous) <= 0) { throw new IllegalAr... |
@Test public void shouldValidVersionBeParsed() { Version.parse("1.2"); Version.parse("1.2.3"); Version.parse("10.20.30"); Version.parse("1.2.3beta"); Version.parse("1.2.3.DEV"); Version.parse("1.2.3.DEV-SNAPSHOT"); Version.parse("1.2-SNAPSHOT"); Version.parse("1.2.3-SNAPSHOT"); Version.parse("1.2.3-RC-SNAPSHOT"); Versi... | public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher.group(1)); final int minor = Integer.val... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... |
@Test(expected=IllegalArgumentException.class) public void shouldInvalidVersion1NotBeParsed() { Version.parse("invalid"); } | public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher.group(1)); final int minor = Integer.val... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... |
@Test(expected=IllegalArgumentException.class) public void shouldInvalidVersion2NotBeParsed() { Version.parse("a.2.3"); } | public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher.group(1)); final int minor = Integer.val... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... | Version implements Comparable<Version> { public static Version parse(@Nonnull final String version) { final Matcher matcher = Version.PATTERN.matcher(version); if (!matcher.matches()) { throw new IllegalArgumentException("<"+version+"> does not match format "+Version.FORMAT); } final int major = Integer.valueOf(matcher... |
@Test public void next() { final int major = 1; final int minor = 2; final int patch = 3; final Version version = new Version(major, minor, patch); Assert.assertEquals(version.next(Version.Element.MAJOR), new Version(major+1, 0, 0)); Assert.assertEquals(version.next(Version.Element.MINOR), new Version(major, minor+1, 0... | public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else { return new Version(this.major, 0, 0); ... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... |
@Test public void shouldClassBeConsideredWithOnePlaceholderBeforeAndBehind() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "*/java/*" ); Set<String> exclusionSet = new HashSet<String>(... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void nextFromPre() { final Version version1 = new Version(1, 0, 0, "-", "rc1"); Assert.assertEquals(new Version(1, 0, 0), version1.next(Version.Element.MAJOR)); Assert.assertEquals(new Version(1, 0, 0), version1.next(Version.Element.MINOR)); Assert.assertEquals(new Version(1, 0, 0), version1.next(Version.E... | public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else { return new Version(this.major, 0, 0); ... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... |
@Test(expected=IllegalArgumentException.class) public void shouldNextWithNullComparisonTypeFail() { final int major = 1; final int minor = 2; final int patch = 3; final Version version = new Version(major, minor, patch); version.next(null); } | public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else { return new Version(this.major, 0, 0); ... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... | Version implements Comparable<Version> { public Version next(@Nonnull final Version.Element element) { if (element == null) { throw new IllegalArgumentException("null element"); } switch (element) { case MAJOR: if (special == null || this.minor != 0 || this.patch != 0) { return new Version(this.major + 1, 0, 0); } else... |
@Test public void shouldClassBeNotConsideredWithTwoPlaceholderAfter() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "java/**" ); Set<String> exclusionSet = new HashSet<String>( exclusi... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassBeConsideredWithTwoPlaceholderBefore() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "**/java" ); Set<String> exclusionSet = new HashSet<String>( exclusion... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassBeConsideredWithOnePlaceholderAfter() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "java/*" ); Set<String> exclusionSet = new HashSet<String>( exclusions ... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassBeConsideredWithOnePlaceholderBefore() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "*/java" ); Set<String> exclusionSet = new HashSet<String>( exclusions... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void shouldClassBeNotConsideredWithTwoPlaceholderInside() { List<String> inclusions = new ArrayList<String>(); Set<String> inclusionSet = new HashSet<String>( inclusions ); List<String> exclusions = new ArrayList<String>(); exclusions.add( "dejava/**" ); Set<String> exclusionSet = new HashSet<String>( excl... | protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude = exclude.replaceAll( "/\\*\\*/", "{0,1}**/" ); } if ( excl... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... | DifferenceAccumulatingHandler extends AbstractDiffHandler { protected boolean isClassConsidered( final String className ) { final String fixedClassName = className.replace('.', '/'); for ( String exclude : this.excludes ) { final Pattern excludePattern; if( !excludesAreRegExp ) { if ( exclude.contains( "" ) ) { exclude... |
@Test public void uninstallAddon() throws Exception { File sampleExtensionZipFile = buildSampleExtension(); AddonInstallRequest installRequest = AddonInstallRequest.fromFile(sampleExtensionZipFile, AddonPersistence.TEMPORARY); BehaviorVerifier<Void> verifier = (driver, baseUri) -> { AddonUninstallRequest uninstallReque... | public void uninstallAddon(AddonUninstallRequest request) throws IOException { addonSupport.uninstallAddon(request); } | ExtensibleFirefoxDriver extends FirefoxDriver { public void uninstallAddon(AddonUninstallRequest request) throws IOException { addonSupport.uninstallAddon(request); } } | ExtensibleFirefoxDriver extends FirefoxDriver { public void uninstallAddon(AddonUninstallRequest request) throws IOException { addonSupport.uninstallAddon(request); } ExtensibleFirefoxDriver(GeckoDriverService service, FirefoxOptions options); } | ExtensibleFirefoxDriver extends FirefoxDriver { public void uninstallAddon(AddonUninstallRequest request) throws IOException { addonSupport.uninstallAddon(request); } ExtensibleFirefoxDriver(GeckoDriverService service, FirefoxOptions options); void installAddon(AddonInstallRequest request); void uninstallAddon(AddonUni... | ExtensibleFirefoxDriver extends FirefoxDriver { public void uninstallAddon(AddonUninstallRequest request) throws IOException { addonSupport.uninstallAddon(request); } ExtensibleFirefoxDriver(GeckoDriverService service, FirefoxOptions options); void installAddon(AddonInstallRequest request); void uninstallAddon(AddonUni... |
@Test public void testSimpleJs() throws Exception { final String js = "function myFunction()\n" + "{\n" + "var x=\"\",i;\n" + "for (i=0;i<5;i++)\n" + " {\n" + " x=x + \"The number is \" + i + \"<br>\";\n" + " }\n" + "document.getElementById(\"demo\").innerHTML=x;\n" + "}"; final StringReader reader = new StringReader(j... | @Override public void process(Reader reader, Writer writer) throws IOException { final JavaScriptCompressor javaScriptCompressor = new JavaScriptCompressor(reader, new ErrorReporter() { public void warning(final String message, final String sourceName, final int line, final String lineSource, final int lineOffset) { if... | YahooOutputProcessor implements OutputProcessor { @Override public void process(Reader reader, Writer writer) throws IOException { final JavaScriptCompressor javaScriptCompressor = new JavaScriptCompressor(reader, new ErrorReporter() { public void warning(final String message, final String sourceName, final int line, f... | YahooOutputProcessor implements OutputProcessor { @Override public void process(Reader reader, Writer writer) throws IOException { final JavaScriptCompressor javaScriptCompressor = new JavaScriptCompressor(reader, new ErrorReporter() { public void warning(final String message, final String sourceName, final int line, f... | YahooOutputProcessor implements OutputProcessor { @Override public void process(Reader reader, Writer writer) throws IOException { final JavaScriptCompressor javaScriptCompressor = new JavaScriptCompressor(reader, new ErrorReporter() { public void warning(final String message, final String sourceName, final int line, f... | YahooOutputProcessor implements OutputProcessor { @Override public void process(Reader reader, Writer writer) throws IOException { final JavaScriptCompressor javaScriptCompressor = new JavaScriptCompressor(reader, new ErrorReporter() { public void warning(final String message, final String sourceName, final int line, f... |
@Test public void testAbsentUrlReturnsAbsentHash() throws Exception { Assert.assertFalse("absent url results in absent hash", hashFileGenerator.hash(Optional.<URL>absent()).isPresent()); } | @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPresent(url.get()); logger.debug("md5 hash:{}", md5); if (md5 != null) { r... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... |
@Test public void testReturnedHashMatchesDebugOff() throws Exception { final URL url = getClass().getClassLoader().getResource("templates/template1.soy"); final Optional<String> hash = hashFileGenerator.hash(Optional.of(url)); Assert.assertTrue(hash.isPresent()); Assert.assertEquals("md5 hash should match", "db9e0c4790... | @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPresent(url.get()); logger.debug("md5 hash:{}", md5); if (md5 != null) { r... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... |
@Test public void testReturnedHashMatchesDebugOffCacheSound() throws Exception { final URL url = getClass().getClassLoader().getResource("templates/template1.soy"); hashFileGenerator.hash(Optional.of(url)); Assert.assertEquals("a cache size should be 1", 1L, hashFileGenerator.cache.size()); Assert.assertEquals("cache s... | @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPresent(url.get()); logger.debug("md5 hash:{}", md5); if (md5 != null) { r... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... | MD5HashFileGenerator implements HashFileGenerator, InitializingBean { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { if (!url.isPresent()) { return Optional.absent(); } logger.debug("Calculating md5 hash, url:{}", url); if (isHotReloadModeOff()) { final String md5 = cache.getIfPres... |
@Test public void defaultHashOneNotNull() throws Exception { Assert.assertNotNull("should not be null", emptyHashFileGenerator.hash(null)); } | @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } |
@Test public void defaultHashOneAbsent() throws Exception { Assert.assertFalse("should be absent", emptyHashFileGenerator.hash(null).isPresent()); } | @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } |
@Test public void defaultHashOneAbsentWithValue() throws Exception { Assert.assertFalse("should be absent", emptyHashFileGenerator.hash(Optional.of(new URL("file: } | @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hash(final Optional<URL> url) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } |
@Test public void defaultHashMultiNotNull() throws Exception { Assert.assertNotNull("should not be null", emptyHashFileGenerator.hashMulti(null)); } | @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } |
@Test public void defaultHashMultiAbsent() throws Exception { Assert.assertFalse("should be absent", emptyHashFileGenerator.hashMulti(null).isPresent()); } | @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } |
@Test public void defaultHashMultiEmptyNotNull() throws Exception { Assert.assertNotNull("should not be null", emptyHashFileGenerator.hashMulti(Collections.EMPTY_LIST)); } | @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } |
@Test public void defaultHashMultiEmptyNotNullAbsentWithValue() throws Exception { Assert.assertNotNull("should not be null", emptyHashFileGenerator.hashMulti(Lists.newArrayList(new URL("file: } | @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } |
@Test public void testSimpleJs() throws Exception { final String js = "function myFunction()\n" + "{\n" + "var x=\"\",i;\n" + "for (i=0;i<5;i++)\n" + " {\n" + " x=x + \"The number is \" + i + \"<br>\";\n" + " }\n" + "document.getElementById(\"demo\").innerHTML=x;\n" + "}"; final StringReader reader = new StringReader(j... | @Override public void process(final Reader reader, final Writer writer) throws IOException { final String originalJsSourceCode = IOUtils.toString(reader); try { Compiler.setLoggingLevel(Level.SEVERE); final Compiler compiler = new Compiler(); final CompilerOptions compilerOptions = newCompilerOptions(); compilationLeve... | GoogleClosureOutputProcessor implements OutputProcessor { @Override public void process(final Reader reader, final Writer writer) throws IOException { final String originalJsSourceCode = IOUtils.toString(reader); try { Compiler.setLoggingLevel(Level.SEVERE); final Compiler compiler = new Compiler(); final CompilerOptio... | GoogleClosureOutputProcessor implements OutputProcessor { @Override public void process(final Reader reader, final Writer writer) throws IOException { final String originalJsSourceCode = IOUtils.toString(reader); try { Compiler.setLoggingLevel(Level.SEVERE); final Compiler compiler = new Compiler(); final CompilerOptio... | GoogleClosureOutputProcessor implements OutputProcessor { @Override public void process(final Reader reader, final Writer writer) throws IOException { final String originalJsSourceCode = IOUtils.toString(reader); try { Compiler.setLoggingLevel(Level.SEVERE); final Compiler compiler = new Compiler(); final CompilerOptio... | GoogleClosureOutputProcessor implements OutputProcessor { @Override public void process(final Reader reader, final Writer writer) throws IOException { final String originalJsSourceCode = IOUtils.toString(reader); try { Compiler.setLoggingLevel(Level.SEVERE); final Compiler compiler = new Compiler(); final CompilerOptio... |
@Test public void defaultHashMultiEmptyAbsent() throws Exception { Assert.assertFalse("should be absent", emptyHashFileGenerator.hashMulti(Collections.EMPTY_LIST).isPresent()); } | @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } | EmptyHashFileGenerator implements HashFileGenerator { @Override public Optional<String> hashMulti(Collection<URL> urls) throws IOException { return Optional.absent(); } @Override Optional<String> hash(final Optional<URL> url); @Override Optional<String> hashMulti(Collection<URL> urls); } |
@Test public void nullReturnsNull() throws Exception { Assert.assertNull("null returns null", emptyModelAdjuster.adjust(null)); } | @Override public @Nullable Object adjust(@Nullable Object obj) { return obj; } | EmptyModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable Object obj) { return obj; } } | EmptyModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable Object obj) { return obj; } } | EmptyModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable Object obj) { return obj; } @Override @Nullable Object adjust(@Nullable Object obj); } | EmptyModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable Object obj) { return obj; } @Override @Nullable Object adjust(@Nullable Object obj); } |
@Test public void sameObject() throws Exception { final Object obj = new Object(); Assert.assertEquals("return the same object", obj, emptyModelAdjuster.adjust(obj)); } | @Override public @Nullable Object adjust(@Nullable Object obj) { return obj; } | EmptyModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable Object obj) { return obj; } } | EmptyModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable Object obj) { return obj; } } | EmptyModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable Object obj) { return obj; } @Override @Nullable Object adjust(@Nullable Object obj); } | EmptyModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable Object obj) { return obj; } @Override @Nullable Object adjust(@Nullable Object obj); } |
@Test public void defaultModelKey() throws Exception { Assert.assertEquals("model key should be 'model'", "model", springModelAdjuster.getModelKey()); } | public String getModelKey() { return modelKey; } | SpringModelAdjuster implements ModelAdjuster { public String getModelKey() { return modelKey; } } | SpringModelAdjuster implements ModelAdjuster { public String getModelKey() { return modelKey; } } | SpringModelAdjuster implements ModelAdjuster { public String getModelKey() { return modelKey; } @Override @Nullable Object adjust(@Nullable final Object obj); void setModelKey(final String modelKey); String getModelKey(); } | SpringModelAdjuster implements ModelAdjuster { public String getModelKey() { return modelKey; } @Override @Nullable Object adjust(@Nullable final Object obj); void setModelKey(final String modelKey); String getModelKey(); } |
@Test public void setModelKey() throws Exception { springModelAdjuster.setModelKey("newModelKey"); Assert.assertEquals("model key should be 'newModelKey'", "newModelKey", springModelAdjuster.getModelKey()); } | public void setModelKey(final String modelKey) { this.modelKey = modelKey; } | SpringModelAdjuster implements ModelAdjuster { public void setModelKey(final String modelKey) { this.modelKey = modelKey; } } | SpringModelAdjuster implements ModelAdjuster { public void setModelKey(final String modelKey) { this.modelKey = modelKey; } } | SpringModelAdjuster implements ModelAdjuster { public void setModelKey(final String modelKey) { this.modelKey = modelKey; } @Override @Nullable Object adjust(@Nullable final Object obj); void setModelKey(final String modelKey); String getModelKey(); } | SpringModelAdjuster implements ModelAdjuster { public void setModelKey(final String modelKey) { this.modelKey = modelKey; } @Override @Nullable Object adjust(@Nullable final Object obj); void setModelKey(final String modelKey); String getModelKey(); } |
@Test public void adjustMap() throws Exception { final Object modelObject = new Object(); final Map<String,Object> map = new HashMap(); map.put("model", modelObject); Assert.assertEquals("should return modelObject", modelObject, springModelAdjuster.adjust(map)); } | @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } @Override... | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } @Override... |
@Test public void adjustMapFail() throws Exception { final Object modelObject = new Object(); final Map<String,Object> map = new HashMap(); map.put("model2", modelObject); Assert.assertNull("should return null", springModelAdjuster.adjust(map)); } | @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } @Override... | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } @Override... |
@Test public void adjustSpringModel() throws Exception { final Object modelObject = new Object(); final Model model = new ExtendedModelMap(); model.addAttribute("model", modelObject); Assert.assertEquals("should return modelObject", modelObject, springModelAdjuster.adjust(model)); } | @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } @Override... | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } @Override... |
@Test public void adjustPassThrough() throws Exception { final Object modelObject = new Object(); Assert.assertEquals("should return modelObject", modelObject, springModelAdjuster.adjust(modelObject)); } | @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } } | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } @Override... | SpringModelAdjuster implements ModelAdjuster { @Override public @Nullable Object adjust(@Nullable final Object obj) { if (obj instanceof Model) { final Model model = (Model) obj; return model.asMap().get("model"); } if (obj instanceof Map) { final Map map = (Map) obj; return map.get("model"); } return obj; } @Override... |
@Test public void testToSoyMapWhenNoModel() throws Exception { Optional<SoyMapData> soyData = objectToSoyDataConverter.toSoyMap(null); assertFalse(soyData.isPresent()); } | @Override public Optional<SoyMapData> toSoyMap(final Object model) throws Exception { if (model == null) { return Optional.absent(); } return Optional.fromNullable(objectToSoyDataMap(model)); } | DefaultToSoyDataConverter implements ToSoyDataConverter { @Override public Optional<SoyMapData> toSoyMap(final Object model) throws Exception { if (model == null) { return Optional.absent(); } return Optional.fromNullable(objectToSoyDataMap(model)); } } | DefaultToSoyDataConverter implements ToSoyDataConverter { @Override public Optional<SoyMapData> toSoyMap(final Object model) throws Exception { if (model == null) { return Optional.absent(); } return Optional.fromNullable(objectToSoyDataMap(model)); } DefaultToSoyDataConverter(); } | DefaultToSoyDataConverter implements ToSoyDataConverter { @Override public Optional<SoyMapData> toSoyMap(final Object model) throws Exception { if (model == null) { return Optional.absent(); } return Optional.fromNullable(objectToSoyDataMap(model)); } DefaultToSoyDataConverter(); void setIgnorablePropertiesMatcher(
... | DefaultToSoyDataConverter implements ToSoyDataConverter { @Override public Optional<SoyMapData> toSoyMap(final Object model) throws Exception { if (model == null) { return Optional.absent(); } return Optional.fromNullable(objectToSoyDataMap(model)); } DefaultToSoyDataConverter(); void setIgnorablePropertiesMatcher(
... |
@Test public void testCompileJs() throws Exception { final String templateName = "templates/template1.soy"; final String jsData = "jsData"; final HttpServletRequest request = mock(HttpServletRequest.class); when(localeProvider.resolveLocale(request)).thenReturn(Optional.<Locale>absent()); when(soyMsgBundleResolver.reso... | private ResponseEntity<String> compileJs(final String[] templateFileNames, final String hash, final boolean disableProcessors, final HttpServletRequest request, final String locale ) throws IOException { Preconditions.checkNotNull(templateFilesResolver, "templateFilesResolver cannot be null"); if (isHotReloadModeOff())... | SoyAjaxController { private ResponseEntity<String> compileJs(final String[] templateFileNames, final String hash, final boolean disableProcessors, final HttpServletRequest request, final String locale ) throws IOException { Preconditions.checkNotNull(templateFilesResolver, "templateFilesResolver cannot be null"); if (i... | SoyAjaxController { private ResponseEntity<String> compileJs(final String[] templateFileNames, final String hash, final boolean disableProcessors, final HttpServletRequest request, final String locale ) throws IOException { Preconditions.checkNotNull(templateFilesResolver, "templateFilesResolver cannot be null"); if (i... | SoyAjaxController { private ResponseEntity<String> compileJs(final String[] templateFileNames, final String hash, final boolean disableProcessors, final HttpServletRequest request, final String locale ) throws IOException { Preconditions.checkNotNull(templateFilesResolver, "templateFilesResolver cannot be null"); if (i... | SoyAjaxController { private ResponseEntity<String> compileJs(final String[] templateFileNames, final String hash, final boolean disableProcessors, final HttpServletRequest request, final String locale ) throws IOException { Preconditions.checkNotNull(templateFilesResolver, "templateFilesResolver cannot be null"); if (i... |
@Test public void testToSoyMapWhenModelIsPresent() throws Exception { Map<String, String> model = new HashMap<String, String>(); model.put(key, keyValue); Optional<SoyMapData> soyData = objectToSoyDataConverter.toSoyMap(model); assertTrue(soyData.isPresent()); SoyMapData data = soyData.get(); assertEquals(keyValue, dat... | @Override public Optional<SoyMapData> toSoyMap(final Object model) throws Exception { if (model == null) { return Optional.absent(); } return Optional.fromNullable(objectToSoyDataMap(model)); } | DefaultToSoyDataConverter implements ToSoyDataConverter { @Override public Optional<SoyMapData> toSoyMap(final Object model) throws Exception { if (model == null) { return Optional.absent(); } return Optional.fromNullable(objectToSoyDataMap(model)); } } | DefaultToSoyDataConverter implements ToSoyDataConverter { @Override public Optional<SoyMapData> toSoyMap(final Object model) throws Exception { if (model == null) { return Optional.absent(); } return Optional.fromNullable(objectToSoyDataMap(model)); } DefaultToSoyDataConverter(); } | DefaultToSoyDataConverter implements ToSoyDataConverter { @Override public Optional<SoyMapData> toSoyMap(final Object model) throws Exception { if (model == null) { return Optional.absent(); } return Optional.fromNullable(objectToSoyDataMap(model)); } DefaultToSoyDataConverter(); void setIgnorablePropertiesMatcher(
... | DefaultToSoyDataConverter implements ToSoyDataConverter { @Override public Optional<SoyMapData> toSoyMap(final Object model) throws Exception { if (model == null) { return Optional.absent(); } return Optional.fromNullable(objectToSoyDataMap(model)); } DefaultToSoyDataConverter(); void setIgnorablePropertiesMatcher(
... |
@Test(expected = IllegalArgumentException.class) public void testToSoyCompatibleMapWhenNotMap() throws Exception { String test = "won't work"; objectToSoyDataConverter.toSoyCompatibleMap(test); } | @SuppressWarnings("unchecked") protected Map<String, ?> toSoyCompatibleMap(final Object obj) throws Exception { Object ret = toSoyCompatibleObjects(obj); if (!(ret instanceof Map)) { throw new IllegalArgumentException("Input should be a Map or POJO."); } return (Map<String, ?>) ret; } | DefaultToSoyDataConverter implements ToSoyDataConverter { @SuppressWarnings("unchecked") protected Map<String, ?> toSoyCompatibleMap(final Object obj) throws Exception { Object ret = toSoyCompatibleObjects(obj); if (!(ret instanceof Map)) { throw new IllegalArgumentException("Input should be a Map or POJO."); } return ... | DefaultToSoyDataConverter implements ToSoyDataConverter { @SuppressWarnings("unchecked") protected Map<String, ?> toSoyCompatibleMap(final Object obj) throws Exception { Object ret = toSoyCompatibleObjects(obj); if (!(ret instanceof Map)) { throw new IllegalArgumentException("Input should be a Map or POJO."); } return ... | DefaultToSoyDataConverter implements ToSoyDataConverter { @SuppressWarnings("unchecked") protected Map<String, ?> toSoyCompatibleMap(final Object obj) throws Exception { Object ret = toSoyCompatibleObjects(obj); if (!(ret instanceof Map)) { throw new IllegalArgumentException("Input should be a Map or POJO."); } return ... | DefaultToSoyDataConverter implements ToSoyDataConverter { @SuppressWarnings("unchecked") protected Map<String, ?> toSoyCompatibleMap(final Object obj) throws Exception { Object ret = toSoyCompatibleObjects(obj); if (!(ret instanceof Map)) { throw new IllegalArgumentException("Input should be a Map or POJO."); } return ... |
@Test public void testToSoyCompatibleObjectsWhenObjectIsNull() throws Exception { Object testObject = objectToSoyDataConverter .toSoyCompatibleObjects(null); assertNull(testObject); } | protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj instanceof Map) { @SuppressWarnings("unchecked") Map<String, O... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... |
@Test public void testToSoyCompatibleObjectsWhenObjectIsString() throws Exception { String testInput = "test"; Object testObject = objectToSoyDataConverter .toSoyCompatibleObjects(testInput); assertEquals("test", testObject.toString()); } | protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj instanceof Map) { @SuppressWarnings("unchecked") Map<String, O... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... |
@Test public void testToSoyCompatibleObjectsWhenObjectIsEnum() throws Exception { MyEnum testInput = MyEnum.A; Object testObject = objectToSoyDataConverter .toSoyCompatibleObjects(testInput); assertEquals("A", testObject.toString()); } | protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj instanceof Map) { @SuppressWarnings("unchecked") Map<String, O... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... |
@Test public void testToSoyCompatibleObjectsWhenObjectIsWrapperType() throws Exception { Integer testInput = 42; Object testObject = objectToSoyDataConverter .toSoyCompatibleObjects(testInput); assertTrue(testObject instanceof Integer); assertEquals(testInput, (Integer) testObject); } | protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj instanceof Map) { @SuppressWarnings("unchecked") Map<String, O... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... |
@Test public void testToSoyCompatibleObjectsWhenObjectIsIterable() throws Exception { List<String> testInput = new ArrayList<String>(); testInput.add("test"); Object testObject = objectToSoyDataConverter .toSoyCompatibleObjects(testInput); assertTrue(testObject instanceof Iterable<?>); @SuppressWarnings("unchecked") Li... | protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj instanceof Map) { @SuppressWarnings("unchecked") Map<String, O... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... |
@Test public void testToSoyCompatibleObjectsWhenObjectIsArray() throws Exception { String[] testInput = new String[] { "test" }; Object testObject = objectToSoyDataConverter .toSoyCompatibleObjects(testInput); assertTrue(testObject.getClass().isArray()); String[] actual = (String[]) testObject; assertEquals(1, actual.l... | protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj instanceof Map) { @SuppressWarnings("unchecked") Map<String, O... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... |
@SuppressWarnings("unchecked") @Test public void testToSoyCompatibleObjectsWhenObjectIsPojo() throws Exception { PojoTest testInput = new PojoTest(); Object testObject = objectToSoyDataConverter .toSoyCompatibleObjects(testInput); assertTrue(testObject instanceof Map); assertEquals("test", ((Map<String, String>) testOb... | protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj instanceof Map) { @SuppressWarnings("unchecked") Map<String, O... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... |
@Test public void testObjectToSoyDataMapWhenObjectIsNull() throws Exception { SoyMapData testObject = objectToSoyDataConverter .objectToSoyDataMap(null); assertTrue(testObject instanceof SoyMapData); } | protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } } | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } DefaultToSoyDataConverter(); } | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } DefaultToSoyDataConverter(); void s... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } DefaultToSoyDataConverter(); void s... |
@Test @Ignore public void testCompileJs2() throws Exception { final String templateName1 = "templates/template1.soy"; final String templateName2 = "templates/template2.soy"; final String jsData1 = "jsData1"; final String jsData2 = "jsData2"; final HttpServletRequest request = mock(HttpServletRequest.class); when(locale... | @RequestMapping(value="/soy/compileJs", method=GET) public ResponseEntity<String> compile(@RequestParam(required = false, value="hash", defaultValue = "") final String hash, @RequestParam(required = true, value = "file") final String[] templateFileNames, @RequestParam(required = false, value = "locale") String locale, ... | SoyAjaxController { @RequestMapping(value="/soy/compileJs", method=GET) public ResponseEntity<String> compile(@RequestParam(required = false, value="hash", defaultValue = "") final String hash, @RequestParam(required = true, value = "file") final String[] templateFileNames, @RequestParam(required = false, value = "loca... | SoyAjaxController { @RequestMapping(value="/soy/compileJs", method=GET) public ResponseEntity<String> compile(@RequestParam(required = false, value="hash", defaultValue = "") final String hash, @RequestParam(required = true, value = "file") final String[] templateFileNames, @RequestParam(required = false, value = "loca... | SoyAjaxController { @RequestMapping(value="/soy/compileJs", method=GET) public ResponseEntity<String> compile(@RequestParam(required = false, value="hash", defaultValue = "") final String hash, @RequestParam(required = true, value = "file") final String[] templateFileNames, @RequestParam(required = false, value = "loca... | SoyAjaxController { @RequestMapping(value="/soy/compileJs", method=GET) public ResponseEntity<String> compile(@RequestParam(required = false, value="hash", defaultValue = "") final String hash, @RequestParam(required = true, value = "file") final String[] templateFileNames, @RequestParam(required = false, value = "loca... |
@Test public void testObjectToSoyDataMapWhenObjectIsSoyMapData() throws Exception { SoyMapData testInput = new SoyMapData(); testInput.putSingle(key, SoyData.createFromExistingData(keyValue)); SoyMapData testObject = objectToSoyDataConverter .objectToSoyDataMap(testInput); assertTrue(testObject instanceof SoyMapData); ... | protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } } | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } DefaultToSoyDataConverter(); } | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } DefaultToSoyDataConverter(); void s... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } DefaultToSoyDataConverter(); void s... |
@Test public void testObjectToSoyDataMapWhenObjectIsMap() throws Exception { Map<String, String> testInput = new HashMap<String, String>(); testInput.put(key, keyValue); SoyMapData testObject = objectToSoyDataConverter .objectToSoyDataMap(testInput); assertTrue(testObject instanceof SoyMapData); assertEquals(keyValue, ... | protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } } | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } DefaultToSoyDataConverter(); } | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } DefaultToSoyDataConverter(); void s... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected SoyMapData objectToSoyDataMap(Object obj) throws Exception { if (obj == null) { return new SoyMapData(); } if (obj instanceof SoyMapData) { return (SoyMapData) obj; } return new SoyMapData(toSoyCompatibleMap(obj)); } DefaultToSoyDataConverter(); void s... |
@Test public void testObjectToSoyDataMapWhenObjectIsCallable() throws Exception { Callable<String> testInput = new Callable<String>() { @Override public String call() throws Exception { return "test"; } }; Object testObject = objectToSoyDataConverter .toSoyCompatibleObjects(testInput); assertEquals("test", testObject.t... | protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj instanceof Map) { @SuppressWarnings("unchecked") Map<String, O... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... | DefaultToSoyDataConverter implements ToSoyDataConverter { protected Object toSoyCompatibleObjects(Object obj) throws Exception { if (obj == null) { return obj; } if (Primitives.isWrapperType(obj.getClass()) || obj instanceof String) { return obj; } if(obj.getClass().isEnum()) { return ((Enum)obj).name(); } if (obj inst... |
@Test public void testShouldNotReturnNull() throws Exception { Assert.assertNotNull(emptyLocaleProvider.resolveLocale(null)); } | @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.absent(); } | EmptyLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.absent(); } } | EmptyLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.absent(); } } | EmptyLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.absent(); } @Override Optional<Locale> resolveLocale(final HttpServletRequest request); } | EmptyLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.absent(); } @Override Optional<Locale> resolveLocale(final HttpServletRequest request); } |
@Test public void testDefaultAbsent() throws Exception { Assert.assertFalse("locale should be absent", emptyLocaleProvider.resolveLocale(null).isPresent()); } | @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.absent(); } | EmptyLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.absent(); } } | EmptyLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.absent(); } } | EmptyLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.absent(); } @Override Optional<Locale> resolveLocale(final HttpServletRequest request); } | EmptyLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.absent(); } @Override Optional<Locale> resolveLocale(final HttpServletRequest request); } |
@Test public void testShouldNotReturnNull() throws Exception { Assert.assertTrue("should return value", defaultLocaleProvider.resolveLocale(null).isPresent()); } | @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } | DefaultLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } } | DefaultLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } DefaultLocaleProvider(Locale locale); DefaultLocaleProvider(); } | DefaultLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } DefaultLocaleProvider(Locale locale); DefaultLocaleProvider(); @Override Optional<Locale> resolveLocale(final HttpServletRequest request); void s... | DefaultLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } DefaultLocaleProvider(Locale locale); DefaultLocaleProvider(); @Override Optional<Locale> resolveLocale(final HttpServletRequest request); void s... |
@Test public void shouldReturnUsDefault() throws Exception { Assert.assertEquals("should return absent", Locale.US, defaultLocaleProvider.resolveLocale(request).get()); } | @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } | DefaultLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } } | DefaultLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } DefaultLocaleProvider(Locale locale); DefaultLocaleProvider(); } | DefaultLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } DefaultLocaleProvider(Locale locale); DefaultLocaleProvider(); @Override Optional<Locale> resolveLocale(final HttpServletRequest request); void s... | DefaultLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } DefaultLocaleProvider(Locale locale); DefaultLocaleProvider(); @Override Optional<Locale> resolveLocale(final HttpServletRequest request); void s... |
@Test public void shouldThrowNPE() throws Exception { try { acceptHeaderLocaleProvider.resolveLocale(null); fail("npe should be thrown"); } catch (Exception ex) { } } | public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } | AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } } | AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } } | AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } Optional<Locale> resolveLocale(final HttpServletRequest request); } | AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } Optional<Locale> resolveLocale(final HttpServletRequest request); } |
@Test public void shouldReturnLocale() throws Exception { when(request.getLocale()).thenReturn(Locale.GERMAN); final Optional<Locale> localeOptional = acceptHeaderLocaleProvider.resolveLocale(request); Assert.assertTrue("locale should be present", localeOptional.isPresent()); Assert.assertEquals("locale should be Germa... | public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } | AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } } | AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } } | AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } Optional<Locale> resolveLocale(final HttpServletRequest request); } | AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } Optional<Locale> resolveLocale(final HttpServletRequest request); } |
@Test public void testDefaultDebug() throws Exception { Assert.assertFalse("debug is off by default", defaultTemplateRenderer.isHotReloadMode()); } | public boolean isHotReloadMode() { return hotReloadMode; } | DefaultTemplateRenderer implements TemplateRenderer { public boolean isHotReloadMode() { return hotReloadMode; } } | DefaultTemplateRenderer implements TemplateRenderer { public boolean isHotReloadMode() { return hotReloadMode; } } | DefaultTemplateRenderer implements TemplateRenderer { public boolean isHotReloadMode() { return hotReloadMode; } @Override void render(final RenderRequest renderRequest); void setToSoyDataConverter(final ToSoyDataConverter toSoyDataConverter); void setHotReloadMode(boolean hotReloadMode); boolean isHotReloadMode(); bo... | DefaultTemplateRenderer implements TemplateRenderer { public boolean isHotReloadMode() { return hotReloadMode; } @Override void render(final RenderRequest renderRequest); void setToSoyDataConverter(final ToSoyDataConverter toSoyDataConverter); void setHotReloadMode(boolean hotReloadMode); boolean isHotReloadMode(); bo... |
@Test public void testDefault() throws Exception { Assert.assertFalse("should not allow by default", configurableAuthManager.isAllowed("template")); } | @Override public boolean isAllowed(final String url) { return allowedTemplates.contains(url); } | ConfigurableAuthManager implements AuthManager { @Override public boolean isAllowed(final String url) { return allowedTemplates.contains(url); } } | ConfigurableAuthManager implements AuthManager { @Override public boolean isAllowed(final String url) { return allowedTemplates.contains(url); } ConfigurableAuthManager(List<String> allowedTemplates); ConfigurableAuthManager(); } | ConfigurableAuthManager implements AuthManager { @Override public boolean isAllowed(final String url) { return allowedTemplates.contains(url); } ConfigurableAuthManager(List<String> allowedTemplates); ConfigurableAuthManager(); void setAllowedTemplates(final List<String> allowedTemplates); @Override boolean isAllowed(... | ConfigurableAuthManager implements AuthManager { @Override public boolean isAllowed(final String url) { return allowedTemplates.contains(url); } ConfigurableAuthManager(List<String> allowedTemplates); ConfigurableAuthManager(); void setAllowedTemplates(final List<String> allowedTemplates); @Override boolean isAllowed(... |
@Test public void testThrowsNPE() throws Exception { try { defaultTemplateRenderer.render(null); fail("should throw NPE"); } catch (NullPointerException ex) { } } | @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderRequest.getCompiledTemplates().get(); final String template... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... |
@Test public void testDontRenderWithoutCompiledTemplates() throws Exception { final RenderRequest renderRequest = mock(RenderRequest.class); final HttpServletResponse httpServletResponse = mock(HttpServletResponse.class); when(renderRequest.getCompiledTemplates()).thenReturn(Optional.<SoyTofu>absent()); when(renderRequ... | @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderRequest.getCompiledTemplates().get(); final String template... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... |
@Test public void testRenderWithoutAnyDataWithoutDebug() throws Exception { final Object domainMock = new Object(); final RenderRequest renderRequest = mock(RenderRequest.class); final SoyTofu soyTofu = mock(SoyTofu.class); final PrintWriter printWriter = mock(PrintWriter.class); final HttpServletResponse response = mo... | @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderRequest.getCompiledTemplates().get(); final String template... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... | DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderReque... |
@Test public void testName() throws Exception { emptyTemplateRenderer.render(renderRequest); Mockito.verifyZeroInteractions(renderRequest); } | @Override public void render(final RenderRequest renderRequest) throws Exception { } | EmptyTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { } } | EmptyTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { } } | EmptyTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { } @Override void render(final RenderRequest renderRequest); } | EmptyTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { } @Override void render(final RenderRequest renderRequest); } |
@Test public void testContentTypesWhenAcceptHeader() { when(req.getParameter(DEFAULT_FAVORED_PARAMETER_NAME)).thenReturn("text/html"); when(req.getHeaders(ACCEPT_HEADER)).thenReturn(enumeration(asList("text/html", "text/plain"))); assertEquals(asList("text/html", "text/plain"), contentNegotiator.contentTypes()); } | @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHeaderValues(request); } if (isEmpty(contentTypes)) { logge... | DefaultContentNegotiator implements ContentNegotiator { @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHea... | DefaultContentNegotiator implements ContentNegotiator { @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHea... | DefaultContentNegotiator implements ContentNegotiator { @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHea... | DefaultContentNegotiator implements ContentNegotiator { @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHea... |
@Test public void testContentTypesWhenNeedsSplit() { when(req.getHeaders(ACCEPT_HEADER)).thenReturn( enumeration(asList("text/html,application/xhtml+xml,application/xml;q=0.9"))); assertEquals(asList("text/html", "application/xhtml+xml", "application/xml;q=0.9"), contentNegotiator.contentTypes()); } | @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHeaderValues(request); } if (isEmpty(contentTypes)) { logge... | DefaultContentNegotiator implements ContentNegotiator { @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHea... | DefaultContentNegotiator implements ContentNegotiator { @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHea... | DefaultContentNegotiator implements ContentNegotiator { @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHea... | DefaultContentNegotiator implements ContentNegotiator { @Override public List<String> contentTypes() { List<String> contentTypes = null; final HttpServletRequest request = getHttpRequest(); if (favorParameterOverAcceptHeader) { contentTypes = getFavoredParameterValueAsList(request); } else { contentTypes = getAcceptHea... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.