Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 808c5d70085d0ba720f3d6da2f2c66c8f911eca1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*******************************************************************************
 * Copyright (c) 2007 Innoopract Informationssysteme GmbH
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Innoopract - initial API and implementation
 *******************************************************************************/
package org.eclipse.epp.packaging.core.configuration;

import org.eclipse.epp.packaging.core.configuration.Platform;

import junit.framework.Assert;
import junit.framework.TestCase;

/**Test class */
public class Platform_Test extends TestCase {

  public void testEquals() throws Exception {
    Platform platform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    Platform secondPlatform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    assertTrue( platform.equals( secondPlatform ) );
  }

  public void testToString() throws Exception {
    Platform platform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    Assert.assertEquals( "win32,win32,x86", platform.toString() ); //$NON-NLS-1$
  }

  public void testAdvancedToString() throws Exception {
    Platform platform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    Assert.assertEquals( "win32nwin32nx86", platform.toString( 'n' ) ); //$NON-NLS-1$
  }

  public void testDefaultArchiveFormat() {
    Platform platform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    Assert.assertEquals( "antZip", platform.getArchiveFormat().name() ); //$NON-NLS-1$
  }

  public void testSetArchiveFormat() throws Exception {
    Platform platform = new Platform( "win32", "win32", "x86", null, null ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    platform.setArchiveFormat( "tar" ); //$NON-NLS-1$
    Assert.assertEquals( "tar", platform.getArchiveFormat().name() ); //$NON-NLS-1$
  }
}

Back to the top