Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 374782
Collapse All | Expand All

(-)src/org/eclipse/rwt/internal/branding/TestBranding.java (-6 / +20 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2011 EclipseSource and others.
2
 * Copyright (c) 2011, 2012 EclipseSource and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 29-77 Link Here
29
29
30
  public TestBranding() {
30
  public TestBranding() {
31
  }
31
  }
32
  
32
33
  public TestBranding( String servletName, String[] entryPoints, String defaultEntryPoint ) {
33
  public TestBranding( String servletName, String[] entryPoints, String defaultEntryPoint ) {
34
    this.servletName = servletName;
34
    this.servletName = servletName;
35
    this.entryPoints = entryPoints;
35
    this.entryPoints = entryPoints;
36
    this.defaultEntryPoint = defaultEntryPoint;
36
    this.defaultEntryPoint = defaultEntryPoint;
37
  }
37
  }
38
38
39
  @Override
39
  public String getId() {
40
  public String getId() {
40
    return TestBranding.class.getName();
41
    return TestBranding.class.getName();
41
  }
42
  }
42
43
44
  @Override
43
  public String[] getEntryPoints() {
45
  public String[] getEntryPoints() {
44
    return entryPoints;
46
    return entryPoints;
45
  }
47
  }
46
48
49
  @Override
47
  public String getServletName() {
50
  public String getServletName() {
48
    return servletName;
51
    return servletName;
49
  }
52
  }
50
53
54
  @Override
51
  public String getDefaultEntryPoint() {
55
  public String getDefaultEntryPoint() {
52
    return defaultEntryPoint;
56
    return defaultEntryPoint;
53
  }
57
  }
54
58
59
  @Override
55
  public String getBody() {
60
  public String getBody() {
56
    return null;
61
    return null;
57
  }
62
  }
58
  
63
64
  @Override
59
  public boolean showExitConfirmation() {
65
  public boolean showExitConfirmation() {
60
    return showExitConf;
66
    return showExitConf;
61
  }
67
  }
62
  
68
69
  @Override
63
  public String getExitConfirmationText() {
70
  public String getExitConfirmationText() {
64
    return exitConfMessage;
71
    return exitConfMessage;
65
  }
72
  }
66
  
73
74
  public void setFavIcon( String favIcon ) {
75
    this.favIcon = favIcon;
76
  }
77
78
  @Override
67
  public String getFavIcon() {
79
  public String getFavIcon() {
68
    return favIcon;
80
    return favIcon;
69
  }
81
  }
70
  
82
83
  @Override
71
  public Header[] getHeaders() {
84
  public Header[] getHeaders() {
72
    return headers;
85
    return headers;
73
  }
86
  }
74
87
88
  @Override
75
  @SuppressWarnings("deprecation")
89
  @SuppressWarnings("deprecation")
76
  public void registerResources() throws IOException {
90
  public void registerResources() throws IOException {
77
    registerResourcesCallCount++;
91
    registerResourcesCallCount++;
(-)src/org/eclipse/rwt/internal/service/StartupPageConfigurer_Test.java (+14 lines)
Lines 22-27 Link Here
22
import org.eclipse.rap.rwt.testfixture.TestResponse;
22
import org.eclipse.rap.rwt.testfixture.TestResponse;
23
import org.eclipse.rwt.client.WebClient;
23
import org.eclipse.rwt.client.WebClient;
24
import org.eclipse.rwt.internal.application.RWTFactory;
24
import org.eclipse.rwt.internal.application.RWTFactory;
25
import org.eclipse.rwt.internal.branding.TestBranding;
25
import org.eclipse.rwt.internal.lifecycle.TestEntryPoint;
26
import org.eclipse.rwt.internal.lifecycle.TestEntryPoint;
26
import org.eclipse.rwt.internal.resources.ResourceRegistry;
27
import org.eclipse.rwt.internal.resources.ResourceRegistry;
27
import org.eclipse.rwt.internal.theme.ThemeTestUtil;
28
import org.eclipse.rwt.internal.theme.ThemeTestUtil;
Lines 126-131 Link Here
126
                               + " href=\"rwt-resources/images/site-icon.png\" />" ) );
127
                               + " href=\"rwt-resources/images/site-icon.png\" />" ) );
127
  }
128
  }
128
129
130
  public void testFavIconFromBranding() throws IOException {
131
    Map<String, String> properties = new HashMap<String, String>();
132
    RWTFactory.getEntryPointManager().registerByPath( "/rap", TestEntryPoint.class, properties );
133
    TestBranding branding = new TestBranding( "rap", null, null );
134
    branding.setFavIcon( "site-icon.png" );
135
    RWTFactory.getBrandingManager().register( branding );
136
137
    String page = getContent( new StartupPageConfigurer( new ResourceRegistry() ).getTemplate() );
138
139
    assertTrue( page.contains( "<link rel=\"shortcut icon\" type=\"image/x-icon\""
140
                               + " href=\"rwt-resources/site-icon.png\" />" ) );
141
  }
142
129
  private static String getContent( StartupPageTemplateHolder template ) {
143
  private static String getContent( StartupPageTemplateHolder template ) {
130
    StringBuilder builder = new StringBuilder();
144
    StringBuilder builder = new StringBuilder();
131
    for( String token : template.getTokens() ) {
145
    for( String token : template.getTokens() ) {

Return to bug 374782