Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
This file is part of Port@l Port@l 3.0 - Portal Engine and Management System Copyright (C) 2010 Isotrol, SA. http://www.isotrol.com Port@l is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Port@l is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Port@l. If not, see <http://www.gnu.org/licenses/>.
 
 
 package com.isotrol.impe3.test;
 
 
 import static com.isotrol.impe3.test.TestSupport.uuid;
 
 import java.util.Set;
 import java.util.UUID;
 
 
Builder for IMPE3 Test Environment.

Author(s):
Andres Rodriguez
 
 public final class TestIABuilder implements Builder<TestContextBuilder> {
 	private final Set<ContentTypecontentTypesBuilder = Sets.newHashSet();
 	private final ImmutableHierarchy.Builder<UUIDCategorycategoriesBuilder = ImmutableHierarchy.builder();

Default Constructor.
 
 	public TestIABuilder() {
 	}

Returns a new content type.

Parameters:
id Id.
name Localized name.
Returns:
The requested content type.
 
 	public ContentType contentType(UUID idLocalized<Namename) {
 		final ContentType ct = ContentType.builder().setId(id).setName(name).get();
 		return ct;
 	}

Returns a new content type.

Parameters:
name Localized name.
Returns:
The requested content type.
 
 	public ContentType contentType(Localized<Namename) {
 		return contentType(uuid(), name);
 	}

Returns a new content type.

Parameters:
id Id.
name Name.
Returns:
The requested content type.
 
 	public ContentType contentType(UUID idName name) {
 		return contentType(id, Unlocalized.of(name));
 	}

Returns a new content type.

Parameters:
name Name.
Returns:
The requested content type.
 
 	public ContentType contentType(Name name) {
 		return contentType(uuid(), name);
 	}

Returns a new content type with the same display name and path segment.

Parameters:
id Id.
name Name.
Returns:
The requested content type.
	public ContentType contentType(UUID idString name) {
		return contentType(id, Name.of(namename));
	}

Returns a new content type with the same display name and path segment.

Parameters:
name Name.
Returns:
The requested content type.
	public ContentType contentType(String name) {
		return contentType(uuid(), name);
	}

Returns a new category with specified id and localized name.

Parameters:
id Id.
name Localized name.
visible If the category is visible.
routable If the category is routable.
parent Parent category UUID.
Returns:
The requested category.
	public Category category(UUID idLocalized<Namenameboolean visibleboolean routableUUID parent) {
		final Category c = Category.builder().setId(id).setName(name).setVisible(visible).setRoutable(routable).get();
		.add(c.getId(), cparent);
		return c;
	}

Returns a new category with specified id and localized name.

Parameters:
name Localized name.
visible If the category is visible.
routable If the category is routable.
parent Parent category UUID.
Returns:
The requested category.
	public Category category(Localized<Namenameboolean visibleboolean routableUUID parent) {
		return category(uuid(), namevisibleroutableparent);
	}

Returns a new category with specified parent id id and unlocalized name.

Parameters:
id Id.
name Name.
visible If the category is visible.
routable If the category is routable.
parent Parent category UUID.
Returns:
The requested category.
	public Category category(UUID idName nameboolean visibleboolean routableUUID parent) {
		return category(id, Unlocalized.of(name), visibleroutableparent);
	}

Returns a new category with specified parent id id and unlocalized name.

Parameters:
name Name.
visible If the category is visible.
routable If the category is routable.
parent Parent category UUID.
Returns:
The requested category.
	public Category category(Name nameboolean visibleboolean routableUUID parent) {
		return category(uuid(), namevisibleroutableparent);
	}

Returns a new visible and routable category with the same display name and path segment.

Parameters:
id Id.
name Name.
Returns:
The requested category.
	public Category category(UUID idString nameUUID parent) {
		return category(id, Name.of(namename), truetrueparent);
	}

Returns a new visible and routable category with the same display name and path segment.

Parameters:
name Name.
Returns:
The requested category.
	public Category category(String nameUUID parent) {
		return category(uuid(), nameparent);
	}

Create a test enviroment
	public TestContextBuilder get() {
		final ContentTypes contentTypes = ContentTypesFactory.of();
		final Categories categories = CategoriesFactory.of(.get());
		return new TestContextBuilder(contentTypescategories);
	}
New to GrepCode? Check out our FAQ X