mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-03 00:29:21 +01:00
Added HostDependentDownloadableContributionTest
This commit is contained in:
parent
e5e5880a15
commit
64e6edde96
@ -0,0 +1,28 @@
|
|||||||
|
package cc.arduino.packages.contributions;
|
||||||
|
|
||||||
|
public class HostDependentDownloadableContributionStub extends HostDependentDownloadableContribution {
|
||||||
|
@Override
|
||||||
|
public String getHost() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUrl() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getChecksum() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getSize() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getArchiveFileName() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package cc.arduino.packages.contributions;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
public class HostDependentDownloadableContributionTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void macOsXPositiveTest() {
|
||||||
|
HostDependentDownloadableContributionStub contribution = new HostDependentDownloadableContributionStub() {
|
||||||
|
@Override
|
||||||
|
public String getHost() {
|
||||||
|
return "x86_64-apple-darwin";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
System.setProperty("os.name", "Mac OS X");
|
||||||
|
System.setProperty("os.arch", "x86_64");
|
||||||
|
|
||||||
|
assertTrue(contribution.isCompatible());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void macOsXNegativeTest() {
|
||||||
|
HostDependentDownloadableContributionStub contribution = new HostDependentDownloadableContributionStub() {
|
||||||
|
@Override
|
||||||
|
public String getHost() {
|
||||||
|
return "x86_64-apple-darwin";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
System.setProperty("os.name", "Linux");
|
||||||
|
System.setProperty("os.arch", "amd64");
|
||||||
|
|
||||||
|
assertFalse(contribution.isCompatible());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void macOsXNegativeTest2() {
|
||||||
|
HostDependentDownloadableContributionStub contribution = new HostDependentDownloadableContributionStub() {
|
||||||
|
@Override
|
||||||
|
public String getHost() {
|
||||||
|
return "x86_64-apple-darwin";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
System.setProperty("os.name", "Mac OS X");
|
||||||
|
System.setProperty("os.arch", "i686");
|
||||||
|
|
||||||
|
assertFalse(contribution.isCompatible());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user