diff options
author | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
---|---|---|
committer | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
commit | bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch) | |
tree | 38a92061c0793434c4be189f1d70c3458b6bc41d /branches/sca-java-0.99/modules/topology/src |
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-0.99/modules/topology/src')
12 files changed, 835 insertions, 0 deletions
diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Component.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Component.java new file mode 100644 index 0000000000..512fa19645 --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Component.java @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology; + +/** + * Represents an SCA component and is used to represent which components + * will run on a node + * + * @version $Rev$ $Date$ + */ +public interface Component { + + /** + * Get the compoent name + * + * @return + */ + public String getName(); + + /** + * Set the compoent name + * + * @param name + */ + public void setName(String name); + + /** + * Get the name of the domain that this scheme belongs to + * Not sure in this case whether the domain name should + * be part of the component name but am keeping it + * separate for now + * + * @return + */ + public String getDomainName(); + + /** + * Set the name of the domain that this scheme belongs to + * Not sure in this case whether the domain name should + * be part of the component name but am keeping it + * separate for now + * + * @param name + */ + public void setDomainName(String domainName); +} diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/DefaultTopologyFactory.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/DefaultTopologyFactory.java new file mode 100644 index 0000000000..ddeeac9a93 --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/DefaultTopologyFactory.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology; + +import org.apache.tuscany.sca.topology.impl.TopologyFactoryImpl; + +/** + * A default factory for the topology model. + * + * @version $Rev$ $Date$ + */ +public class DefaultTopologyFactory extends TopologyFactoryImpl implements TopologyFactory { + +} diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Node.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Node.java new file mode 100644 index 0000000000..a44e998e43 --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Node.java @@ -0,0 +1,73 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology; + +import java.util.List; +import java.util.Set; + +/** + * Represents an SCA node implementation. An SCA node is a running instance + * of a program able to run SCA assemblies. A distributes runtime contains + * main nodes + * + * @version $Rev$ $Date$ + */ +public interface Node { + + /** + * Get the node name + * + * @return + */ + public String getName(); + + /** + * Set the node name + * + * @param name + */ + public void setName(String name); + + /** + * Get domain names + * + * @return + */ + public Set<String> getDomainNames(); + + /** + * Return the Scheme/base URL pairs that this node uses for the + * specified domain. + * + * @param domainName + * @return + */ + public List<Scheme> getSchemes(String domainName); + + /** + * Return the list of components that this node will run for the + * specified domain + * + * @param domainName + * @return + */ + public List<Component> getComponents(String domainName); + +} diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Runtime.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Runtime.java new file mode 100644 index 0000000000..7775a3878f --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Runtime.java @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology; + +import java.util.List; + + +/** + * Represents an SCA runtime. + * + * TBD - just a place holder at the moment + * + * @version $Rev$ $Date$ + */ +public interface Runtime { + + /** + * Returns the list of nodes that form this runtime + * + * @return + */ + public List<Node> getNodes(); + + /** + * Get a node by node name + * + * @param nodeName the name of the node to return + * @return the node + */ + public Node getNode(String nodeName); +} diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Scheme.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Scheme.java new file mode 100644 index 0000000000..794e43e8a6 --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/Scheme.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology; + + +/** + * Represents an SCA scheme. This holds the base URL that a runtime node + * will use by default to expose services + * + * @version $Rev$ $Date$ + */ +public interface Scheme { + + /** + * Get the scheme name + * + * @return + */ + public String getName(); + + /** + * Set the scheme name + * + * @param name + */ + public void setName(String name); + + /** + * Get the scheme base URL + * + * @return + */ + public String getBaseURL(); + + /** + * Set the scheme base URL + * + * @param name + */ + public void setBaseURL(String urlString); + + /** + * Get the name of the domain that this scheme belongs to + * + * @return + */ + public String getDomainName(); + + /** + * Set the name of the domain that this scheme belongs to + * + * @param name + */ + public void setDomainName(String domainName); +} diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/TopologyFactory.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/TopologyFactory.java new file mode 100644 index 0000000000..020b15ea17 --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/TopologyFactory.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology; + + +/** + * A factory for the topology model. + * + * @version $Rev$ $Date$ + */ +public interface TopologyFactory { + + + /** + * Creates a new runtime. + * @return + */ + public Runtime createRuntime(); + + /** + * Creates a new node. + * @return + */ + public Node createNode(); + + /** + * Creates a new scheme. + * @return + */ + public Scheme createScheme(); + + /** + * Creates a new component. + * @return + */ + public Component createComponent(); + +} diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/ComponentImpl.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/ComponentImpl.java new file mode 100644 index 0000000000..68364e3420 --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/ComponentImpl.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology.impl; + +import org.apache.tuscany.sca.topology.Component; + +/** + * Represents the scheme defintion for a domain. + * + * TBD - just a place holder at the moment + * + * @version $Rev$ $Date$ + */ +public class ComponentImpl implements Component { + + private String name; + private String domainName; + + /** + * Get the component name + * + * @return + */ + public String getName() { + return this.name; + } + + /** + * Set the component name + * + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the name of the domain that this component belongs to + * + * @return + */ + public String getDomainName() { + return domainName; + } + + /** + * Set the name of the domain that this component belongs to + * + * @param name + */ + public void setDomainName(String domainName) { + this.domainName = domainName; + } + +} diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/NodeImpl.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/NodeImpl.java new file mode 100644 index 0000000000..0200376caa --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/NodeImpl.java @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Set; + +import org.apache.tuscany.sca.topology.Node; +import org.apache.tuscany.sca.topology.Scheme; +import org.apache.tuscany.sca.topology.Component; + +/** + * Represents an SCA node implementation. + * + * @version $Rev$ $Date$ + */ + +public class NodeImpl implements Node { + private HashMap<String, DomainContainer> nodeDomain = new HashMap<String, DomainContainer>(); + private String name; + + public class DomainContainer { + private List<Scheme> schemes = new ArrayList<Scheme>(); + private List<Component> components = new ArrayList<Component>(); + + public List<Scheme> getSchemes() { + return schemes; + } + + public List<Component> getComponents() { + return components; + } + } + + /** + * Constructs a new node. + */ + protected NodeImpl() { + } + + /** + * Get the node name + * + * @return + */ + public String getName() { + return name; + } + + /** + * Set the node name + * + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get domain names + * + * @return + */ + public Set<String> getDomainNames() { + return nodeDomain.keySet(); + } + + /** + * Return the Scheme/base URL pairs that this node uses for the + * specified domain. + * + * @param domainName + * @return + */ + public List<Scheme> getSchemes(String domainName) { + DomainContainer container = nodeDomain.get(domainName); + + if (container == null) { + container = new DomainContainer(); + nodeDomain.put(domainName, container); + } + return container.getSchemes(); + } + + /** + * Return the list of components that this node will run for the + * specified domain + * + * @param domainName + * @return + */ + public List<Component> getComponents(String domainName) { + DomainContainer container = nodeDomain.get(domainName); + + if (container == null) { + container = new DomainContainer(); + nodeDomain.put(domainName, container); + } + return container.getComponents(); + } +}
\ No newline at end of file diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/RuntimeImpl.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/RuntimeImpl.java new file mode 100644 index 0000000000..9a4568deee --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/RuntimeImpl.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology.impl; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.tuscany.sca.topology.Runtime; +import org.apache.tuscany.sca.topology.Node; + +/** + * Represents an SCA runtime. + * + * TBD - just a place holder at the moment + * + * @version $Rev$ $Date$ + */ +public class RuntimeImpl implements Runtime { + private List<Node> nodes = new ArrayList<Node>(); + + public List<Node> getNodes() { + return nodes; + } + + public Node getNode(String nodeName){ + Node returnNode = null; + + for(Node node : getNodes()){ + if ( node.getName().equals(nodeName)){ + returnNode = node; + break; + } + } + + return returnNode; + } + +} diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/SchemeImpl.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/SchemeImpl.java new file mode 100644 index 0000000000..ffd08cef92 --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/SchemeImpl.java @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology.impl; + +import org.apache.tuscany.sca.topology.Scheme; + +/** + * Represents the scheme defintion for a domain. + * + * TBD - just a place holder at the moment + * + * @version $Rev$ $Date$ + */ +public class SchemeImpl implements Scheme { + + private String name; + private String baseURL; + private String domainName; + + /** + * Get the scheme name + * + * @return + */ + public String getName() { + return this.name; + } + + /** + * Set the scheme name + * + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Get the scheme base URL + * + * @return + */ + public String getBaseURL() { + return baseURL; + } + + /** + * Set the scheme base URL + * + * @param name + */ + public void setBaseURL(String urlString) { + this.baseURL = urlString; + } + + /** + * Get the name of the domain that this scheme belongs to + * + * @return + */ + public String getDomainName() { + return domainName; + } + + /** + * Set the name of the domain that this scheme belongs to + * + * @param name + */ + public void setDomainName(String domainName) { + this.domainName = domainName; + } + +} diff --git a/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/TopologyFactoryImpl.java b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/TopologyFactoryImpl.java new file mode 100644 index 0000000000..793ed4a06d --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/main/java/org/apache/tuscany/sca/topology/impl/TopologyFactoryImpl.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ + +package org.apache.tuscany.sca.topology.impl; + +import org.apache.tuscany.sca.topology.Component; +import org.apache.tuscany.sca.topology.Node; +import org.apache.tuscany.sca.topology.Runtime; +import org.apache.tuscany.sca.topology.Scheme; +import org.apache.tuscany.sca.topology.TopologyFactory; + +/** + * A factory for the topology model. + * + * @version $Rev$ $Date$ + */ +public class TopologyFactoryImpl implements TopologyFactory { + + public Runtime createRuntime() { + return new RuntimeImpl(); + } + + public Node createNode() { + return new NodeImpl(); + } + + public Scheme createScheme() { + return new SchemeImpl(); + } + + public Component createComponent() { + return new ComponentImpl(); + } +} diff --git a/branches/sca-java-0.99/modules/topology/src/test/java/org/apache/tuscany/sca/topology/TopologyFactoryTestCase.java b/branches/sca-java-0.99/modules/topology/src/test/java/org/apache/tuscany/sca/topology/TopologyFactoryTestCase.java new file mode 100644 index 0000000000..0cf572ba57 --- /dev/null +++ b/branches/sca-java-0.99/modules/topology/src/test/java/org/apache/tuscany/sca/topology/TopologyFactoryTestCase.java @@ -0,0 +1,105 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding 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 the License. + */ +package org.apache.tuscany.sca.topology; + +import java.util.List; + +import junit.framework.TestCase; + + +/** + * Test building of assembly model instances using the assembly factory. + * + * @version $Rev$ $Date$ + */ +public class TopologyFactoryTestCase extends TestCase { + + TopologyFactory topologyFactory; + + @Override + public void setUp() throws Exception { + topologyFactory = new DefaultTopologyFactory(); + } + + @Override + public void tearDown() throws Exception { + topologyFactory = null; + } + + public void testCreateRuntime() { + Runtime runtime = topologyFactory.createRuntime(); + + List<Node> nodeList = runtime.getNodes(); + assertNotNull(nodeList); + } + + public void testCreateNode() { + Node node = topologyFactory.createNode(); + + node.setName("nodeA"); + assertEquals(node.getName(), "nodeA"); + + List<Scheme> schemeList = node.getSchemes("domainA"); + assertNotNull(schemeList); + + List<Component> componentList = node.getComponents("domainA"); + assertNotNull(componentList); + } + + public void testCreateScheme() { + Scheme scheme = topologyFactory.createScheme(); + + scheme.setName("http"); + assertEquals(scheme.getName(), "http"); + + scheme.setBaseURL("http://localhost:8080"); + assertEquals(scheme.getBaseURL(), "http://localhost:8080"); + + scheme.setDomainName("domainA"); + assertEquals(scheme.getDomainName(), "domainA"); + + Node node = topologyFactory.createNode(); + List<Scheme> schemeList = node.getSchemes("domainA"); + schemeList.add(scheme); + List<Scheme> schemeList1 = node.getSchemes("domainA"); + Scheme scheme1 = schemeList1.get(0); + + assertEquals(scheme1.getName(), "http"); + + } + + public void testCreateComponent() { + Component component = topologyFactory.createComponent(); + + component.setName("componentA"); + assertEquals(component.getName(), "componentA"); + + component.setDomainName("domainA"); + assertEquals(component.getDomainName(), "domainA"); + + Node node = topologyFactory.createNode(); + List<Component> componentList = node.getComponents("domainA"); + componentList.add(component); + List<Component> componentList1 = node.getComponents("domainA"); + Component component1 = componentList1.get(0); + + assertEquals(component1.getName(), "componentA"); + } + +} |