~ubuntu-branches/ubuntu/utopic/build-helper-maven-plugin/utopic

« back to all changes in this revision

Viewing changes to src/it/timestamp-regex/verify.bsh

  • Committer: Package Import Robot
  • Author(s): tony mancill, Emmanuel Bourg, tony mancill
  • Date: 2013-06-01 20:19:34 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130601201934-hzv7zmdcgazfyupp
Tags: 1.7-1
[ Emmanuel Bourg ]
* Team upload.
* New upstream release
* Set the compiler source/target to 1.5
* Updated Standards-Version to 3.9.4 (no changes)
* debian/copyright:
  - Updated the Format URI to 1.0
  - Removed the duplicate Copyright fields

[ tony mancill ]
* debian/control:
  - Add libmaven-invoker-plugin-java to build-depends-indep.
  - Wrap long lines.
  - Update Vcs-Git URL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import java.io.*;
 
2
import java.util.*;
 
3
import java.util.regex.*;
 
4
 
 
5
try
 
6
{
 
7
    File file = new File( basedir, "target/classes/test.properties" );
 
8
    Properties p = new Properties();
 
9
    p.load( new FileInputStream( file ) );
 
10
    String value = p.getProperty( "version" );
 
11
 
 
12
    if ( value.indexOf( "${build.version}" ) >= 0 )
 
13
    {
 
14
        System.err.println( "Timestamp not set" );
 
15
        return false;
 
16
    }
 
17
    Pattern regex = Pattern.compile( "\\d\\d:\\d\\d \\d\\d-\\d\\d-\\d\\d\\d\\d" );
 
18
    if ( !regex.matcher( value ).find() )
 
19
    {
 
20
        System.err.println( "Formatted timestamp not in property" );
 
21
        return false;
 
22
    }
 
23
}
 
24
catch( Throwable t )
 
25
{
 
26
    t.printStackTrace();
 
27
    return false;
 
28
}
 
29
 
 
30
return true;