Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/OldServer/src/org/litesoft/GWT/server/EBSIDefPlusTest.java

Diff revisions: vs.
  @@ -1,49 +1,49 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.GWT.server;
3 -
4 - import org.litesoft.GWT.ebiconservice.client.*;
5 -
6 - import junit.framework.*;
7 -
8 - public class EBSIDefPlusTest extends TestCase {
9 - public static Test suite() {
10 - return new TestSuite( EBSIDefPlusTest.class );
11 - }
12 -
13 - public EBSIDefPlusTest( String name ) {
14 - super( name );
15 - }
16 -
17 - public static void main( String[] args ) {
18 - junit.textui.TestRunner.run( suite() );
19 - }
20 -
21 - private void assertMatches( String pFloaterFactoryRefPattern, String pFloaterTitlePattern,
22 - String pFloaterFactoryRef, String pFloaterTitle ) {
23 - EBIconService.EBISDefPlus zPlus = new EBIconService.EBISDefPlus( new EBIconServiceDefinition(
24 - pFloaterFactoryRefPattern, pFloaterTitlePattern, "small", "large", "title" ) );
25 - if ( !zPlus.matches( pFloaterFactoryRef, pFloaterTitle ) ) {
26 - fail( "!match( \"" + pFloaterFactoryRefPattern + "\", \"" + pFloaterTitlePattern + "\", \"" +
27 - pFloaterFactoryRef + "\", \"" + pFloaterTitle + "\" )" );
28 - }
29 - }
30 -
31 - private void assertNotMatches( String pFloaterFactoryRefPattern, String pFloaterTitlePattern,
32 - String pFloaterFactoryRef, String pFloaterTitle ) {
33 - EBIconService.EBISDefPlus zPlus = new EBIconService.EBISDefPlus( new EBIconServiceDefinition(
34 - pFloaterFactoryRefPattern, pFloaterTitlePattern, "small", "large", "title" ) );
35 - if ( zPlus.matches( pFloaterFactoryRef, pFloaterTitle ) ) {
36 - fail( "match( \"" + pFloaterFactoryRefPattern + "\", \"" + pFloaterTitlePattern + "\", \"" +
37 - pFloaterFactoryRef + "\", \"" + pFloaterTitle + "\" )" );
38 - }
39 - }
40 -
41 - public void test_it()
42 - throws Exception {
43 - assertMatches( "*", "*", "NewsArticle", "" );
44 - assertMatches( "NewsArticle", "*", "NewsArticle", "" );
45 - assertNotMatches( "NewsArticle", "*My Investigation*", "NewsArticle", "" );
46 - assertMatches( "NewsArticle", "*My Investigation*", "NewsArticle", "My Investigations" );
47 - assertNotMatches( "Todo*", "*", "NewsArticle", "" );
48 - }
49 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.GWT.server;
3 +
4 + import org.litesoft.GWT.ebiconservice.client.*;
5 +
6 + import junit.framework.*;
7 +
8 + public class EBSIDefPlusTest extends TestCase {
9 + public static Test suite() {
10 + return new TestSuite( EBSIDefPlusTest.class );
11 + }
12 +
13 + public EBSIDefPlusTest( String name ) {
14 + super( name );
15 + }
16 +
17 + public static void main( String[] args ) {
18 + junit.textui.TestRunner.run( suite() );
19 + }
20 +
21 + private void assertMatches( String pFloaterFactoryRefPattern, String pFloaterTitlePattern,
22 + String pFloaterFactoryRef, String pFloaterTitle ) {
23 + EBIconService.EBISDefPlus zPlus = new EBIconService.EBISDefPlus( new EBIconServiceDefinition(
24 + pFloaterFactoryRefPattern, pFloaterTitlePattern, "small", "large", "title" ) );
25 + if ( !zPlus.matches( pFloaterFactoryRef, pFloaterTitle ) ) {
26 + fail( "!match( \"" + pFloaterFactoryRefPattern + "\", \"" + pFloaterTitlePattern + "\", \"" +
27 + pFloaterFactoryRef + "\", \"" + pFloaterTitle + "\" )" );
28 + }
29 + }
30 +
31 + private void assertNotMatches( String pFloaterFactoryRefPattern, String pFloaterTitlePattern,
32 + String pFloaterFactoryRef, String pFloaterTitle ) {
33 + EBIconService.EBISDefPlus zPlus = new EBIconService.EBISDefPlus( new EBIconServiceDefinition(
34 + pFloaterFactoryRefPattern, pFloaterTitlePattern, "small", "large", "title" ) );
35 + if ( zPlus.matches( pFloaterFactoryRef, pFloaterTitle ) ) {
36 + fail( "match( \"" + pFloaterFactoryRefPattern + "\", \"" + pFloaterTitlePattern + "\", \"" +
37 + pFloaterFactoryRef + "\", \"" + pFloaterTitle + "\" )" );
38 + }
39 + }
40 +
41 + public void test_it()
42 + throws Exception {
43 + assertMatches( "*", "*", "NewsArticle", "" );
44 + assertMatches( "NewsArticle", "*", "NewsArticle", "" );
45 + assertNotMatches( "NewsArticle", "*My Investigation*", "NewsArticle", "" );
46 + assertMatches( "NewsArticle", "*My Investigation*", "NewsArticle", "My Investigations" );
47 + assertNotMatches( "Todo*", "*", "NewsArticle", "" );
48 + }
49 + }