Skip to content

Commit

Permalink
Issue jcabi#174 - Inserting correct version/buildnumber here and...
Browse files Browse the repository at this point in the history
  • Loading branch information
pecko committed Sep 28, 2015
1 parent 1bacbe4 commit c60618a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/main/java/com/jcabi/aspects/aj/ImmutabilityChecker.java
Expand Up @@ -62,10 +62,6 @@ public final class ImmutabilityChecker {
*
* <p>Try NOT to change the signature of this method, in order to keep
* it backward compatible.
* @todo #167:30min Inserting correct version/buildnumber
* here and in other instances where Version.CURRENT is
* used (not only in this class, but in every class that
* uses Version.CURRENT) should be covered by a test.
* @param point Joint point
*/
@After("initialization((@com.jcabi.aspects.Immutable *).new(..))")
Expand Down
31 changes: 31 additions & 0 deletions src/test/java/com/jcabi/aspects/ImmutableTest.java
Expand Up @@ -30,6 +30,8 @@
package com.jcabi.aspects;

import java.util.regex.Pattern;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Test;

/**
Expand Down Expand Up @@ -88,6 +90,35 @@ public void catchesTypesMutableByClassInheritance() {
new MutableByInheritance();
}

/**
* Test Version.
*/
@Test
public void testVersion() {
try {
new Mutable();
} catch (final IllegalStateException ex) {
MatcherAssert.assertThat(
ex.getMessage(),
Matchers.not(
Matchers.containsString(
"${projectVersion}"
)
)
);
MatcherAssert.assertThat(
ex.getMessage(),
Matchers.not(
Matchers.containsString(
"${buildNumber}"
)
)
);
return;
}
MatcherAssert.assertThat("should not happen.", false);
}

/**
* Supposedly immutable class.
*/
Expand Down

0 comments on commit c60618a

Please sign in to comment.