Blame | Last modification | View Log | RSS feed
package com.erggroup.buildtool.utf;import static org.junit.Assert.*;import java.io.File;import java.io.IOException;import org.junit.Test;import com.erggroup.buildtool.daemon.BuildInfo;public class TestBuildInfo {BuildInfo bi = null;Boolean ExceptionSeen = false;/*** Test bad file name*/@Testpublic void badFile(){File bif = new File ("DoesNotExist");try {bi = new BuildInfo(bif);} catch (IOException e) {ExceptionSeen = true;}assertTrue("Properties file does not exist", ExceptionSeen);}/*** Test with a good file name*/@Testpublic void goodFile(){File bif = new File ("work/buildInfo.properties");try {bi = new BuildInfo(bif);} catch (IOException e) {ExceptionSeen = true;}assertFalse("Properties file does exist", ExceptionSeen);}/*** Test basic properties*/@Testpublic void basicProperties(){File bif = new File ("work/buildInfo.properties");try {bi = new BuildInfo(bif);} catch (IOException e) {ExceptionSeen = true;}assertFalse("Unexpected Exception", ExceptionSeen);assertEquals("Style", bi.mStyle, "JANTS");assertEquals("Java Version", bi.mJavaVersion, "1.8");assertFalse("Generic", bi.mGeneric);assertTrue ("Platform Count", bi.mPlatforms.size() == 1);assertArrayEquals("Platforms", new String[] {"JAVA"}, bi.mPlatforms.toArray());assertArrayEquals("Build Platforms", new String[] {"JAVA"}, bi.mBuildPlatforms.toArray());assertTrue ("Build Platforms Contains", bi.mPlatforms.contains("JAVA"));assertFalse("Build Platforms Not Contains", bi.mPlatforms.contains("java"));assertTrue ("Toolsets", bi.mToolsetPlatforms.isEmpty());assertTrue ("Lists 1", bi.mDebugPlatforms.contains("DDDD"));assertTrue ("Lists 2", bi.mDebugPlatforms.contains("EEEE"));assertTrue ("Lists 3", bi.mDebugPlatforms.contains("AAAA"));}}