Commit 57b47f31 authored by Ådne Karstad's avatar Ådne Karstad

[patch] Update packages and readme

parent 81566ba3
# Project 1
- `tdt4250.spp.model` contains the model code and source code.
- `tdt4250.spp.model.tests` contain all tests for the source code.
The model created
![model](assets/model.png)
## Assumptions
-
## Rationale
- A University naturally owns all Study _Programs_ and institutes, meaning it's the root container in the domain.
- An Institute has ownership or responsibility of any given course, hence courses are contained by Institutes.
- A Program has a set of Mandatory Courses that must be completed in order to finish the program.
- Mandatory Courses will be _automatically_ adjusted after the student has chosen a specialization.
- The general set of mandatory courses will be predefined by a student coordinator.
- A Program has a set of Elective Courses that may be selected into a semester
- The set of elective courses will be predefined by a student coordinator.
- A course has to be chosen from either the set of Mandatory- or Elective Courses.
- A Program's duration has to be one of Bachelor (3 years), Masters (2 years), or IntegratedMasters (5 years).
- The level of a given course is either Bachelor level or Masters level
- Bachelor level courses is one of; Foundation, Intermediate, or ThirdYear.
- Masters is always Second Degree.
- A course can be taken either in the semester Fall or Spring, and may or may not be available for both.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tdt4250.spp.model.tests</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: tdt4250.spp.model.tests;singleton:=true
Automatic-Module-Name: tdt4250.spp.model.tests
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: tdt4250.spp.tests
Require-Bundle: org.eclipse.core.runtime,
tdt4250.spp.model;visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.junit;visibility:=reexport
Bundle-ActivationPolicy: lazy
#
bin.includes = .,\
META-INF/,\
plugin.properties
jars.compile.order = .
source.. = src/
output.. = bin/
#
pluginName = tdt4250.spp.model Tests
providerName = www.example.org
/**
*/
package tdt4250.spp.tests;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import tdt4250.spp.Course;
import tdt4250.spp.SppFactory;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Course</b></em>'.
* <!-- end-user-doc -->
* @generated
*/
public class CourseTest extends TestCase {
/**
* The fixture for this Course test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Course fixture = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static void main(String[] args) {
TestRunner.run(CourseTest.class);
}
/**
* Constructs a new Course test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CourseTest(String name) {
super(name);
}
/**
* Sets the fixture for this Course test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void setFixture(Course fixture) {
this.fixture = fixture;
}
/**
* Returns the fixture for this Course test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Course getFixture() {
return fixture;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#setUp()
* @generated
*/
@Override
protected void setUp() throws Exception {
setFixture(SppFactory.eINSTANCE.createCourse());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#tearDown()
* @generated
*/
@Override
protected void tearDown() throws Exception {
setFixture(null);
}
} //CourseTest
/**
*/
package tdt4250.spp.tests;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import tdt4250.spp.ElectiveCourses;
import tdt4250.spp.SppFactory;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Elective Courses</b></em>'.
* <!-- end-user-doc -->
* @generated
*/
public class ElectiveCoursesTest extends TestCase {
/**
* The fixture for this Elective Courses test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ElectiveCourses fixture = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static void main(String[] args) {
TestRunner.run(ElectiveCoursesTest.class);
}
/**
* Constructs a new Elective Courses test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ElectiveCoursesTest(String name) {
super(name);
}
/**
* Sets the fixture for this Elective Courses test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void setFixture(ElectiveCourses fixture) {
this.fixture = fixture;
}
/**
* Returns the fixture for this Elective Courses test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ElectiveCourses getFixture() {
return fixture;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#setUp()
* @generated
*/
@Override
protected void setUp() throws Exception {
setFixture(SppFactory.eINSTANCE.createElectiveCourses());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#tearDown()
* @generated
*/
@Override
protected void tearDown() throws Exception {
setFixture(null);
}
} //ElectiveCoursesTest
/**
*/
package tdt4250.spp.tests;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import tdt4250.spp.Institute;
import tdt4250.spp.SppFactory;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Institute</b></em>'.
* <!-- end-user-doc -->
* @generated
*/
public class InstituteTest extends TestCase {
/**
* The fixture for this Institute test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Institute fixture = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static void main(String[] args) {
TestRunner.run(InstituteTest.class);
}
/**
* Constructs a new Institute test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InstituteTest(String name) {
super(name);
}
/**
* Sets the fixture for this Institute test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void setFixture(Institute fixture) {
this.fixture = fixture;
}
/**
* Returns the fixture for this Institute test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Institute getFixture() {
return fixture;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#setUp()
* @generated
*/
@Override
protected void setUp() throws Exception {
setFixture(SppFactory.eINSTANCE.createInstitute());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#tearDown()
* @generated
*/
@Override
protected void tearDown() throws Exception {
setFixture(null);
}
} //InstituteTest
/**
*/
package tdt4250.spp.tests;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import tdt4250.spp.MandatoryCourses;
import tdt4250.spp.SppFactory;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Mandatory Courses</b></em>'.
* <!-- end-user-doc -->
* @generated
*/
public class MandatoryCoursesTest extends TestCase {
/**
* The fixture for this Mandatory Courses test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MandatoryCourses fixture = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static void main(String[] args) {
TestRunner.run(MandatoryCoursesTest.class);
}
/**
* Constructs a new Mandatory Courses test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MandatoryCoursesTest(String name) {
super(name);
}
/**
* Sets the fixture for this Mandatory Courses test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void setFixture(MandatoryCourses fixture) {
this.fixture = fixture;
}
/**
* Returns the fixture for this Mandatory Courses test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MandatoryCourses getFixture() {
return fixture;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#setUp()
* @generated
*/
@Override
protected void setUp() throws Exception {
setFixture(SppFactory.eINSTANCE.createMandatoryCourses());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#tearDown()
* @generated
*/
@Override
protected void tearDown() throws Exception {
setFixture(null);
}
} //MandatoryCoursesTest
/**
*/
package tdt4250.spp.tests;
import java.util.ArrayList;
import java.util.List;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import tdt4250.spp.LevelType;
import tdt4250.spp.Program;
import tdt4250.spp.Semester;
import tdt4250.spp.SppFactory;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Program</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are tested:
* <ul>
* <li>{@link tdt4250.spp.Program#getNumberOfSemesters() <em>Number Of Semesters</em>}</li>
* </ul>
* </p>
* <p>
* The following operations are tested:
* <ul>
* <li>{@link tdt4250.spp.Program#getCredits() <em>Get Credits</em>}</li>
* </ul>
* </p>
* @generated
*/
public class ProgramTest extends TestCase {
/**
* The fixture for this Program test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Program fixture = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static void main(String[] args) {
TestRunner.run(ProgramTest.class);
}
/**
* Constructs a new Program test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ProgramTest(String name) {
super(name);
}
/**
* Sets the fixture for this Program test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void setFixture(Program fixture) {
this.fixture = fixture;
}
/**
* Returns the fixture for this Program test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Program getFixture() {
return fixture;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#setUp()
* @generated
*/
@Override
protected void setUp() throws Exception {
setFixture(SppFactory.eINSTANCE.createProgram());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#tearDown()
* @generated
*/
@Override
protected void tearDown() throws Exception {
setFixture(null);
}
/**
* Tests the '{@link tdt4250.spp.Program#getNumberOfSemesters() <em>Number Of Semesters</em>}' feature getter.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see tdt4250.spp.Program#getNumberOfSemesters()
* @generated NOPE
*/
public void testGetNumberOfSemestersForMastersProgram() {
Program program = SppFactory.eINSTANCE.createProgram();
program.setDuration(LevelType.MASTER);
int expectedNumberOfSemesters = 4;
assertEquals(expectedNumberOfSemesters, program.getNumberOfSemesters());
}
public void testGetNumberOfSemestersForIntegratedMastersProgram() {
Program program = SppFactory.eINSTANCE.createProgram();
program.setDuration(LevelType.INTEGRATED_MASTERS);
int expectedNumberOfSemesters = 10;
assertEquals(expectedNumberOfSemesters, program.getNumberOfSemesters());
}
public void testGetNumberOfSemestersForBachelorProgram() {
Program program = SppFactory.eINSTANCE.createProgram();
program.setDuration(LevelType.BACHELOR);
int expectedNumberOfSemesters = 6;
assertEquals(expectedNumberOfSemesters, program.getNumberOfSemesters());
}
/**
* Tests the '{@link tdt4250.spp.Program#getCredits() <em>Get Credits</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see tdt4250.spp.Program#getCredits()
* @generated
*/
public void testGetCredits() {
// TODO: implement this operation test method
// Ensure that you remove @generated or mark it @generated NOT
fail();
}
} //ProgramTest
/**
*/
package tdt4250.spp.tests;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import tdt4250.spp.Semester;
import tdt4250.spp.SppFactory;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Semester</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following operations are tested:
* <ul>
* <li>{@link tdt4250.spp.Semester#getCredits() <em>Get Credits</em>}</li>
* </ul>
* </p>
* @generated
*/
public class SemesterTest extends TestCase {
/**
* The fixture for this Semester test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Semester fixture = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static void main(String[] args) {
TestRunner.run(SemesterTest.class);
}
/**
* Constructs a new Semester test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SemesterTest(String name) {
super(name);
}
/**
* Sets the fixture for this Semester test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void setFixture(Semester fixture) {
this.fixture = fixture;
}
/**
* Returns the fixture for this Semester test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected Semester getFixture() {
return fixture;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#setUp()
* @generated
*/
@Override
protected void setUp() throws Exception {
setFixture(SppFactory.eINSTANCE.createSemester());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#tearDown()
* @generated