cleanup generated files (#1705)

* upgrade to spring boot 1.5.2

* add full update to REST API

* modify ratings controller

* upgrade herold

* fix integration test

* fix integration test

* minor fix

* fix integration test

* fix integration test

* minor cleanup

* minor cleanup

* remove log4j properties

* use standard logbook.xml

* remove log4j dependencies

* remove commons-logging

* merge

* fix conflict

* exclude commons-logging dependency

* cleanup

* minor fix

* minor fix

* fix dependency issues

* Revert "fix dependency issues"

This reverts commit 83bf1f9fd2e1a9a55f9cacb085669568b06b49ec.

* fix dependency issues

* minor fix

* minor fix

* minor fix

* cleanup generated files
This commit is contained in:
Doha2012 2017-04-22 19:58:20 +02:00 committed by Eugen
parent f88d40442c
commit 9f9dc8770a
13 changed files with 358 additions and 22 deletions

2
.gitignore vendored
View File

@ -31,3 +31,5 @@ spring-openid/src/main/resources/application.properties
.recommenders/
/spring-hibernate4/nbproject/
spring-security-openid/src/main/resources/application.properties
spring-all/*.log

View File

@ -3,8 +3,10 @@ package com.baeldung.cxf.aegis;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import org.junit.After;
import org.junit.Test;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.lang.reflect.Type;
@ -90,4 +92,12 @@ public class BaeldungTest {
xmlReader.close();
return courseRepo;
}
@After
public void cleanup(){
File testFile = new File(fileName);
if (testFile.exists()) {
testFile.delete();
}
}
}

View File

@ -19,6 +19,7 @@ import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.Before;
import org.junit.After;
public class JExcelTest {
@ -53,4 +54,11 @@ public class JExcelTest {
.get(1));
}
@After
public void cleanup(){
File testFile = new File(fileLocation);
if (testFile.exists()) {
testFile.delete();
}
}
}

View File

@ -16,6 +16,7 @@ import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.Before;
import org.junit.After;
public class ExcelTest {
@ -50,4 +51,11 @@ public class ExcelTest {
.get(1));
}
@After
public void cleanup(){
File testFile = new File(fileLocation);
if (testFile.exists()) {
testFile.delete();
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -135,6 +135,9 @@
</sources>
<outputDirectory>${basedir}/src/main/java</outputDirectory>
<clearOutputDir>false</clearOutputDir>
<noGeneratedHeaderComments>true</noGeneratedHeaderComments>
<extension>true</extension>
<generateEpisode>false</generateEpisode>
</configuration>
</plugin>

View File

@ -0,0 +1,48 @@
package com.baeldung.jaxb.gen;
import javax.xml.bind.annotation.XmlRegistry;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the com.baeldung.jaxb.gen package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.baeldung.jaxb.gen
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link UserRequest }
*
*/
public UserRequest createUserRequest() {
return new UserRequest();
}
/**
* Create an instance of {@link UserResponse }
*
*/
public UserResponse createUserResponse() {
return new UserResponse();
}
}

View File

