-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Runer112/dev/issue-2
Issue #2: Fixed to use new String(license.getText()).
- Loading branch information
Showing
2 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
...om/blackducksoftware/sdk/protex/client/examples/test/SampleReportDataLicenseTextTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.blackducksoftware.sdk.protex.client.examples.test; | ||
|
||
import java.io.File; | ||
|
||
import org.testng.annotations.AfterClass; | ||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Test; | ||
|
||
import com.blackducksoftware.sdk.protex.client.examples.report.SampleReportDataLicenseText; | ||
import com.blackducksoftware.sdk.protex.client.examples.test.type.AbstractSdkSampleTest; | ||
import com.blackducksoftware.sdk.protex.client.examples.test.type.TestSources; | ||
import com.blackducksoftware.sdk.protex.client.examples.test.type.Tests; | ||
import com.blackducksoftware.sdk.protex.license.LicenseCategory; | ||
import com.blackducksoftware.sdk.protex.project.AnalysisSourceLocation; | ||
import com.blackducksoftware.sdk.protex.project.ProjectRequest; | ||
|
||
public class SampleReportDataLicenseTextTest extends AbstractSdkSampleTest { | ||
|
||
private String projectId; | ||
|
||
@BeforeClass | ||
protected void createProject() throws Exception { | ||
ProjectRequest projectRequest = new ProjectRequest(); | ||
projectRequest.setName("SampleReportDataLicenseTextTest Project"); | ||
|
||
AnalysisSourceLocation sourceLocation = TestSources.getAnalysisSourceLocation(getProxy()); | ||
|
||
projectRequest.setAnalysisSourceLocation(sourceLocation); | ||
projectRequest.setLicenseId("gpl20"); | ||
|
||
projectId = getProxy().getProjectApi().createProject(projectRequest, LicenseCategory.OPEN_SOURCE); | ||
|
||
TestSources.synchronousSourceScan(getProxy(), projectId, 1000); | ||
} | ||
|
||
@Test(groups = { Tests.SOURCE_DEPENDENT_TEST }) | ||
public void runSample() throws Exception { | ||
File tempFile = File.createTempFile("thing", ".html"); | ||
|
||
String[] args = new String[4]; | ||
args[0] = Tests.getServerUrl(); | ||
args[1] = Tests.getServerUsername(); | ||
args[2] = Tests.getServerPassword(); | ||
args[3] = projectId; | ||
|
||
SampleReportDataLicenseText.main(args); | ||
|
||
tempFile.deleteOnExit(); | ||
} | ||
|
||
@AfterClass(alwaysRun = true) | ||
protected void deleteProject() throws Exception { | ||
if (projectId != null) { | ||
getProxy().getProjectApi().deleteProject(projectId); | ||
} | ||
} | ||
|
||
} |