import sources from develop/0.1.0
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.peetz.comics.dal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.peetz.comics.entity.ArtistEntity;
|
||||
|
||||
@Local
|
||||
public interface ArtistDao {
|
||||
|
||||
public ArtistEntity getById(Long id);
|
||||
|
||||
public List<ArtistEntity> findByIds(List<Long> ids);
|
||||
|
||||
public ArtistEntity store(ArtistEntity entity);
|
||||
|
||||
public void delete(ArtistEntity entity);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.peetz.comics.dal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.ejb.TransactionAttribute;
|
||||
import javax.ejb.TransactionAttributeType;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.Query;
|
||||
|
||||
import com.peetz.comics.entity.ArtistEntity;
|
||||
|
||||
@Stateless(name = "ArtistDao")
|
||||
@TransactionAttribute(TransactionAttributeType.REQUIRED)
|
||||
public class ArtistImpl implements ArtistDao {
|
||||
|
||||
@PersistenceContext(unitName = "kontor")
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
public ArtistEntity getById(Long id) {
|
||||
Query q = em.createNamedQuery("");
|
||||
q.setParameter("id", id);
|
||||
ArtistEntity entity = (ArtistEntity)q.getSingleResult();
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ArtistEntity> findByIds(List<Long> ids) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArtistEntity store(ArtistEntity entity) {
|
||||
em.persist(entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(ArtistEntity entity) {
|
||||
em.remove(entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.peetz.comics.dal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.peetz.comics.entity.ComicEntity;
|
||||
import com.peetz.comics.entity.PublisherEntity;
|
||||
|
||||
@Local
|
||||
public interface ComicDao {
|
||||
public ComicEntity getById(Long id);
|
||||
|
||||
public List<ComicEntity> findByIds(List<Long> ids);
|
||||
|
||||
public List<ComicEntity> findByTitle(String title);
|
||||
|
||||
public ComicEntity assignPublisher(ComicEntity comic, PublisherEntity publisher);
|
||||
|
||||
public ComicEntity store(ComicEntity entity);
|
||||
|
||||
public void delete(ComicEntity entity);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.peetz.comics.dal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.ejb.TransactionAttribute;
|
||||
import javax.ejb.TransactionAttributeType;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.Query;
|
||||
|
||||
import com.peetz.comics.entity.ComicEntity;
|
||||
import com.peetz.comics.entity.PublisherEntity;
|
||||
|
||||
@Stateless(name = "ComicDao")
|
||||
@TransactionAttribute(TransactionAttributeType.REQUIRED)
|
||||
public class ComicImpl implements ComicDao {
|
||||
|
||||
@PersistenceContext(unitName = "kontor")
|
||||
private EntityManager em;
|
||||
|
||||
@Override
|
||||
public ComicEntity getById(Long id) {
|
||||
Query q = em.createNamedQuery("Comic.findById");
|
||||
q.setParameter("id", id);
|
||||
ComicEntity entity = (ComicEntity)q.getSingleResult();
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComicEntity> findByIds(List<Long> ids) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComicEntity> findByTitle(String title) {
|
||||
Query q = em.createNamedQuery("Comic.findByTitle");
|
||||
q.setParameter("title", title);
|
||||
@SuppressWarnings("unchecked")
|
||||
List<ComicEntity> resultList = q.getResultList();
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComicEntity assignPublisher(ComicEntity comic,
|
||||
PublisherEntity publisher) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComicEntity store(ComicEntity entity) {
|
||||
em.persist(entity);
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(ComicEntity entity) {
|
||||
em.remove(entity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.peetz.comics.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@NamedQueries({
|
||||
@NamedQuery(name="Artist.findAll", query="SELECT a from ArtistEntity as a"),
|
||||
@NamedQuery(name="Artist.findByName", query="SELECT a from ArtistEntity as a WHERE a.name = :name")
|
||||
})
|
||||
|
||||
@Entity
|
||||
@Table(name="ARTIST")
|
||||
public class ArtistEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Collection<IssueEntity> writtenIssues = new ArrayList<IssueEntity>();
|
||||
|
||||
|
||||
private Collection<IssueEntity> inkedIssues = new ArrayList<IssueEntity>();
|
||||
|
||||
private Collection<IssueEntity> penciledIssues = new ArrayList<IssueEntity>();
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.AUTO)
|
||||
public Long getId() { return id; }
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void setId(Long id) { this.id = id; }
|
||||
|
||||
@Column
|
||||
public String getName() { return name; }
|
||||
|
||||
public void setName(String name) { this.name = name; }
|
||||
|
||||
public void setWrittenIssues(Collection<IssueEntity> writtenIssues) { this.writtenIssues = writtenIssues; }
|
||||
|
||||
@OneToMany(mappedBy="writer", cascade=CascadeType.REMOVE)
|
||||
public Collection<IssueEntity> getWrittenIssues() {
|
||||
return writtenIssues;
|
||||
}
|
||||
|
||||
public void setInkedIssues(Collection<IssueEntity> inkedIssues) { this.inkedIssues = inkedIssues; }
|
||||
|
||||
@OneToMany(mappedBy="inker", cascade=CascadeType.REMOVE)
|
||||
public Collection<IssueEntity> getInkedIssues() {
|
||||
return inkedIssues;
|
||||
}
|
||||
|
||||
public void setPenciledIssues(Collection<IssueEntity> penciledIssues) { this.penciledIssues = penciledIssues; }
|
||||
|
||||
@OneToMany(mappedBy="penciler", cascade=CascadeType.REMOVE)
|
||||
public Collection<IssueEntity> getPenciledIssues() {
|
||||
return penciledIssues;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.peetz.comics.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@NamedQueries({
|
||||
@NamedQuery(name="Comic.findAll", query="SELECT c from ComicEntity as c"),
|
||||
@NamedQuery(name="Comic.findByTitle", query="SELECT c from ComicEntity as c WHERE c.title = :title")
|
||||
})
|
||||
|
||||
@Entity
|
||||
@Table(name="COMIC")
|
||||
public class ComicEntity
|
||||
{
|
||||
private Long id;
|
||||
|
||||
private String title;
|
||||
|
||||
private Boolean completed;
|
||||
|
||||
private Boolean currentOrder;
|
||||
|
||||
private Collection<IssueEntity> issues = new ArrayList<IssueEntity>();
|
||||
|
||||
private Collection<StoryArcEntity> storyArc = new ArrayList<StoryArcEntity>();
|
||||
|
||||
private Collection<VolumeEntity> volumes = new ArrayList<VolumeEntity>();
|
||||
|
||||
public PublisherEntity publisher;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.AUTO)
|
||||
public Long getId() { return id; }
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void setId(Long id) { this.id = id; }
|
||||
|
||||
@Column
|
||||
public String getTitle() { return title; }
|
||||
|
||||
public void setTitle(String title) { this.title = title; }
|
||||
|
||||
@Column
|
||||
public Boolean getCompleted() { return completed; }
|
||||
|
||||
public Boolean isCompleted() { return completed; }
|
||||
|
||||
public void setCompleted(Boolean completed) { this.completed = completed; }
|
||||
|
||||
@Column
|
||||
public Boolean getCurrentOrder() { return currentOrder; }
|
||||
|
||||
public Boolean isCurrentOrder() { return currentOrder; }
|
||||
|
||||
public void setCurrentOrder(Boolean currentOrder) { this.currentOrder = currentOrder; }
|
||||
|
||||
public void setIssues(Collection<IssueEntity> issues) { this.issues = issues; }
|
||||
|
||||
@OneToMany(mappedBy="comic", cascade=CascadeType.REMOVE)
|
||||
public Collection<IssueEntity> getIssues() { return issues; }
|
||||
|
||||
public void setStoryArc(Collection<StoryArcEntity> storyArc) { this.storyArc = storyArc; }
|
||||
|
||||
@OneToMany(mappedBy="comic", cascade=CascadeType.REMOVE)
|
||||
public Collection<StoryArcEntity> getStoryArc() { return storyArc; }
|
||||
|
||||
public void setVolumes(Collection<VolumeEntity> volumes) { this.volumes = volumes; }
|
||||
|
||||
@OneToMany(mappedBy="comic", cascade=CascadeType.REMOVE)
|
||||
public Collection<VolumeEntity> getVolumes() { return volumes; }
|
||||
|
||||
@ManyToOne
|
||||
public PublisherEntity getPublisher() { return publisher; }
|
||||
|
||||
public void setPublisher(PublisherEntity publisher) {
|
||||
this.publisher = publisher;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.peetz.comics.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@NamedQueries({
|
||||
@NamedQuery(name="Issue.findAll", query="SELECT i from IssueEntity as i"),
|
||||
@NamedQuery(name="Issue.findByNumber", query="SELECT i from IssueEntity as i WHERE i.number = :number")
|
||||
})
|
||||
|
||||
@Entity
|
||||
@Table(name = "ISSUE")
|
||||
public class IssueEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String number;
|
||||
|
||||
private Boolean completed;
|
||||
|
||||
private ComicEntity comic;
|
||||
|
||||
private ArtistEntity writer;
|
||||
|
||||
private ArtistEntity inker;
|
||||
|
||||
private ArtistEntity penciler;
|
||||
|
||||
private StoryArcEntity storyArc;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.AUTO)
|
||||
public Long getId() { return id; }
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void setId(Long id) { this.id = id; }
|
||||
|
||||
@Column
|
||||
public String getNumber() { return number; }
|
||||
|
||||
public void setNumber(String number) { this.number = number; }
|
||||
|
||||
@Column
|
||||
public Boolean getCompleted() { return completed; }
|
||||
public Boolean isCompleted() { return completed; }
|
||||
|
||||
public void setCompleted(Boolean completed) { this.completed = completed; }
|
||||
|
||||
public void setComic(ComicEntity comic) { this.comic = comic; }
|
||||
|
||||
@ManyToOne
|
||||
public ComicEntity getComic() { return comic; }
|
||||
|
||||
public void setWriter(ArtistEntity writer) { this.writer = writer; }
|
||||
|
||||
@ManyToOne
|
||||
public ArtistEntity getWriter() { return writer; }
|
||||
|
||||
public void setInker(ArtistEntity inker) { this.inker = inker; }
|
||||
|
||||
@ManyToOne
|
||||
public ArtistEntity getInker() { return inker; }
|
||||
|
||||
public void setPenciler(ArtistEntity penciler) { this.penciler = penciler; }
|
||||
|
||||
@ManyToOne
|
||||
public ArtistEntity getPenciler() { return penciler; }
|
||||
|
||||
public void setStoryArc(StoryArcEntity storyArc) { this.storyArc = storyArc; }
|
||||
|
||||
@ManyToOne
|
||||
public StoryArcEntity getStoryArc() { return storyArc; }
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.peetz.comics.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@NamedQueries({
|
||||
@NamedQuery(name="Publisher.findAll", query="SELECT p from PublisherEntity as p"),
|
||||
@NamedQuery(name="Publisher.findByName", query="SELECT p from PublisherEntity as p WHERE p.name = :name")
|
||||
})
|
||||
|
||||
@Entity
|
||||
@Table(name="PUBLISHER")
|
||||
public class PublisherEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Collection<ComicEntity> comic = new ArrayList<ComicEntity>();
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.AUTO)
|
||||
public Long getId() { return id; }
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void setId(Long id) { this.id = id; }
|
||||
|
||||
@Column
|
||||
public String getName() { return name; }
|
||||
|
||||
public void setName(String name) { this.name = name; }
|
||||
|
||||
public void setComic(Collection<ComicEntity> comic) { this.comic = comic; }
|
||||
|
||||
@OneToMany(mappedBy="publisher", cascade=CascadeType.REMOVE)
|
||||
public Collection<ComicEntity> getComic() { return comic; }
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.peetz.comics.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@NamedQueries({
|
||||
@NamedQuery(name="StoryArc.findAll", query="SELECT a from StoryArcEntity as a"),
|
||||
@NamedQuery(name="StoryArc.findByArtist", query="SELECT a from StoryArcEntity as a WHERE a.title = :title")
|
||||
})
|
||||
|
||||
@Entity
|
||||
@Table(name="STORYARC")
|
||||
public class StoryArcEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String title;
|
||||
|
||||
private Collection<IssueEntity> issues = new ArrayList<IssueEntity>();
|
||||
|
||||
private ComicEntity comic;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.AUTO)
|
||||
public Long getId() { return id; }
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void setId(Long id) { this.id = id; }
|
||||
|
||||
@Column
|
||||
public String getTitle() { return title; }
|
||||
|
||||
public void setTitle(String title) { this.title = title; }
|
||||
|
||||
public void setIssues(Collection<IssueEntity> issues) { this.issues = issues; }
|
||||
|
||||
@OneToMany(mappedBy="storyArc", cascade=CascadeType.REMOVE)
|
||||
public Collection<IssueEntity> getIssues() { return issues; }
|
||||
|
||||
public void setComic(ComicEntity comic) { this.comic = comic; }
|
||||
|
||||
@ManyToOne
|
||||
public ComicEntity getComic() { return comic; }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.peetz.comics.entity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@Entity
|
||||
@Table(name="VOLUME")
|
||||
public class VolumeEntity {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String title;
|
||||
|
||||
ComicEntity comic;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.AUTO)
|
||||
public Long getId() { return id; }
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private void setId(Long id) { this.id = id; }
|
||||
|
||||
@Column
|
||||
public String getTitle() { return title; }
|
||||
|
||||
public void setTitle(String title) { this.title = title; }
|
||||
|
||||
@ManyToOne
|
||||
public ComicEntity getComic() { return comic; }
|
||||
|
||||
public void setComic(ComicEntity comic) { this.comic = comic; }
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.peetz.comics.service;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.ejb.Local;
|
||||
|
||||
import com.peetz.comics.entity.ArtistEntity;
|
||||
import com.peetz.comics.entity.ComicEntity;
|
||||
import com.peetz.comics.entity.IssueEntity;
|
||||
import com.peetz.comics.entity.PublisherEntity;
|
||||
import com.peetz.comics.entity.StoryArcEntity;
|
||||
|
||||
@Local
|
||||
public interface ComicService {
|
||||
public Collection<ComicEntity> getAllComics();
|
||||
|
||||
public Collection<PublisherEntity> getAllPublisher();
|
||||
|
||||
public Collection<ArtistEntity> getAllArtists();
|
||||
|
||||
public Collection<IssueEntity> getAllIssuesForComic(ComicEntity comic);
|
||||
|
||||
public Collection<StoryArcEntity> getAllStoryArcs();
|
||||
|
||||
public void addStoryArc(String title);
|
||||
|
||||
public void addPublisher(String name);
|
||||
|
||||
public ComicEntity addComic(String title);
|
||||
|
||||
public PublisherEntity getPublisherById(String nodeValue);
|
||||
|
||||
public void assignPublisher(ComicEntity comic, PublisherEntity publisher);
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.peetz.comics.service;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
import javax.ejb.TransactionAttribute;
|
||||
import javax.ejb.TransactionAttributeType;
|
||||
|
||||
import com.peetz.comics.entity.ArtistEntity;
|
||||
import com.peetz.comics.entity.ComicEntity;
|
||||
import com.peetz.comics.entity.IssueEntity;
|
||||
import com.peetz.comics.entity.PublisherEntity;
|
||||
import com.peetz.comics.entity.StoryArcEntity;
|
||||
import java.util.ArrayList;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.Query;
|
||||
|
||||
@Stateless(name="ComicService")
|
||||
@TransactionAttribute(TransactionAttributeType.REQUIRED)
|
||||
public class ComicServiceImpl implements ComicService {
|
||||
|
||||
@PersistenceContext(unitName = "kontor")
|
||||
private EntityManager em;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Collection<ComicEntity> getAllComics() {
|
||||
Query query = em.createNamedQuery("Comic.findAll");
|
||||
ArrayList<ComicEntity> comicList = new ArrayList<ComicEntity>(query.getResultList());
|
||||
return comicList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<PublisherEntity> getAllPublisher() {
|
||||
Query query = em.createNamedQuery("Publisher.findAll");
|
||||
@SuppressWarnings("unchecked")
|
||||
ArrayList<PublisherEntity> publisherList = new ArrayList<PublisherEntity>(query.getResultList());
|
||||
return publisherList;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Collection<ArtistEntity> getAllArtists() {
|
||||
Query query = em.createNamedQuery("Artist.findAll");
|
||||
ArrayList<ArtistEntity> artistList = new ArrayList<ArtistEntity>(query.getResultList());
|
||||
return artistList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<IssueEntity> getAllIssuesForComic(ComicEntity comic) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<StoryArcEntity> getAllStoryArcs() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addStoryArc(String title) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPublisher(String name) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComicEntity addComic(String title) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PublisherEntity getPublisherById(String nodeValue) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void assignPublisher(ComicEntity comic, PublisherEntity publisher) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author TPEETZ
|
||||
*
|
||||
*/
|
||||
package com.peetz.comics.service;
|
||||
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package com.peetz.comics.service;
|
||||
|
||||
import com.peetz.comics.entity.ArtistEntity;
|
||||
import com.peetz.comics.entity.ComicEntity;
|
||||
import com.peetz.comics.entity.IssueEntity;
|
||||
import com.peetz.comics.entity.PublisherEntity;
|
||||
import com.peetz.comics.entity.StoryArcEntity;
|
||||
import java.util.Collection;
|
||||
import javax.ejb.embeddable.EJBContainer;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
import org.junit.Ignore;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TPEETZ
|
||||
*/
|
||||
public class ComicServiceImplTest {
|
||||
|
||||
private static ComicService instance;
|
||||
private static EJBContainer container;
|
||||
|
||||
public ComicServiceImplTest() {
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass() throws Exception {
|
||||
container = javax.ejb.embeddable.EJBContainer.createEJBContainer();
|
||||
instance = (ComicService)container.getContext().lookup("java:global/main/ComicService");
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() {
|
||||
container.close();
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getAllComics method, of class ComicServiceImpl.
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void testGetAllComics() throws Exception {
|
||||
System.out.println("getAllComics");
|
||||
Collection<ComicEntity> expResult = null;
|
||||
Collection<ComicEntity> result = instance.getAllComics();
|
||||
assertEquals(expResult, result);
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
fail("The test case is a prototype.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getAllPublisher method, of class ComicServiceImpl.
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void testGetAllPublisher() throws Exception {
|
||||
System.out.println("getAllPublisher");
|
||||
Collection<PublisherEntity> expResult = null;
|
||||
Collection<PublisherEntity> result = instance.getAllPublisher();
|
||||
assertEquals(expResult, result);
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
fail("The test case is a prototype.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getAllArtists method, of class ComicServiceImpl.
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void testGetAllArtists() throws Exception {
|
||||
System.out.println("getAllArtists");
|
||||
Collection<ArtistEntity> expResult = null;
|
||||
Collection<ArtistEntity> result = instance.getAllArtists();
|
||||
assertEquals(expResult, result);
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
fail("The test case is a prototype.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getAllIssuesForComic method, of class ComicServiceImpl.
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void testGetAllIssuesForComic() throws Exception {
|
||||
System.out.println("getAllIssuesForComic");
|
||||
ComicEntity comic = null;
|
||||
Collection<IssueEntity> expResult = null;
|
||||
Collection<IssueEntity> result = instance.getAllIssuesForComic(comic);
|
||||
assertEquals(expResult, result);
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
fail("The test case is a prototype.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getAllStoryArcs method, of class ComicServiceImpl.
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void testGetAllStoryArcs() throws Exception {
|
||||
System.out.println("getAllStoryArcs");
|
||||
Collection<StoryArcEntity> expResult = null;
|
||||
Collection<StoryArcEntity> result = instance.getAllStoryArcs();
|
||||
assertEquals(expResult, result);
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
fail("The test case is a prototype.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of addStoryArc method, of class ComicServiceImpl.
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void testAddStoryArc() throws Exception {
|
||||
System.out.println("addStoryArc");
|
||||
String title = "";
|
||||
instance.addStoryArc(title);
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
fail("The test case is a prototype.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of addPublisher method, of class ComicServiceImpl.
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void testAddPublisher() throws Exception {
|
||||
System.out.println("addPublisher");
|
||||
String name = "";
|
||||
instance.addPublisher(name);
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
fail("The test case is a prototype.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of addComic method, of class ComicServiceImpl.
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void testAddComic() throws Exception {
|
||||
System.out.println("addComic");
|
||||
String title = "";
|
||||
ComicEntity expResult = null;
|
||||
ComicEntity result = instance.addComic(title);
|
||||
assertEquals(expResult, result);
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
fail("The test case is a prototype.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getPublisherById method, of class ComicServiceImpl.
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void testGetPublisherById() throws Exception {
|
||||
System.out.println("getPublisherById");
|
||||
String nodeValue = "";
|
||||
PublisherEntity expResult = null;
|
||||
PublisherEntity result = instance.getPublisherById(nodeValue);
|
||||
assertEquals(expResult, result);
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
fail("The test case is a prototype.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of assignPublisher method, of class ComicServiceImpl.
|
||||
*/
|
||||
@Ignore
|
||||
@Test
|
||||
public void testAssignPublisher() throws Exception {
|
||||
System.out.println("assignPublisher");
|
||||
ComicEntity comic = null;
|
||||
PublisherEntity publisher = null;
|
||||
instance.assignPublisher(comic, publisher);
|
||||
// TODO review the generated test code and remove the default call to fail.
|
||||
fail("The test case is a prototype.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user