@ -0,0 +1,87 @@
package com.baeldung.jaxb.gen;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for UserRequest complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="UserRequest"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
* &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "UserRequest", propOrder = {
"id",
"name"
})
@XmlRootElement(name = "userRequest")
public class UserRequest
implements Serializable
{
private final static long serialVersionUID = -1L;
protected int id;
@XmlElement(required = true)
protected String name;
/**
* Gets the value of the id property.
*
*/
public int getId() {
return id;
}
/**
* Sets the value of the id property.
*
*/
public void setId(int value) {
this.id = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
}

View File

@ -0,0 +1,149 @@
package com.baeldung.jaxb.gen;
import java.io.Serializable;
import java.util.Calendar;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.w3._2001.xmlschema.Adapter1;
/**
* <p>Java class for UserResponse complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="UserResponse"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
* &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="gender" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="created" type="{http://www.w3.org/2001/XMLSchema}dateTime"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "UserResponse", propOrder = {
"id",
"name",
"gender",
"created"
})
@XmlRootElement(name = "userResponse")
public class UserResponse
implements Serializable
{
private final static long serialVersionUID = -1L;
protected int id;
@XmlElement(required = true)
protected String name;
@XmlElement(required = true)
protected String gender;
@XmlElement(required = true, type = String.class)
@XmlJavaTypeAdapter(Adapter1 .class)
@XmlSchemaType(name = "dateTime")
protected Calendar created;
/**
* Gets the value of the id property.
*
*/
public int getId() {
return id;
}
/**
* Sets the value of the id property.
*
*/
public void setId(int value) {
this.id = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the gender property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getGender() {
return gender;
}
/**
* Sets the value of the gender property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setGender(String value) {
this.gender = value;
}
/**
* Gets the value of the created property.
*
* @return
* possible object is
* {@link String }
*
*/
public Calendar getCreated() {
return created;
}
/**
* Sets the value of the created property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCreated(Calendar value) {
this.created = value;
}
}

View File

@ -0,0 +1,2 @@
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.baeldung.com/jaxb/gen", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package com.baeldung.jaxb.gen;

View File

@ -0,0 +1,23 @@
package org.w3._2001.xmlschema;
import java.util.Calendar;
import javax.xml.bind.annotation.adapters.XmlAdapter;
public class Adapter1
extends XmlAdapter<String, Calendar>
{
public Calendar unmarshal(String value) {
return (javax.xml.bind.DatatypeConverter.parseDateTime(value));
}
public String marshal(Calendar value) {
if (value == null) {
return null;
}
return (javax.xml.bind.DatatypeConverter.printDateTime(value));
}
}

View File

@ -1,6 +1,7 @@
package org.baeldung.shell.simple;
import java.io.File;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@ -15,13 +16,18 @@ public class SimpleCLIUnitTest {
@BeforeClass
public static void startUp() throws InterruptedException {
Bootstrap bootstrap = new Bootstrap();
final Bootstrap bootstrap = new Bootstrap();
shell = bootstrap.getJLineShellComponent();
}
@AfterClass
public static void shutdown() {
shell.stop();
// delete contents.txt
final File testFile = new File("contents.txt");
if (testFile.exists()) {
testFile.delete();
}
}
public static JLineShellComponent getShell() {
@ -31,7 +37,7 @@ public class SimpleCLIUnitTest {
@Test
public void givenCommandConfig_whenExecutingWebGetCommand_thenCorrectResult() {
CommandResult resultWebSave = shell.executeCommand("web-get --url https://www.google.com");
final CommandResult resultWebSave = shell.executeCommand("web-get --url https://www.google.com");
Assert.assertTrue(resultWebSave.isSuccess());
}
@ -40,37 +46,27 @@ public class SimpleCLIUnitTest {
public void givenCommandConfig_whenExecutingWebSaveCommand_thenCorrectResult() {
shell.executeCommand("admin-enable");
CommandResult result = shell.executeCommand("web-save --url https://www.google.com --out contents.txt");
final CommandResult result = shell.executeCommand("web-save --url https://www.google.com --out contents.txt");
Assert.assertArrayEquals(
new boolean[]{
result.isSuccess(),
new File("contents.txt").exists()},
new boolean[]{true, true});
Assert.assertArrayEquals(new boolean[] { result.isSuccess(), new File("contents.txt").exists() }, new boolean[] { true, true });
}
@Test
public void givenCommandConfig_whenAdminEnableCommandExecuted_thenCorrectAvailability() {
CommandResult resultAdminDisable = shell.executeCommand("admin-disable");
CommandResult resultWebSaveUnavailable = shell.executeCommand("web-save --url https://www.google.com --out contents.txt");
CommandResult resultAdminEnable = shell.executeCommand("admin-enable");
CommandResult resultWebSaveAvailable = shell.executeCommand("web-save --url https://www.google.com --out contents.txt");
final CommandResult resultAdminDisable = shell.executeCommand("admin-disable");
final CommandResult resultWebSaveUnavailable = shell.executeCommand("web-save --url https://www.google.com --out contents.txt");
final CommandResult resultAdminEnable = shell.executeCommand("admin-enable");
final CommandResult resultWebSaveAvailable = shell.executeCommand("web-save --url https://www.google.com --out contents.txt");
Assert.assertArrayEquals(
new boolean[]{
resultAdminDisable.isSuccess(),
resultWebSaveUnavailable.isSuccess(),
resultAdminEnable.isSuccess(),
resultWebSaveAvailable.isSuccess()},
new boolean[]{true, false, true, true});
Assert.assertArrayEquals(new boolean[] { resultAdminDisable.isSuccess(), resultWebSaveUnavailable.isSuccess(), resultAdminEnable.isSuccess(), resultWebSaveAvailable.isSuccess() }, new boolean[] { true, false, true, true });
}
@Test
public void givenCommandConfig_whenWebSaveCommandExecutedNoOutArgument_thenError() {
shell.executeCommand("admin-enable");
CommandResult resultWebSave = shell.executeCommand("web-save --url https://www.google.com");
final CommandResult resultWebSave = shell.executeCommand("web-save --url https://www.google.com");
Assert.assertEquals(resultWebSave.isSuccess(), false);
}
@ -78,7 +74,7 @@ public class SimpleCLIUnitTest {
@Test
public void givenCommandConfig_whenExecutingWebGetCommandWithDefaultArgument_thenCorrectResult() {
CommandResult result = shell.executeCommand("web-get https://www.google.com");
final CommandResult result = shell.executeCommand("web-get https://www.google.com");
Assert.assertEquals(result.isSuccess(), true);
}