Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 2b905cb

Browse files
committed
Remove 1.2 commits from master branch.
This reverts commit aed3818.
1 parent b0e47ee commit 2b905cb

File tree

4 files changed

+12
-83
lines changed

4 files changed

+12
-83
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>gov.osti</groupId>
55
<artifactId>doecode</artifactId>
66
<packaging>war</packaging>
7-
<version>1.2</version>
7+
<version>1.1</version>
88
<name>DOE Code Web Application</name>
99
<url>http://maven.apache.org</url>
1010

src/main/java/gov/osti/entity/DOECodeMetadata.java

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -123,33 +123,14 @@ public String label() {
123123
}
124124
}
125125

126-
/**
127-
* Define the valid SOFTWARE TYPES.
128-
*/
129-
public enum Type {
130-
S ("Scientific"),
131-
B ("Business");
132-
133-
private final String label;
134-
135-
private Type(String label) {
136-
this.label = label;
137-
}
138-
139-
public String label() {
140-
return this.label;
141-
}
142-
}
143-
144126
// Attributes
145127
private Long codeId;
146128
private String siteOwnershipCode = null;
147129
private Boolean openSource = null;
148130
private String repositoryLink = null;
149131
private String landingPage = null;
150132
private Accessibility accessibility = null;
151-
// the SOFTWARE TYPE
152-
private Type softwareType;
133+
153134
// set of Access Limitations (Strings)
154135
@JacksonXmlElementWrapper (localName = "accessLimitations")
155136
@JacksonXmlProperty (localName = "accessLimitation")
@@ -685,25 +666,4 @@ void updatedAt() {
685666
public boolean hasSetReleaseDate() {
686667
return setReleaseDate;
687668
}
688-
689-
/**
690-
* Obtain the SOFTWARE TYPE: one of Type.S (scientific) or Type.B (Business)
691-
*
692-
* @return the type the SOFTWARE TYPE
693-
*/
694-
@Basic (optional = false)
695-
@Column (name = "SOFTWARE_TYPE", length = 1)
696-
@Enumerated (EnumType.STRING)
697-
public Type getSoftwareType() {
698-
return softwareType;
699-
}
700-
701-
/**
702-
* Set the SOFTWARE TYPE value.
703-
*
704-
* @param type the type to set
705-
*/
706-
public void setSoftwareType(Type type) {
707-
this.softwareType = type;
708-
}
709669
}

src/main/java/gov/osti/services/Metadata.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,13 +1481,6 @@ else if (m.getLicenses().contains(DOECodeMetadata.License.Other.value()) && Stri
14811481
if (!Validation.isValidUrl(m.getLandingPage()))
14821482
reasons.add("A valid Landing Page URL is required for non-open source submissions.");
14831483
}
1484-
// SOFTWARE TYPE is REQUIRED; BUSINESS type requires SPONSORING ORGANIZATION
1485-
if (null==m.getSoftwareType())
1486-
reasons.add("Software type is required.");
1487-
else if (DOECodeMetadata.Type.B.equals(m.getSoftwareType()))
1488-
if (null==m.getSponsoringOrganizations() || m.getSponsoringOrganizations().isEmpty())
1489-
reasons.add("A sponsor is required for Business software.");
1490-
14911484
// if repository link is present, it needs to be valid too
14921485
if (StringUtils.isNotBlank(m.getRepositoryLink()) && !Validation.isValidRepositoryLink(m.getRepositoryLink()))
14931486
reasons.add("Repository URL is not a valid repository.");

src/test/java/gov/osti/services/MetadataTest.java

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import gov.osti.entity.DOECodeMetadata;
66
import gov.osti.entity.Developer;
7-
import gov.osti.entity.SponsoringOrganization;
87
import java.util.ArrayList;
98
import java.util.Arrays;
109
import java.util.List;
@@ -18,8 +17,7 @@
1817
import org.junit.Test;
1918

