~ubuntu-branches/ubuntu/precise/apgdiff/precise

« back to all changes in this revision

Viewing changes to src/test/java/cz/startnet/utils/pgdiff/parsers/ParserUtilsTest.java

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2009-06-22 01:09:18 UTC
  • mfrom: (2.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090622010918-y73rbzpqpe4gdc0z
Tags: 1.3-1ubuntu1
* Merge from debian unstable (LP: #390146), remaining changes:
  - Add default-jdk to Build-Depends.
  - Change the runtime dependency from gij to default-jre-headless.
* debian/control: Added Build-Depends-Indep on
  - asciidoc, contains a2x, required for the build process.
  - libxml2-utils, eliminates a2x message 'xmllint not found' during build
    process.
* debian/apgdiff.1.txt: Changed deprecated glossary list syntax.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id$
 
3
 */
 
4
package cz.startnet.utils.pgdiff.parsers;
 
5
 
 
6
import org.hamcrest.core.IsEqual;
 
7
import org.junit.Assert;
 
8
import org.junit.Test;
 
9
 
 
10
/**
 
11
 * Tests {@link ParserUtils}.
 
12
 *
 
13
 * @author fordfrog
 
14
 * @version $Id$
 
15
 */
 
16
public class ParserUtilsTest {
 
17
 
 
18
    /**
 
19
     * Tests getting of command length if more single quotes and commas are
 
20
     * present.
 
21
     */
 
22
    @Test(timeout = 1000)
 
23
    public void getCommandEndSingleQuotes() {
 
24
        final int result =
 
25
                ParserUtils.getCommandEnd(
 
26
                "CREATE TABLE user_preferences (exboxes text " +
 
27
                "DEFAULT '''test1'',''test2'',''test3'',''test4'''::text )",
 
28
                31);
 
29
        Assert.assertThat(result, IsEqual.equalTo(100));
 
30
    }
 
31
}