Merge pull request #548 from muditporwal/master
Checkstyle improvements #539 : Added JavaDocType Rule
This commit is contained in:
@ -4,9 +4,9 @@
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
@ -21,6 +21,10 @@ import org.apache.isis.applib.annotation.HomePage;
|
||||
import org.apache.isis.applib.annotation.NatureOfService;
|
||||
import org.apache.isis.applib.annotation.SemanticsOf;
|
||||
|
||||
/**
|
||||
* HomePage Domain Service
|
||||
* @see HomePageViewModel linked view to HomePage
|
||||
*/
|
||||
@DomainService(nature = NatureOfService.VIEW_CONTRIBUTIONS_ONLY)
|
||||
public class HomePageService {
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
@ -21,6 +21,11 @@ import org.apache.isis.applib.annotation.ViewModel;
|
||||
import domainapp.dom.modules.simple.SimpleObject;
|
||||
import domainapp.dom.modules.simple.SimpleObjects;
|
||||
|
||||
/**
|
||||
* Model linked to the HomePage
|
||||
* The underlying layout is specified by json
|
||||
* @see HomePageService - Service Linked to the HomePage
|
||||
*/
|
||||
@ViewModel
|
||||
public class HomePageViewModel {
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
@ -33,6 +33,9 @@ import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
|
||||
import org.apache.isis.applib.services.i18n.TranslatableString;
|
||||
import org.apache.isis.applib.util.ObjectContracts;
|
||||
|
||||
/**
|
||||
* Definition of a Simple Object
|
||||
*/
|
||||
@javax.jdo.annotations.PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "simple",
|
||||
table = "SimpleObject")
|
||||
@javax.jdo.annotations.DatastoreIdentity(
|
||||
@ -53,7 +56,7 @@ public class SimpleObject implements Comparable<SimpleObject> {
|
||||
// region > name (property)
|
||||
|
||||
private String name;
|
||||
|
||||
|
||||
// region > identificatiom
|
||||
public TranslatableString title() {
|
||||
return TranslatableString.tr("Object: {name}", "name", getName());
|
||||
@ -74,6 +77,9 @@ public class SimpleObject implements Comparable<SimpleObject> {
|
||||
|
||||
// region > updateName (action)
|
||||
|
||||
/**
|
||||
* Event used to update the Name in the Domain
|
||||
*/
|
||||
public static class UpdateNameDomainEvent extends ActionDomainEvent<SimpleObject> {
|
||||
public UpdateNameDomainEvent(final SimpleObject source, final Identifier identifier,
|
||||
final Object... arguments) {
|
||||
|
@ -4,9 +4,9 @@
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
@ -30,6 +30,9 @@ import org.apache.isis.applib.query.QueryDefault;
|
||||
import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
|
||||
import org.apache.isis.applib.services.i18n.TranslatableString;
|
||||
|
||||
/**
|
||||
* Domain Service for Simple Objects
|
||||
*/
|
||||
@DomainService(repositoryFor = SimpleObject.class)
|
||||
@DomainServiceLayout(menuOrder = "10")
|
||||
public class SimpleObjects {
|
||||
@ -69,6 +72,9 @@ public class SimpleObjects {
|
||||
|
||||
// endregion
|
||||
|
||||
/**
|
||||
* Create Domain Event on SimpleObjects
|
||||
*/
|
||||
// region > create (action)
|
||||
public static class CreateDomainEvent extends ActionDomainEvent<SimpleObjects> {
|
||||
public CreateDomainEvent(final SimpleObjects source, final Identifier identifier,
|
||||
|
@ -14,11 +14,14 @@
|
||||
*/
|
||||
package domainapp.dom.modules.simple;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Test for SimpleObject
|
||||
*/
|
||||
public class SimpleObjectTest {
|
||||
|
||||
SimpleObject simpleObject;
|
||||
@ -28,6 +31,9 @@ public class SimpleObjectTest {
|
||||
simpleObject = new SimpleObject();
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for Names for SimpleObjects
|
||||
*/
|
||||
public static class Name extends SimpleObjectTest {
|
||||
|
||||
@Test
|
||||
|
@ -14,10 +14,13 @@
|
||||
*/
|
||||
package domainapp.dom.modules.simple;
|
||||
|
||||
import java.util.List;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.isis.applib.DomainObjectContainer;
|
||||
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
|
||||
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
|
||||
import org.jmock.Expectations;
|
||||
import org.jmock.Sequence;
|
||||
import org.jmock.auto.Mock;
|
||||
@ -25,12 +28,9 @@ import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.apache.isis.applib.DomainObjectContainer;
|
||||
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
|
||||
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Test for SimpleObjects
|
||||
*/
|
||||
public class SimpleObjectsTest {
|
||||
|
||||
@Rule
|
||||
@ -47,6 +47,9 @@ public class SimpleObjectsTest {
|
||||
simpleObjects.container = mockContainer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Creation of Simple Objects
|
||||
*/
|
||||
public static class Create extends SimpleObjectsTest {
|
||||
|
||||
@Test
|
||||
@ -77,6 +80,9 @@ public class SimpleObjectsTest {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Listing of Simple Objects
|
||||
*/
|
||||
public static class ListAll extends SimpleObjectsTest {
|
||||
|
||||
@Test
|
||||
|
@ -4,9 +4,9 @@
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
@ -20,6 +20,9 @@ import org.apache.isis.applib.fixturescripts.FixtureScript;
|
||||
import domainapp.dom.modules.simple.SimpleObject;
|
||||
import domainapp.dom.modules.simple.SimpleObjects;
|
||||
|
||||
/**
|
||||
* Fixture to create a simple object
|
||||
*/
|
||||
public class SimpleObjectCreate extends FixtureScript {
|
||||
|
||||
// endregion
|
||||
@ -45,7 +48,7 @@ public class SimpleObjectCreate extends FixtureScript {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The created simple object (output).
|
||||
*/
|
||||
@ -65,5 +68,5 @@ public class SimpleObjectCreate extends FixtureScript {
|
||||
// also make available to UI
|
||||
ec.addResult(this, simpleObject);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,9 +4,9 @@
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
@ -18,6 +18,9 @@ package domainapp.fixture.modules.simple;
|
||||
import org.apache.isis.applib.fixturescripts.FixtureScript;
|
||||
import org.apache.isis.applib.services.jdosupport.IsisJdoSupport;
|
||||
|
||||
/**
|
||||
* TearDown/Cleanup for SimpleObjects
|
||||
*/
|
||||
public class SimpleObjectsTearDown extends FixtureScript {
|
||||
|
||||
@javax.inject.Inject
|
||||
@ -27,5 +30,5 @@ public class SimpleObjectsTearDown extends FixtureScript {
|
||||
protected void execute(ExecutionContext executionContext) {
|
||||
isisJdoSupport.executeUpdate("delete from \"simple\".\"SimpleObject\"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,9 +4,9 @@
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
@ -27,6 +27,10 @@ import domainapp.dom.modules.simple.SimpleObject;
|
||||
import domainapp.fixture.modules.simple.SimpleObjectCreate;
|
||||
import domainapp.fixture.modules.simple.SimpleObjectsTearDown;
|
||||
|
||||
|
||||
/**
|
||||
* Create a bunch of simple Objects
|
||||
*/
|
||||
public class RecreateSimpleObjects extends FixtureScript {
|
||||
|
||||
public final List<String> names = Collections.unmodifiableList(Arrays.asList("Foo", "Bar", "Baz",
|
||||
@ -43,7 +47,7 @@ public class RecreateSimpleObjects extends FixtureScript {
|
||||
public RecreateSimpleObjects() {
|
||||
withDiscoverability(Discoverability.DISCOVERABLE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The number of objects to create, up to 10; optional, defaults to 3.
|
||||
*/
|
||||
@ -55,7 +59,7 @@ public class RecreateSimpleObjects extends FixtureScript {
|
||||
this.number = number;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The simpleobjects created by this fixture (output).
|
||||
*/
|
||||
|
@ -4,9 +4,9 @@
|
||||
* copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
||||
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
* or implied. See the License for the specific language governing permissions and limitations under
|
||||
@ -19,6 +19,9 @@ import org.apache.isis.core.integtestsupport.IsisSystemForTest;
|
||||
import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
|
||||
import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
|
||||
|
||||
/**
|
||||
* Initializer for the Simple App
|
||||
*/
|
||||
public final class SimpleAppSystemInitializer {
|
||||
|
||||
private SimpleAppSystemInitializer() {
|
||||
|
@ -21,6 +21,9 @@ import cucumber.api.java.After;
|
||||
import cucumber.api.java.Before;
|
||||
import domainapp.integtests.bootstrap.SimpleAppSystemInitializer;
|
||||
|
||||
/**
|
||||
* BootStrapping IntegrationTesting Before and After Steps
|
||||
*/
|
||||
public class BootstrappingGlue extends CukeGlueAbstract {
|
||||
|
||||
@Before(value = {"@integration"}, order = 100)
|
||||
|
@ -19,6 +19,9 @@ import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
|
||||
import cucumber.api.java.Before;
|
||||
import domainapp.fixture.scenarios.RecreateSimpleObjects;
|
||||
|
||||
/**
|
||||
* Test Execution to append a fixture of SimpleObjects
|
||||
*/
|
||||
public class CatalogOfFixturesGlue extends CukeGlueAbstract {
|
||||
|
||||
@Before(value = {"@integration", "@SimpleObjectsFixture"}, order = 20000)
|
||||
|
@ -14,18 +14,20 @@
|
||||
*/
|
||||
package domainapp.integtests.specglue.modules.simple;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import cucumber.api.java.en.Given;
|
||||
import cucumber.api.java.en.When;
|
||||
import domainapp.dom.modules.simple.SimpleObject;
|
||||
import domainapp.dom.modules.simple.SimpleObjects;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
|
||||
|
||||
/**
|
||||
* Test Simple Object Operations
|
||||
*/
|
||||
public class SimpleObjectGlue extends CukeGlueAbstract {
|
||||
|
||||
@Given("^there are.* (\\d+) simple objects$")
|
||||
|
@ -25,6 +25,9 @@ import org.apache.isis.core.integtestsupport.scenarios.ScenarioExecutionForInteg
|
||||
|
||||
import domainapp.integtests.bootstrap.SimpleAppSystemInitializer;
|
||||
|
||||
/**
|
||||
* SimpleApp Integration Tests will implement this Abstract Class.
|
||||
*/
|
||||
public abstract class SimpleAppIntegTest extends IntegrationTestAbstract {
|
||||
|
||||
@BeforeClass
|
||||
@ -35,5 +38,4 @@ public abstract class SimpleAppIntegTest extends IntegrationTestAbstract {
|
||||
// instantiating will install onto ThreadLocal
|
||||
new ScenarioExecutionForIntegration();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -18,21 +18,22 @@
|
||||
*/
|
||||
package domainapp.integtests.tests.modules.simple;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.apache.isis.applib.DomainObjectContainer;
|
||||
import org.apache.isis.applib.fixturescripts.FixtureScripts;
|
||||
import org.apache.isis.applib.services.wrapper.DisabledException;
|
||||
import org.apache.isis.applib.services.wrapper.InvalidException;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import domainapp.dom.modules.simple.SimpleObject;
|
||||
import domainapp.fixture.scenarios.RecreateSimpleObjects;
|
||||
import domainapp.integtests.tests.SimpleAppIntegTest;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import javax.inject.Inject;
|
||||
import org.apache.isis.applib.DomainObjectContainer;
|
||||
import org.apache.isis.applib.fixturescripts.FixtureScripts;
|
||||
import org.apache.isis.applib.services.wrapper.DisabledException;
|
||||
import org.apache.isis.applib.services.wrapper.InvalidException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Test Fixtures with Simple Objects
|
||||
*/
|
||||
public class SimpleObjectIntegTest extends SimpleAppIntegTest {
|
||||
|
||||
@Inject
|
||||
@ -54,6 +55,9 @@ public class SimpleObjectIntegTest extends SimpleAppIntegTest {
|
||||
simpleObjectWrapped = wrap(simpleObjectPojo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Object Name accessibility
|
||||
*/
|
||||
public static class Name extends SimpleObjectIntegTest {
|
||||
|
||||
@Test
|
||||
@ -75,6 +79,9 @@ public class SimpleObjectIntegTest extends SimpleAppIntegTest {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Validation of SimpleObject Names
|
||||
*/
|
||||
public static class UpdateName extends SimpleObjectIntegTest {
|
||||
|
||||
@Test
|
||||
@ -99,6 +106,9 @@ public class SimpleObjectIntegTest extends SimpleAppIntegTest {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test ContainerTitle generation based on SimpleObject Name
|
||||
*/
|
||||
public static class Title extends SimpleObjectIntegTest {
|
||||
|
||||
@Inject
|
||||
@ -117,4 +127,4 @@ public class SimpleObjectIntegTest extends SimpleAppIntegTest {
|
||||
assertThat(title).isEqualTo("Object: " + name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,28 +18,27 @@
|
||||
*/
|
||||
package domainapp.integtests.tests.modules.simple;
|
||||
|
||||
import java.sql.SQLIntegrityConstraintViolationException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.TypeSafeMatcher;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.apache.isis.applib.fixturescripts.FixtureScript;
|
||||
import org.apache.isis.applib.fixturescripts.FixtureScripts;
|
||||
|
||||
import domainapp.dom.modules.simple.SimpleObject;
|
||||
import domainapp.dom.modules.simple.SimpleObjects;
|
||||
import domainapp.fixture.modules.simple.SimpleObjectsTearDown;
|
||||
import domainapp.fixture.scenarios.RecreateSimpleObjects;
|
||||
import domainapp.integtests.tests.SimpleAppIntegTest;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import java.sql.SQLIntegrityConstraintViolationException;
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import org.apache.isis.applib.fixturescripts.FixtureScript;
|
||||
import org.apache.isis.applib.fixturescripts.FixtureScripts;
|
||||
import org.hamcrest.Description;
|
||||
import org.hamcrest.Matcher;
|
||||
import org.hamcrest.TypeSafeMatcher;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Fixture Pattern Integration Test
|
||||
*/
|
||||
public class SimpleObjectsIntegTest extends SimpleAppIntegTest {
|
||||
|
||||
@Inject
|
||||
@ -47,6 +46,9 @@ public class SimpleObjectsIntegTest extends SimpleAppIntegTest {
|
||||
@Inject
|
||||
SimpleObjects simpleObjects;
|
||||
|
||||
/**
|
||||
* Test Listing of All Simple Objects
|
||||
*/
|
||||
public static class ListAll extends SimpleObjectsIntegTest {
|
||||
|
||||
@Test
|
||||
@ -83,6 +85,10 @@ public class SimpleObjectsIntegTest extends SimpleAppIntegTest {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test Creation of Simple Objects
|
||||
*/
|
||||
public static class Create extends SimpleObjectsIntegTest {
|
||||
|
||||
@Test
|
||||
@ -140,4 +146,4 @@ public class SimpleObjectsIntegTest extends SimpleAppIntegTest {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user