2019
/**
21-
* Test various METADATA related functionality.
22-
*
20+
*
2321
* @author ensornl
2422
*/
2523
public class MetadataTest {
@@ -44,10 +42,10 @@ public void tearDown() {
4442
}
4543

4644
/**
47-
* Test that SUBMIT VALIDATIONS work.
45+
* Test that PUBLISHED VALIDATIONS work.
4846
*/
4947
@Test
50-
public void testValidateSubmit() {
48+
public void testValidatePublished() {
5149
DOECodeMetadata m = new DOECodeMetadata();
5250

5351
// empty metadata should have numerous errors
@@ -61,8 +59,7 @@ public void testValidateSubmit() {
6159
"Description is required.",
6260
"A License is required.",
6361
"At least one developer is required.",
64-
"A valid Landing Page URL is required for non-open source submissions.",
65-
"Software type is required."
62+
"A valid Landing Page URL is required for non-open source submissions."
6663
};
6764

6865
for ( String message : validations ) {
@@ -78,7 +75,6 @@ public void testValidateSubmit() {
7875
assertFalse("Still requiring title?", reasons.contains("Software title is required."));
7976
assertFalse("Still requiring accessibility", reasons.contains("Missing Source Accessibility."));
8077
assertTrue ("Missing OS validation", reasons.contains("Repository URL is required for open source submissions."));
81-
assertTrue ("Missing software type validation", reasons.contains("Software type is required."));
8278

8379
// test developer issues
8480
Developer d = new Developer();
@@ -131,37 +127,18 @@ public void testValidateSubmit() {
131127
m.setDevelopers(developers);
132128
m.setProprietaryUrl("http://mylicense.com/terms.html");
133129
m.setDescription("This is a testing description.");
134-
m.setSoftwareType(DOECodeMetadata.Type.S);
135130

136131
reasons = Metadata.validateSubmit(m);
137132

138133
assertTrue ("Should be no more errors: " + StringUtils.join(reasons, ", "), reasons.isEmpty());
139134

140-
// assert that the BUSINESS additional requirement is there
141-
m.setSoftwareType(DOECodeMetadata.Type.B);
142-
143-
reasons = Metadata.validateSubmit(m);
144-
145-
assertFalse("Missing business validation", reasons.isEmpty());
146-
assertTrue ("Reason is wrong", reasons.contains("A sponsor is required for Business software."));
147-
148-
// fix it
149-
SponsoringOrganization sponsor = new SponsoringOrganization();
150-
sponsor.setPrimaryAward("AWARD");
151-
sponsor.setOrganizationName("Testing Business Validation");
152-
153-
m.setSponsoringOrganizations(Arrays.asList(sponsor));
154-
155-
reasons = Metadata.validateSubmit(m);
156-
157-
assertTrue ("Still have errors:" + StringUtils.join(reasons, ", "), reasons.isEmpty());
158135
}
159136

160137
/**
161-
* Test some ANNOUNCE validations.
138+
* Test some SUBMIT validations.
162139
*/
163140
@Test
164-
public void testValidateAnnounce() {
141+
public void testValidateSubmit() {
165142
// test that published ones also apply here
166143
DOECodeMetadata m = new DOECodeMetadata();
167144

@@ -176,10 +153,9 @@ public void testValidateAnnounce() {
176153
"Description is required.",
177154
"A License is required.",
178155
"At least one developer is required.",
179-
"A valid Landing Page URL is required for non-open source submissions.",
180-
"Software type is required."
156+
"A valid Landing Page URL is required for non-open source submissions."
181157
};
182-
String[] announce_validations = {
158+
String[] submit_validations = {
183159
"Release date is required.",
184160
"At least one sponsoring organization is required.",
185161
"At least one research organization is required.",
@@ -193,8 +169,8 @@ public void testValidateAnnounce() {
193169
assertTrue ("Missing: " + message, reasons.contains(message));
194170
}
195171

196-
// also check announce only validations
197-
for ( String message : announce_validations ) {
172+
// also check submit only validations
173+
for ( String message : submit_validations ) {
198174
assertTrue ("Missing: " + message, reasons.contains(message));
199175
}
200176
}

0 commit comments

Comments
 (0)